Skip to content
Snippets Groups Projects
Commit 5551b553 authored by Martin Marinov's avatar Martin Marinov Committed by GitHub Enterprise
Browse files

REFORM-1097 Fix Test::Checksum::Compare (#64)

parent 682d7172
No related branches found
No related tags found
1 merge request!14Merge latest changes to Base from ReForm
...@@ -356,10 +356,6 @@ void Compare::Impl::check_equal() const ...@@ -356,10 +356,6 @@ void Compare::Impl::check_equal() const
TEST_THROW_ERROR(TEST_CHECKSUM_COMPARE_DIFFERENCES); TEST_THROW_ERROR(TEST_CHECKSUM_COMPARE_DIFFERENCES);
} }
} }
Compare::Impl* Compare::impl_ = nullptr;
bool Compare::owned_ = false;
void Compare::make() void Compare::make()
{ {
if (impl_ != nullptr) if (impl_ != nullptr)
...@@ -371,7 +367,7 @@ void Compare::make() ...@@ -371,7 +367,7 @@ void Compare::make()
void Compare::set(Compare& _othr) void Compare::set(Compare& _othr)
{ {
TEST_THROW_ERROR_if( TEST_THROW_ERROR_if(
_othr.impl_ != nullptr, TEST_CHECKSUM_COMPARE_INCOMING_IMPL_NULL); _othr.impl_ == nullptr, TEST_CHECKSUM_COMPARE_INCOMING_IMPL_NULL);
TEST_THROW_ERROR_if(impl_ != nullptr, TEST_CHECKSUM_COMPARE_IMPL_ALREADY_SET); TEST_THROW_ERROR_if(impl_ != nullptr, TEST_CHECKSUM_COMPARE_IMPL_ALREADY_SET);
impl_ = _othr.impl_; impl_ = _othr.impl_;
......
...@@ -41,15 +41,14 @@ linked statically, i.e., they share the same binary. ...@@ -41,15 +41,14 @@ linked statically, i.e., they share the same binary.
class Compare class Compare
{ {
public: public:
//! Destroy the owned instance
~Compare();
//! Make and store the unique instance //! Make and store the unique instance
static void make(); void make();
//! Set an instance made in another binary //! Set an instance made in another binary
static void set(Compare&); void set(Compare&);
public:
//! Destroy the owned instance
~Compare();
//! Set the report pair to compare //! Set the report pair to compare
void set_reports(const fs::path& _left_path, const fs::path& _right_path); void set_reports(const fs::path& _left_path, const fs::path& _right_path);
...@@ -76,8 +75,8 @@ private: ...@@ -76,8 +75,8 @@ private:
private: private:
class Impl; class Impl;
static Impl* impl_; // shared implementation pointer Impl* impl_ = nullptr; // shared implementation
static bool owned_; // own implementation or not bool owned_ = false; // own implementation or not
}; };
/*! /*!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment