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
Branches
No related tags found
1 merge request!14Merge latest changes to Base from ReForm
......@@ -356,10 +356,6 @@ void Compare::Impl::check_equal() const
TEST_THROW_ERROR(TEST_CHECKSUM_COMPARE_DIFFERENCES);
}
}
Compare::Impl* Compare::impl_ = nullptr;
bool Compare::owned_ = false;
void Compare::make()
{
if (impl_ != nullptr)
......@@ -371,7 +367,7 @@ void Compare::make()
void Compare::set(Compare& _othr)
{
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);
impl_ = _othr.impl_;
......
......@@ -41,15 +41,14 @@ linked statically, i.e., they share the same binary.
class Compare
{
public:
//! Destroy the owned instance
~Compare();
//! Make and store the unique instance
static void make();
void make();
//! Set an instance made in another binary
static void set(Compare&);
public:
//! Destroy the owned instance
~Compare();
void set(Compare&);
//! Set the report pair to compare
void set_reports(const fs::path& _left_path, const fs::path& _right_path);
......@@ -76,8 +75,8 @@ private:
private:
class Impl;
static Impl* impl_; // shared implementation pointer
static bool owned_; // own implementation or not
Impl* impl_ = nullptr; // shared implementation
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