Issue #57. Add missing 'override' keyword
This commit is contained in:
parent
6d4e1d1ea3
commit
64feea7374
2
external/gtest/include/gtest/gtest-spi.h
vendored
2
external/gtest/include/gtest/gtest-spi.h
vendored
|
@ -75,7 +75,7 @@ class GTEST_API_ ScopedFakeTestPartResultReporter
|
||||||
//
|
//
|
||||||
// This method is from the TestPartResultReporterInterface
|
// This method is from the TestPartResultReporterInterface
|
||||||
// interface.
|
// interface.
|
||||||
virtual void ReportTestPartResult(const TestPartResult& result);
|
virtual void ReportTestPartResult(const TestPartResult& result) override;
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
|
|
@ -162,8 +162,8 @@ class GTEST_API_ HasNewFatalFailureHelper
|
||||||
: public TestPartResultReporterInterface {
|
: public TestPartResultReporterInterface {
|
||||||
public:
|
public:
|
||||||
HasNewFatalFailureHelper();
|
HasNewFatalFailureHelper();
|
||||||
virtual ~HasNewFatalFailureHelper();
|
virtual ~HasNewFatalFailureHelper() override;
|
||||||
virtual void ReportTestPartResult(const TestPartResult& result);
|
virtual void ReportTestPartResult(const TestPartResult& result) override;
|
||||||
bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
|
bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
|
||||||
private:
|
private:
|
||||||
bool has_new_fatal_failure_;
|
bool has_new_fatal_failure_;
|
||||||
|
|
26
external/gtest/include/gtest/gtest.h
vendored
26
external/gtest/include/gtest/gtest.h
vendored
|
@ -1011,21 +1011,21 @@ class TestEventListener {
|
||||||
// above.
|
// above.
|
||||||
class EmptyTestEventListener : public TestEventListener {
|
class EmptyTestEventListener : public TestEventListener {
|
||||||
public:
|
public:
|
||||||
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
|
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
|
virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
|
||||||
int /*iteration*/) {}
|
int /*iteration*/) override {}
|
||||||
virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
|
virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
|
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
|
virtual void OnTestCaseStart(const TestCase& /*test_case*/) override {}
|
||||||
virtual void OnTestStart(const TestInfo& /*test_info*/) {}
|
virtual void OnTestStart(const TestInfo& /*test_info*/) override {}
|
||||||
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
|
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {}
|
||||||
virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
|
virtual void OnTestEnd(const TestInfo& /*test_info*/) override {}
|
||||||
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
|
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
|
||||||
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
|
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
|
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
|
virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
|
||||||
int /*iteration*/) {}
|
int /*iteration*/) override {}
|
||||||
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
|
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TestEventListeners lets users add listeners to track events in Google Test.
|
// TestEventListeners lets users add listeners to track events in Google Test.
|
||||||
|
|
|
@ -148,7 +148,7 @@ class DeathTestFactory {
|
||||||
class DefaultDeathTestFactory : public DeathTestFactory {
|
class DefaultDeathTestFactory : public DeathTestFactory {
|
||||||
public:
|
public:
|
||||||
virtual bool Create(const char* statement, const RE* regex,
|
virtual bool Create(const char* statement, const RE* regex,
|
||||||
const char* file, int line, DeathTest** test);
|
const char* file, int line, DeathTest** test) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Returns true if exit_status describes a process that was terminated
|
// Returns true if exit_status describes a process that was terminated
|
||||||
|
|
|
@ -451,7 +451,7 @@ class TestFactoryBase {
|
||||||
template <class TestClass>
|
template <class TestClass>
|
||||||
class TestFactoryImpl : public TestFactoryBase {
|
class TestFactoryImpl : public TestFactoryBase {
|
||||||
public:
|
public:
|
||||||
virtual Test* CreateTest() { return new TestClass; }
|
virtual Test* CreateTest() override { return new TestClass; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#if GTEST_OS_WINDOWS
|
#if GTEST_OS_WINDOWS
|
||||||
|
@ -1138,7 +1138,7 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
|
||||||
public:\
|
public:\
|
||||||
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
|
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
|
||||||
private:\
|
private:\
|
||||||
virtual void TestBody();\
|
virtual void TestBody() override;\
|
||||||
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
|
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
|
||||||
GTEST_DISALLOW_COPY_AND_ASSIGN_(\
|
GTEST_DISALLOW_COPY_AND_ASSIGN_(\
|
||||||
GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
|
GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
|
||||||
|
|
|
@ -270,12 +270,12 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
|
||||||
template <typename ForwardIterator>
|
template <typename ForwardIterator>
|
||||||
ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
|
ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
|
||||||
: container_(begin, end) {}
|
: container_(begin, end) {}
|
||||||
virtual ~ValuesInIteratorRangeGenerator() {}
|
virtual ~ValuesInIteratorRangeGenerator() override {}
|
||||||
|
|
||||||
virtual ParamIteratorInterface<T>* Begin() const {
|
virtual ParamIteratorInterface<T>* Begin() const override {
|
||||||
return new Iterator(this, container_.begin());
|
return new Iterator(this, container_.begin());
|
||||||
}
|
}
|
||||||
virtual ParamIteratorInterface<T>* End() const {
|
virtual ParamIteratorInterface<T>* End() const override {
|
||||||
return new Iterator(this, container_.end());
|
return new Iterator(this, container_.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,16 +287,16 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
|
||||||
Iterator(const ParamGeneratorInterface<T>* base,
|
Iterator(const ParamGeneratorInterface<T>* base,
|
||||||
typename ContainerType::const_iterator iterator)
|
typename ContainerType::const_iterator iterator)
|
||||||
: base_(base), iterator_(iterator) {}
|
: base_(base), iterator_(iterator) {}
|
||||||
virtual ~Iterator() {}
|
virtual ~Iterator() override {}
|
||||||
|
|
||||||
virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
|
virtual const ParamGeneratorInterface<T>* BaseGenerator() const override {
|
||||||
return base_;
|
return base_;
|
||||||
}
|
}
|
||||||
virtual void Advance() {
|
virtual void Advance() override {
|
||||||
++iterator_;
|
++iterator_;
|
||||||
value_.reset();
|
value_.reset();
|
||||||
}
|
}
|
||||||
virtual ParamIteratorInterface<T>* Clone() const {
|
virtual ParamIteratorInterface<T>* Clone() const override {
|
||||||
return new Iterator(*this);
|
return new Iterator(*this);
|
||||||
}
|
}
|
||||||
// We need to use cached value referenced by iterator_ because *iterator_
|
// We need to use cached value referenced by iterator_ because *iterator_
|
||||||
|
@ -306,12 +306,12 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
|
||||||
// can advance iterator_ beyond the end of the range, and we cannot
|
// can advance iterator_ beyond the end of the range, and we cannot
|
||||||
// detect that fact. The client code, on the other hand, is
|
// detect that fact. The client code, on the other hand, is
|
||||||
// responsible for not calling Current() on an out-of-range iterator.
|
// responsible for not calling Current() on an out-of-range iterator.
|
||||||
virtual const T* Current() const {
|
virtual const T* Current() const override {
|
||||||
if (value_.get() == NULL)
|
if (value_.get() == NULL)
|
||||||
value_.reset(new T(*iterator_));
|
value_.reset(new T(*iterator_));
|
||||||
return value_.get();
|
return value_.get();
|
||||||
}
|
}
|
||||||
virtual bool Equals(const ParamIteratorInterface<T>& other) const {
|
virtual bool Equals(const ParamIteratorInterface<T>& other) const override {
|
||||||
// Having the same base generator guarantees that the other
|
// Having the same base generator guarantees that the other
|
||||||
// iterator is of the same type and we can downcast.
|
// iterator is of the same type and we can downcast.
|
||||||
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
|
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
|
||||||
|
@ -355,7 +355,7 @@ class ParameterizedTestFactory : public TestFactoryBase {
|
||||||
typedef typename TestClass::ParamType ParamType;
|
typedef typename TestClass::ParamType ParamType;
|
||||||
explicit ParameterizedTestFactory(ParamType parameter) :
|
explicit ParameterizedTestFactory(ParamType parameter) :
|
||||||
parameter_(parameter) {}
|
parameter_(parameter) {}
|
||||||
virtual Test* CreateTest() {
|
virtual Test* CreateTest() override {
|
||||||
TestClass::SetParam(¶meter_);
|
TestClass::SetParam(¶meter_);
|
||||||
return new TestClass();
|
return new TestClass();
|
||||||
}
|
}
|
||||||
|
@ -454,9 +454,9 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
|
||||||
: test_case_name_(name) {}
|
: test_case_name_(name) {}
|
||||||
|
|
||||||
// Test case base name for display purposes.
|
// Test case base name for display purposes.
|
||||||
virtual const string& GetTestCaseName() const { return test_case_name_; }
|
virtual const string& GetTestCaseName() const override { return test_case_name_; }
|
||||||
// Test case id to verify identity.
|
// Test case id to verify identity.
|
||||||
virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
|
virtual TypeId GetTestCaseTypeId() const override { return GetTypeId<TestCase>(); }
|
||||||
// TEST_P macro uses AddTestPattern() to record information
|
// TEST_P macro uses AddTestPattern() to record information
|
||||||
// about a single test in a LocalTestInfo structure.
|
// about a single test in a LocalTestInfo structure.
|
||||||
// test_case_name is the base name of the test case (without invocation
|
// test_case_name is the base name of the test case (without invocation
|
||||||
|
@ -484,7 +484,7 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
|
||||||
// This method should not be called more then once on any single
|
// This method should not be called more then once on any single
|
||||||
// instance of a ParameterizedTestCaseInfoBase derived class.
|
// instance of a ParameterizedTestCaseInfoBase derived class.
|
||||||
// UnitTest has a guard to prevent from calling this method more then once.
|
// UnitTest has a guard to prevent from calling this method more then once.
|
||||||
virtual void RegisterTests() {
|
virtual void RegisterTests() override {
|
||||||
for (typename TestInfoContainer::iterator test_it = tests_.begin();
|
for (typename TestInfoContainer::iterator test_it = tests_.begin();
|
||||||
test_it != tests_.end(); ++test_it) {
|
test_it != tests_.end(); ++test_it) {
|
||||||
linked_ptr<TestInfo> test_info = *test_it;
|
linked_ptr<TestInfo> test_info = *test_it;
|
||||||
|
|
|
@ -1296,7 +1296,7 @@ class ThreadWithParam : public ThreadWithParamBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Run() {
|
virtual void Run() override {
|
||||||
if (thread_can_start_ != NULL)
|
if (thread_can_start_ != NULL)
|
||||||
thread_can_start_->WaitForNotification();
|
thread_can_start_->WaitForNotification();
|
||||||
func_(param_);
|
func_(param_);
|
||||||
|
|
10
external/gtest/src/gtest-death-test.cc
vendored
10
external/gtest/src/gtest-death-test.cc
vendored
|
@ -373,8 +373,8 @@ class DeathTestImpl : public DeathTest {
|
||||||
// read_fd_ is expected to be closed and cleared by a derived class.
|
// read_fd_ is expected to be closed and cleared by a derived class.
|
||||||
~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
|
~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
|
||||||
|
|
||||||
void Abort(AbortReason reason);
|
void Abort(AbortReason reason) override;
|
||||||
virtual bool Passed(bool status_ok);
|
virtual bool Passed(bool status_ok) override;
|
||||||
|
|
||||||
const char* statement() const { return statement_; }
|
const char* statement() const { return statement_; }
|
||||||
const RE* regex() const { return regex_; }
|
const RE* regex() const { return regex_; }
|
||||||
|
@ -778,7 +778,7 @@ class ForkingDeathTest : public DeathTestImpl {
|
||||||
ForkingDeathTest(const char* statement, const RE* regex);
|
ForkingDeathTest(const char* statement, const RE* regex);
|
||||||
|
|
||||||
// All of these virtual functions are inherited from DeathTest.
|
// All of these virtual functions are inherited from DeathTest.
|
||||||
virtual int Wait();
|
virtual int Wait() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
|
void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
|
||||||
|
@ -814,7 +814,7 @@ class NoExecDeathTest : public ForkingDeathTest {
|
||||||
public:
|
public:
|
||||||
NoExecDeathTest(const char* a_statement, const RE* a_regex) :
|
NoExecDeathTest(const char* a_statement, const RE* a_regex) :
|
||||||
ForkingDeathTest(a_statement, a_regex) { }
|
ForkingDeathTest(a_statement, a_regex) { }
|
||||||
virtual TestRole AssumeRole();
|
virtual TestRole AssumeRole() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The AssumeRole process for a fork-and-run death test. It implements a
|
// The AssumeRole process for a fork-and-run death test. It implements a
|
||||||
|
@ -870,7 +870,7 @@ class ExecDeathTest : public ForkingDeathTest {
|
||||||
ExecDeathTest(const char* a_statement, const RE* a_regex,
|
ExecDeathTest(const char* a_statement, const RE* a_regex,
|
||||||
const char* file, int line) :
|
const char* file, int line) :
|
||||||
ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
|
ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
|
||||||
virtual TestRole AssumeRole();
|
virtual TestRole AssumeRole() override;
|
||||||
private:
|
private:
|
||||||
static ::std::vector<testing::internal::string>
|
static ::std::vector<testing::internal::string>
|
||||||
GetArgvsForDeathTestChildProcess() {
|
GetArgvsForDeathTestChildProcess() {
|
||||||
|
|
30
external/gtest/src/gtest-internal-inl.h
vendored
30
external/gtest/src/gtest-internal-inl.h
vendored
|
@ -441,10 +441,10 @@ class OsStackTraceGetter : public OsStackTraceGetterInterface {
|
||||||
public:
|
public:
|
||||||
OsStackTraceGetter() : caller_frame_(NULL) {}
|
OsStackTraceGetter() : caller_frame_(NULL) {}
|
||||||
|
|
||||||
virtual string CurrentStackTrace(int max_depth, int skip_count)
|
virtual string CurrentStackTrace(int max_depth, int skip_count) override
|
||||||
GTEST_LOCK_EXCLUDED_(mutex_);
|
GTEST_LOCK_EXCLUDED_(mutex_);
|
||||||
|
|
||||||
virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_);
|
virtual void UponLeavingGTest() override GTEST_LOCK_EXCLUDED_(mutex_);
|
||||||
|
|
||||||
// This string is inserted in place of stack frames that are part of
|
// This string is inserted in place of stack frames that are part of
|
||||||
// Google Test's implementation.
|
// Google Test's implementation.
|
||||||
|
@ -477,7 +477,7 @@ class DefaultGlobalTestPartResultReporter
|
||||||
explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
|
explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
|
||||||
// Implements the TestPartResultReporterInterface. Reports the test part
|
// Implements the TestPartResultReporterInterface. Reports the test part
|
||||||
// result in the current test.
|
// result in the current test.
|
||||||
virtual void ReportTestPartResult(const TestPartResult& result);
|
virtual void ReportTestPartResult(const TestPartResult& result) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UnitTestImpl* const unit_test_;
|
UnitTestImpl* const unit_test_;
|
||||||
|
@ -493,7 +493,7 @@ class DefaultPerThreadTestPartResultReporter
|
||||||
explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
|
explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
|
||||||
// Implements the TestPartResultReporterInterface. The implementation just
|
// Implements the TestPartResultReporterInterface. The implementation just
|
||||||
// delegates to the current global test part result reporter of *unit_test_.
|
// delegates to the current global test part result reporter of *unit_test_.
|
||||||
virtual void ReportTestPartResult(const TestPartResult& result);
|
virtual void ReportTestPartResult(const TestPartResult& result) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UnitTestImpl* const unit_test_;
|
UnitTestImpl* const unit_test_;
|
||||||
|
@ -1100,7 +1100,7 @@ class StreamingListener : public EmptyTestEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sends a string to the socket.
|
// Sends a string to the socket.
|
||||||
virtual void Send(const string& message) {
|
virtual void Send(const string& message) override {
|
||||||
GTEST_CHECK_(sockfd_ != -1)
|
GTEST_CHECK_(sockfd_ != -1)
|
||||||
<< "Send() can be called only when there is a connection.";
|
<< "Send() can be called only when there is a connection.";
|
||||||
|
|
||||||
|
@ -1117,7 +1117,7 @@ class StreamingListener : public EmptyTestEventListener {
|
||||||
void MakeConnection();
|
void MakeConnection();
|
||||||
|
|
||||||
// Closes the socket.
|
// Closes the socket.
|
||||||
void CloseConnection() {
|
void CloseConnection() override {
|
||||||
GTEST_CHECK_(sockfd_ != -1)
|
GTEST_CHECK_(sockfd_ != -1)
|
||||||
<< "CloseConnection() can be called only when there is a connection.";
|
<< "CloseConnection() can be called only when there is a connection.";
|
||||||
|
|
||||||
|
@ -1141,11 +1141,11 @@ class StreamingListener : public EmptyTestEventListener {
|
||||||
explicit StreamingListener(AbstractSocketWriter* socket_writer)
|
explicit StreamingListener(AbstractSocketWriter* socket_writer)
|
||||||
: socket_writer_(socket_writer) { Start(); }
|
: socket_writer_(socket_writer) { Start(); }
|
||||||
|
|
||||||
void OnTestProgramStart(const UnitTest& /* unit_test */) {
|
void OnTestProgramStart(const UnitTest& /* unit_test */) override {
|
||||||
SendLn("event=TestProgramStart");
|
SendLn("event=TestProgramStart");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestProgramEnd(const UnitTest& unit_test) {
|
void OnTestProgramEnd(const UnitTest& unit_test) override {
|
||||||
// Note that Google Test current only report elapsed time for each
|
// Note that Google Test current only report elapsed time for each
|
||||||
// test iteration, not for the entire test program.
|
// test iteration, not for the entire test program.
|
||||||
SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
|
SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
|
||||||
|
@ -1154,39 +1154,39 @@ class StreamingListener : public EmptyTestEventListener {
|
||||||
socket_writer_->CloseConnection();
|
socket_writer_->CloseConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
|
void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) override {
|
||||||
SendLn("event=TestIterationStart&iteration=" +
|
SendLn("event=TestIterationStart&iteration=" +
|
||||||
StreamableToString(iteration));
|
StreamableToString(iteration));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
|
void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) override {
|
||||||
SendLn("event=TestIterationEnd&passed=" +
|
SendLn("event=TestIterationEnd&passed=" +
|
||||||
FormatBool(unit_test.Passed()) + "&elapsed_time=" +
|
FormatBool(unit_test.Passed()) + "&elapsed_time=" +
|
||||||
StreamableToString(unit_test.elapsed_time()) + "ms");
|
StreamableToString(unit_test.elapsed_time()) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestCaseStart(const TestCase& test_case) {
|
void OnTestCaseStart(const TestCase& test_case) override {
|
||||||
SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
|
SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestCaseEnd(const TestCase& test_case) {
|
void OnTestCaseEnd(const TestCase& test_case) override {
|
||||||
SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
|
SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
|
||||||
+ "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
|
+ "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
|
||||||
+ "ms");
|
+ "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestStart(const TestInfo& test_info) {
|
void OnTestStart(const TestInfo& test_info) override {
|
||||||
SendLn(std::string("event=TestStart&name=") + test_info.name());
|
SendLn(std::string("event=TestStart&name=") + test_info.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestEnd(const TestInfo& test_info) {
|
void OnTestEnd(const TestInfo& test_info) override {
|
||||||
SendLn("event=TestEnd&passed=" +
|
SendLn("event=TestEnd&passed=" +
|
||||||
FormatBool((test_info.result())->Passed()) +
|
FormatBool((test_info.result())->Passed()) +
|
||||||
"&elapsed_time=" +
|
"&elapsed_time=" +
|
||||||
StreamableToString((test_info.result())->elapsed_time()) + "ms");
|
StreamableToString((test_info.result())->elapsed_time()) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnTestPartResult(const TestPartResult& test_part_result) {
|
void OnTestPartResult(const TestPartResult& test_part_result) override {
|
||||||
const char* file_name = test_part_result.file_name();
|
const char* file_name = test_part_result.file_name();
|
||||||
if (file_name == NULL)
|
if (file_name == NULL)
|
||||||
file_name = "";
|
file_name = "";
|
||||||
|
|
54
external/gtest/src/gtest.cc
vendored
54
external/gtest/src/gtest.cc
vendored
|
@ -2697,19 +2697,19 @@ class PrettyUnitTestResultPrinter : public TestEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following methods override what's in the TestEventListener class.
|
// The following methods override what's in the TestEventListener class.
|
||||||
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
|
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
|
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
|
||||||
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
|
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
|
||||||
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
|
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnTestCaseStart(const TestCase& test_case);
|
virtual void OnTestCaseStart(const TestCase& test_case) override;
|
||||||
virtual void OnTestStart(const TestInfo& test_info);
|
virtual void OnTestStart(const TestInfo& test_info) override;
|
||||||
virtual void OnTestPartResult(const TestPartResult& result);
|
virtual void OnTestPartResult(const TestPartResult& result) override;
|
||||||
virtual void OnTestEnd(const TestInfo& test_info);
|
virtual void OnTestEnd(const TestInfo& test_info) override;
|
||||||
virtual void OnTestCaseEnd(const TestCase& test_case);
|
virtual void OnTestCaseEnd(const TestCase& test_case) override;
|
||||||
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
|
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
|
||||||
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
|
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
|
||||||
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
|
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
|
||||||
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
|
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void PrintFailedTests(const UnitTest& unit_test);
|
static void PrintFailedTests(const UnitTest& unit_test);
|
||||||
|
@ -2908,19 +2908,19 @@ class TestEventRepeater : public TestEventListener {
|
||||||
bool forwarding_enabled() const { return forwarding_enabled_; }
|
bool forwarding_enabled() const { return forwarding_enabled_; }
|
||||||
void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
|
void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
|
||||||
|
|
||||||
virtual void OnTestProgramStart(const UnitTest& unit_test);
|
virtual void OnTestProgramStart(const UnitTest& unit_test) override;
|
||||||
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
|
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
|
||||||
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
|
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
|
||||||
virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
|
virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) override;
|
||||||
virtual void OnTestCaseStart(const TestCase& test_case);
|
virtual void OnTestCaseStart(const TestCase& test_case) override;
|
||||||
virtual void OnTestStart(const TestInfo& test_info);
|
virtual void OnTestStart(const TestInfo& test_info) override;
|
||||||
virtual void OnTestPartResult(const TestPartResult& result);
|
virtual void OnTestPartResult(const TestPartResult& result) override;
|
||||||
virtual void OnTestEnd(const TestInfo& test_info);
|
virtual void OnTestEnd(const TestInfo& test_info) override;
|
||||||
virtual void OnTestCaseEnd(const TestCase& test_case);
|
virtual void OnTestCaseEnd(const TestCase& test_case) override;
|
||||||
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
|
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
|
||||||
virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
|
virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) override;
|
||||||
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
|
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
|
||||||
virtual void OnTestProgramEnd(const UnitTest& unit_test);
|
virtual void OnTestProgramEnd(const UnitTest& unit_test) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Controls whether events will be forwarded to listeners_. Set to false
|
// Controls whether events will be forwarded to listeners_. Set to false
|
||||||
|
@ -3013,7 +3013,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
|
||||||
public:
|
public:
|
||||||
explicit XmlUnitTestResultPrinter(const char* output_file);
|
explicit XmlUnitTestResultPrinter(const char* output_file);
|
||||||
|
|
||||||
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
|
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Is c a whitespace character that is normalized to a space character
|
// Is c a whitespace character that is normalized to a space character
|
||||||
|
|
|
@ -550,12 +550,10 @@ void BlockchainExplorer::poolChanged() {
|
||||||
for (const Hash hash : *removedTransactionsPtr) {
|
for (const Hash hash : *removedTransactionsPtr) {
|
||||||
auto iter = knownPoolState.find(hash);
|
auto iter = knownPoolState.find(hash);
|
||||||
if (iter != knownPoolState.end()) {
|
if (iter != knownPoolState.end()) {
|
||||||
removedTransactionsHashesPtr->push_back(
|
removedTransactionsHashesPtr->push_back({
|
||||||
std::move(std::make_pair(
|
hash,
|
||||||
hash,
|
TransactionRemoveReason::INCLUDED_IN_BLOCK // Can't have real reason here.
|
||||||
TransactionRemoveReason::INCLUDED_IN_BLOCK //Can't have real reason here.
|
});
|
||||||
))
|
|
||||||
);
|
|
||||||
knownPoolState.erase(iter);
|
knownPoolState.erase(iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ bool BlockchainExplorerDataBuilder::fillTxExtra(const std::vector<uint8_t>& rawE
|
||||||
} else if (typeid(TransactionExtraPublicKey) == field.type()) {
|
} else if (typeid(TransactionExtraPublicKey) == field.type()) {
|
||||||
extraDetails.publicKey.push_back(std::move(boost::get<TransactionExtraPublicKey>(field).publicKey));
|
extraDetails.publicKey.push_back(std::move(boost::get<TransactionExtraPublicKey>(field).publicKey));
|
||||||
} else if (typeid(TransactionExtraNonce) == field.type()) {
|
} else if (typeid(TransactionExtraNonce) == field.type()) {
|
||||||
extraDetails.nonce.push_back(std::move(Common::toHex(boost::get<TransactionExtraNonce>(field).nonce.data(), boost::get<TransactionExtraNonce>(field).nonce.size())));
|
extraDetails.nonce.push_back(Common::toHex(boost::get<TransactionExtraNonce>(field).nonce.data(), boost::get<TransactionExtraNonce>(field).nonce.size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -34,15 +34,15 @@ class BlockchainExplorerErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
static BlockchainExplorerErrorCategory INSTANCE;
|
static BlockchainExplorerErrorCategory INSTANCE;
|
||||||
|
|
||||||
virtual const char* name() const throw() {
|
virtual const char* name() const throw() override {
|
||||||
return "BlockchainExplorerErrorCategory";
|
return "BlockchainExplorerErrorCategory";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::error_condition default_error_condition(int ev) const throw() {
|
virtual std::error_condition default_error_condition(int ev) const throw() override {
|
||||||
return std::error_condition(ev, *this);
|
return std::error_condition(ev, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string message(int ev) const {
|
virtual std::string message(int ev) const override {
|
||||||
switch (ev) {
|
switch (ev) {
|
||||||
case static_cast<int>(BlockchainExplorerErrorCodes::NOT_INITIALIZED): return "Object was not initialized";
|
case static_cast<int>(BlockchainExplorerErrorCodes::NOT_INITIALIZED): return "Object was not initialized";
|
||||||
case static_cast<int>(BlockchainExplorerErrorCodes::ALREADY_INITIALIZED): return "Object has been already initialized";
|
case static_cast<int>(BlockchainExplorerErrorCodes::ALREADY_INITIALIZED): return "Object has been already initialized";
|
||||||
|
|
|
@ -32,6 +32,8 @@ public:
|
||||||
const static Size MAXIMUM_SIZE = MAXIMUM_SIZE_VALUE;
|
const static Size MAXIMUM_SIZE = MAXIMUM_SIZE_VALUE;
|
||||||
const static Size INVALID;
|
const static Size INVALID;
|
||||||
|
|
||||||
|
static_assert(MAXIMUM_SIZE != 0, "StringBuffer's size must not be zero");
|
||||||
|
|
||||||
// Default constructor.
|
// Default constructor.
|
||||||
// After construction, 'StringBuffer' is empty, that is 'size' == 0
|
// After construction, 'StringBuffer' is empty, that is 'size' == 0
|
||||||
StringBuffer() : size(0) {
|
StringBuffer() : size(0) {
|
||||||
|
@ -202,7 +204,6 @@ public:
|
||||||
|
|
||||||
// Compare two strings character-wise.
|
// Compare two strings character-wise.
|
||||||
bool operator<(StringView other) const {
|
bool operator<(StringView other) const {
|
||||||
assert(data != nullptr || size == 0);
|
|
||||||
Size count = other.getSize() < size ? other.getSize() : size;
|
Size count = other.getSize() < size ? other.getSize() : size;
|
||||||
for (Size i = 0; i < count; ++i) {
|
for (Size i = 0; i < count; ++i) {
|
||||||
Object char1 = *(data + i);
|
Object char1 = *(data + i);
|
||||||
|
@ -354,7 +355,6 @@ public:
|
||||||
// Looks for the last occurence of 'object' in 'StringView',
|
// Looks for the last occurence of 'object' in 'StringView',
|
||||||
// returns index or INVALID if there are no occurences.
|
// returns index or INVALID if there are no occurences.
|
||||||
Size findLast(const Object& object) const {
|
Size findLast(const Object& object) const {
|
||||||
assert(data != nullptr || size == 0);
|
|
||||||
for (Size i = 0; i < size; ++i) {
|
for (Size i = 0; i < size; ++i) {
|
||||||
if (*(data + (size - 1 - i)) == object) {
|
if (*(data + (size - 1 - i)) == object) {
|
||||||
return size - 1 - i;
|
return size - 1 - i;
|
||||||
|
|
|
@ -166,7 +166,8 @@ const CheckpointData CHECKPOINTS[] = {
|
||||||
{816000, "32b7fdd4e4d715db81f8f09f4ba5e5c78e8113f2804d61a57378baee479ce745"},
|
{816000, "32b7fdd4e4d715db81f8f09f4ba5e5c78e8113f2804d61a57378baee479ce745"},
|
||||||
{822000, "a3c9603c6813a0dc0efc40db288c356d1a7f02d1d2e47bee04346e73715f8984"},
|
{822000, "a3c9603c6813a0dc0efc40db288c356d1a7f02d1d2e47bee04346e73715f8984"},
|
||||||
{841000, "2cffb6504ee38f708a6256a63585f9382b3b426e64b4504236c70678bd160dce"},
|
{841000, "2cffb6504ee38f708a6256a63585f9382b3b426e64b4504236c70678bd160dce"},
|
||||||
{890000, "a7132932ea31236ce6b8775cd1380edf90b5e536ee4202c77b69a3d62445fcd2"}
|
{890000, "a7132932ea31236ce6b8775cd1380edf90b5e536ee4202c77b69a3d62445fcd2"},
|
||||||
|
{894000, "ae2624ea1472ecc36de0d812f21a32da2d4afc7d5770830083cbaf652209d316"}
|
||||||
};
|
};
|
||||||
} // CryptoNote
|
} // CryptoNote
|
||||||
|
|
||||||
|
|
|
@ -775,7 +775,7 @@ bool Blockchain::switch_to_alternative_blockchain(std::list<blocks_ext_by_hash::
|
||||||
m_alternative_chains.erase(ch_ent);
|
m_alternative_chains.erase(ch_ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessage(BlockchainMessage(std::move(ChainSwitchMessage(std::move(blocksFromCommonRoot)))));
|
sendMessage(BlockchainMessage(ChainSwitchMessage(std::move(blocksFromCommonRoot))));
|
||||||
|
|
||||||
logger(INFO, BRIGHT_GREEN) << "REORGANIZE SUCCESS! on height: " << split_height << ", new blockchain size: " << m_blocks.size();
|
logger(INFO, BRIGHT_GREEN) << "REORGANIZE SUCCESS! on height: " << split_height << ", new blockchain size: " << m_blocks.size();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1099,7 +1099,7 @@ bool Blockchain::handle_alternative_block(const Block& b, const Crypto::Hash& id
|
||||||
<< ENDL << "PoW:\t" << proof_of_work
|
<< ENDL << "PoW:\t" << proof_of_work
|
||||||
<< ENDL << "difficulty:\t" << current_diff;
|
<< ENDL << "difficulty:\t" << current_diff;
|
||||||
if (sendNewAlternativeBlockMessage) {
|
if (sendNewAlternativeBlockMessage) {
|
||||||
sendMessage(BlockchainMessage(std::move(NewAlternativeBlockMessage(id))));
|
sendMessage(BlockchainMessage(NewAlternativeBlockMessage(id)));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1688,7 +1688,7 @@ bool Blockchain::addNewBlock(const Block& bl_, block_verification_context& bvc)
|
||||||
} else {
|
} else {
|
||||||
add_result = pushBlock(bl, bvc);
|
add_result = pushBlock(bl, bvc);
|
||||||
if (add_result) {
|
if (add_result) {
|
||||||
sendMessage(BlockchainMessage(std::move(NewBlockMessage(id))));
|
sendMessage(BlockchainMessage(NewBlockMessage(id)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace CryptoNote {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RealTimeProvider : public ITimeProvider {
|
struct RealTimeProvider : public ITimeProvider {
|
||||||
virtual time_t now() {
|
virtual time_t now() override {
|
||||||
return time(nullptr);
|
return time(nullptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,15 +35,15 @@ class HttpParserErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
static HttpParserErrorCategory INSTANCE;
|
static HttpParserErrorCategory INSTANCE;
|
||||||
|
|
||||||
virtual const char* name() const throw() {
|
virtual const char* name() const throw() override {
|
||||||
return "HttpParserErrorCategory";
|
return "HttpParserErrorCategory";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::error_condition default_error_condition(int ev) const throw() {
|
virtual std::error_condition default_error_condition(int ev) const throw() override {
|
||||||
return std::error_condition(ev, *this);
|
return std::error_condition(ev, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string message(int ev) const {
|
virtual std::string message(int ev) const override {
|
||||||
switch (ev) {
|
switch (ev) {
|
||||||
case STREAM_NOT_GOOD: return "The stream is not good";
|
case STREAM_NOT_GOOD: return "The stream is not good";
|
||||||
case END_OF_STREAM: return "The stream is ended";
|
case END_OF_STREAM: return "The stream is ended";
|
||||||
|
|
|
@ -36,15 +36,15 @@ class InProcessNodeErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
static InProcessNodeErrorCategory INSTANCE;
|
static InProcessNodeErrorCategory INSTANCE;
|
||||||
|
|
||||||
virtual const char* name() const throw() {
|
virtual const char* name() const throw() override {
|
||||||
return "InProcessNodeErrorCategory";
|
return "InProcessNodeErrorCategory";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::error_condition default_error_condition(int ev) const throw() {
|
virtual std::error_condition default_error_condition(int ev) const throw() override {
|
||||||
return std::error_condition(ev, *this);
|
return std::error_condition(ev, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string message(int ev) const {
|
virtual std::string message(int ev) const override {
|
||||||
switch (ev) {
|
switch (ev) {
|
||||||
case NOT_INITIALIZED: return "Object was not initialized";
|
case NOT_INITIALIZED: return "Object was not initialized";
|
||||||
case ALREADY_INITIALIZED: return "Object has been already initialized";
|
case ALREADY_INITIALIZED: return "Object has been already initialized";
|
||||||
|
|
|
@ -39,15 +39,15 @@ class NodeErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
static NodeErrorCategory INSTANCE;
|
static NodeErrorCategory INSTANCE;
|
||||||
|
|
||||||
virtual const char* name() const throw() {
|
virtual const char* name() const throw() override {
|
||||||
return "NodeErrorCategory";
|
return "NodeErrorCategory";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::error_condition default_error_condition(int ev) const throw() {
|
virtual std::error_condition default_error_condition(int ev) const throw() override {
|
||||||
return std::error_condition(ev, *this);
|
return std::error_condition(ev, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string message(int ev) const {
|
virtual std::string message(int ev) const override {
|
||||||
switch (ev) {
|
switch (ev) {
|
||||||
case NOT_INITIALIZED: return "Object was not initialized";
|
case NOT_INITIALIZED: return "Object was not initialized";
|
||||||
case ALREADY_INITIALIZED: return "Object has been already initialized";
|
case ALREADY_INITIALIZED: return "Object has been already initialized";
|
||||||
|
|
|
@ -34,10 +34,10 @@ namespace CryptoNote {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct p2p_endpoint_stub: public IP2pEndpoint {
|
struct p2p_endpoint_stub: public IP2pEndpoint {
|
||||||
virtual void relay_notify_to_all(int command, const BinaryArray& data_buff, const net_connection_id* excludeConnection) {}
|
virtual void relay_notify_to_all(int command, const BinaryArray& data_buff, const net_connection_id* excludeConnection) override {}
|
||||||
virtual bool invoke_notify_to_peer(int command, const BinaryArray& req_buff, const CryptoNote::CryptoNoteConnectionContext& context) { return true; }
|
virtual bool invoke_notify_to_peer(int command, const BinaryArray& req_buff, const CryptoNote::CryptoNoteConnectionContext& context) override { return true; }
|
||||||
virtual void for_each_connection(std::function<void(CryptoNote::CryptoNoteConnectionContext&, PeerIdType)> f) {}
|
virtual void for_each_connection(std::function<void(CryptoNote::CryptoNoteConnectionContext&, PeerIdType)> f) override {}
|
||||||
virtual uint64_t get_connections_count() { return 0; }
|
virtual uint64_t get_connections_count() override { return 0; }
|
||||||
virtual void externalRelayNotifyToAll(int command, const BinaryArray& data_buff) {}
|
virtual void externalRelayNotifyToAll(int command, const BinaryArray& data_buff) override {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,15 +35,15 @@ class WalletServiceErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
static WalletServiceErrorCategory INSTANCE;
|
static WalletServiceErrorCategory INSTANCE;
|
||||||
|
|
||||||
virtual const char* name() const throw() {
|
virtual const char* name() const throw() override {
|
||||||
return "WalletServiceErrorCategory";
|
return "WalletServiceErrorCategory";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::error_condition default_error_condition(int ev) const throw() {
|
virtual std::error_condition default_error_condition(int ev) const throw() override {
|
||||||
return std::error_condition(ev, *this);
|
return std::error_condition(ev, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string message(int ev) const {
|
virtual std::string message(int ev) const override {
|
||||||
WalletServiceErrorCode code = static_cast<WalletServiceErrorCode>(ev);
|
WalletServiceErrorCode code = static_cast<WalletServiceErrorCode>(ev);
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace System {
|
||||||
|
|
||||||
class InterruptedException : public std::exception {
|
class InterruptedException : public std::exception {
|
||||||
public:
|
public:
|
||||||
const char* what() const throw() {
|
virtual const char* what() const throw() override {
|
||||||
return "interrupted";
|
return "interrupted";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,15 +58,15 @@ class WalletErrorCategory : public std::error_category {
|
||||||
public:
|
public:
|
||||||
static WalletErrorCategory INSTANCE;
|
static WalletErrorCategory INSTANCE;
|
||||||
|
|
||||||
virtual const char* name() const throw() {
|
virtual const char* name() const throw() override {
|
||||||
return "WalletErrorCategory";
|
return "WalletErrorCategory";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::error_condition default_error_condition(int ev) const throw() {
|
virtual std::error_condition default_error_condition(int ev) const throw() override {
|
||||||
return std::error_condition(ev, *this);
|
return std::error_condition(ev, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string message(int ev) const {
|
virtual std::string message(int ev) const override {
|
||||||
switch (ev) {
|
switch (ev) {
|
||||||
case NOT_INITIALIZED: return "Object was not initialized";
|
case NOT_INITIALIZED: return "Object was not initialized";
|
||||||
case WRONG_PASSWORD: return "The password is wrong";
|
case WRONG_PASSWORD: return "The password is wrong";
|
||||||
|
|
|
@ -94,7 +94,7 @@ public:
|
||||||
SyncStarter(BlockchainSynchronizer& sync) : m_sync(sync) {}
|
SyncStarter(BlockchainSynchronizer& sync) : m_sync(sync) {}
|
||||||
virtual ~SyncStarter() {}
|
virtual ~SyncStarter() {}
|
||||||
|
|
||||||
virtual void initCompleted(std::error_code result) {
|
virtual void initCompleted(std::error_code result) override {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
WalletTransactionUpdatedEvent(TransactionId transactionId) : m_id(transactionId) {};
|
WalletTransactionUpdatedEvent(TransactionId transactionId) : m_id(transactionId) {};
|
||||||
virtual ~WalletTransactionUpdatedEvent() {};
|
virtual ~WalletTransactionUpdatedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer)
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override
|
||||||
{
|
{
|
||||||
observer.notify(&IWalletLegacyObserver::transactionUpdated, m_id);
|
observer.notify(&IWalletLegacyObserver::transactionUpdated, m_id);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
WalletSendTransactionCompletedEvent(TransactionId transactionId, std::error_code result) : m_id(transactionId), m_error(result) {};
|
WalletSendTransactionCompletedEvent(TransactionId transactionId, std::error_code result) : m_id(transactionId), m_error(result) {};
|
||||||
virtual ~WalletSendTransactionCompletedEvent() {};
|
virtual ~WalletSendTransactionCompletedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer)
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override
|
||||||
{
|
{
|
||||||
observer.notify(&IWalletLegacyObserver::sendTransactionCompleted, m_id, m_error);
|
observer.notify(&IWalletLegacyObserver::sendTransactionCompleted, m_id, m_error);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public:
|
||||||
WalletExternalTransactionCreatedEvent(TransactionId transactionId) : m_id(transactionId) {};
|
WalletExternalTransactionCreatedEvent(TransactionId transactionId) : m_id(transactionId) {};
|
||||||
virtual ~WalletExternalTransactionCreatedEvent() {};
|
virtual ~WalletExternalTransactionCreatedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer)
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override
|
||||||
{
|
{
|
||||||
observer.notify(&IWalletLegacyObserver::externalTransactionCreated, m_id);
|
observer.notify(&IWalletLegacyObserver::externalTransactionCreated, m_id);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public:
|
||||||
WalletSynchronizationProgressUpdatedEvent(uint32_t current, uint32_t total) : m_current(current), m_total(total) {};
|
WalletSynchronizationProgressUpdatedEvent(uint32_t current, uint32_t total) : m_current(current), m_total(total) {};
|
||||||
virtual ~WalletSynchronizationProgressUpdatedEvent() {};
|
virtual ~WalletSynchronizationProgressUpdatedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer)
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override
|
||||||
{
|
{
|
||||||
observer.notify(&IWalletLegacyObserver::synchronizationProgressUpdated, m_current, m_total);
|
observer.notify(&IWalletLegacyObserver::synchronizationProgressUpdated, m_current, m_total);
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public:
|
||||||
WalletSynchronizationCompletedEvent(uint32_t current, uint32_t total, std::error_code result) : m_ec(result) {};
|
WalletSynchronizationCompletedEvent(uint32_t current, uint32_t total, std::error_code result) : m_ec(result) {};
|
||||||
virtual ~WalletSynchronizationCompletedEvent() {};
|
virtual ~WalletSynchronizationCompletedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) {
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override {
|
||||||
observer.notify(&IWalletLegacyObserver::synchronizationCompleted, m_ec);
|
observer.notify(&IWalletLegacyObserver::synchronizationCompleted, m_ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public:
|
||||||
WalletActualBalanceUpdatedEvent(uint64_t balance) : m_balance(balance) {};
|
WalletActualBalanceUpdatedEvent(uint64_t balance) : m_balance(balance) {};
|
||||||
virtual ~WalletActualBalanceUpdatedEvent() {};
|
virtual ~WalletActualBalanceUpdatedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer)
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override
|
||||||
{
|
{
|
||||||
observer.notify(&IWalletLegacyObserver::actualBalanceUpdated, m_balance);
|
observer.notify(&IWalletLegacyObserver::actualBalanceUpdated, m_balance);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ public:
|
||||||
WalletPendingBalanceUpdatedEvent(uint64_t balance) : m_balance(balance) {};
|
WalletPendingBalanceUpdatedEvent(uint64_t balance) : m_balance(balance) {};
|
||||||
virtual ~WalletPendingBalanceUpdatedEvent() {};
|
virtual ~WalletPendingBalanceUpdatedEvent() {};
|
||||||
|
|
||||||
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer)
|
virtual void notify(Tools::ObserverManager<CryptoNote::IWalletLegacyObserver>& observer) override
|
||||||
{
|
{
|
||||||
observer.notify(&IWalletLegacyObserver::pendingBalanceUpdated, m_balance);
|
observer.notify(&IWalletLegacyObserver::pendingBalanceUpdated, m_balance);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
|
|
||||||
virtual ~WalletGetRandomOutsByAmountsRequest() {};
|
virtual ~WalletGetRandomOutsByAmountsRequest() {};
|
||||||
|
|
||||||
virtual void perform(INode& node, std::function<void (WalletRequest::Callback, std::error_code)> cb)
|
virtual void perform(INode& node, std::function<void (WalletRequest::Callback, std::error_code)> cb) override
|
||||||
{
|
{
|
||||||
node.getRandomOutsByAmounts(std::move(m_amounts), m_outsCount, std::ref(m_context->outs), std::bind(cb, m_cb, std::placeholders::_1));
|
node.getRandomOutsByAmounts(std::move(m_amounts), m_outsCount, std::ref(m_context->outs), std::bind(cb, m_cb, std::placeholders::_1));
|
||||||
};
|
};
|
||||||
|
@ -66,7 +66,7 @@ public:
|
||||||
WalletRelayTransactionRequest(const CryptoNote::Transaction& tx, Callback cb) : m_tx(tx), m_cb(cb) {};
|
WalletRelayTransactionRequest(const CryptoNote::Transaction& tx, Callback cb) : m_tx(tx), m_cb(cb) {};
|
||||||
virtual ~WalletRelayTransactionRequest() {};
|
virtual ~WalletRelayTransactionRequest() {};
|
||||||
|
|
||||||
virtual void perform(INode& node, std::function<void (WalletRequest::Callback, std::error_code)> cb)
|
virtual void perform(INode& node, std::function<void (WalletRequest::Callback, std::error_code)> cb) override
|
||||||
{
|
{
|
||||||
node.relayTransaction(m_tx, std::bind(cb, m_cb, std::placeholders::_1));
|
node.relayTransaction(m_tx, std::bind(cb, m_cb, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define BUILD_COMMIT_ID "@VERSION@"
|
#define BUILD_COMMIT_ID "@VERSION@"
|
||||||
#define PROJECT_VERSION "1.0.9"
|
#define PROJECT_VERSION "1.0.9.1"
|
||||||
#define PROJECT_VERSION_BUILD_NO "661"
|
#define PROJECT_VERSION_BUILD_NO "662"
|
||||||
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"
|
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace {
|
||||||
m_waiting = false;
|
m_waiting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void sendTransactionCompleted(TransactionId transactionId, std::error_code result) {
|
virtual void sendTransactionCompleted(TransactionId transactionId, std::error_code result) override {
|
||||||
m_dispatcher.remoteSpawn([this, transactionId, result]() {
|
m_dispatcher.remoteSpawn([this, transactionId, result]() {
|
||||||
if (m_waiting && m_expectedTxId == transactionId) {
|
if (m_waiting && m_expectedTxId == transactionId) {
|
||||||
m_result = result;
|
m_result = result;
|
||||||
|
|
|
@ -120,7 +120,7 @@ public:
|
||||||
public:
|
public:
|
||||||
WaitForActualGrowObserver(Tests::Common::Semaphore& GotActual, uint64_t lastFunds) : m_GotActual(GotActual), m_lastFunds(lastFunds) { }
|
WaitForActualGrowObserver(Tests::Common::Semaphore& GotActual, uint64_t lastFunds) : m_GotActual(GotActual), m_lastFunds(lastFunds) { }
|
||||||
|
|
||||||
virtual void actualBalanceUpdated(uint64_t actualBalance) {
|
virtual void actualBalanceUpdated(uint64_t actualBalance) override {
|
||||||
if (m_lastFunds < actualBalance) {
|
if (m_lastFunds < actualBalance) {
|
||||||
m_GotActual.notify();
|
m_GotActual.notify();
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public:
|
||||||
public:
|
public:
|
||||||
WaitForActualDwindleObserver(Tests::Common::Semaphore& GotActual, uint64_t lastFunds) : m_GotActual(GotActual), m_lastFunds(lastFunds) { }
|
WaitForActualDwindleObserver(Tests::Common::Semaphore& GotActual, uint64_t lastFunds) : m_GotActual(GotActual), m_lastFunds(lastFunds) { }
|
||||||
|
|
||||||
virtual void actualBalanceUpdated(uint64_t actualBalance) {
|
virtual void actualBalanceUpdated(uint64_t actualBalance) override {
|
||||||
if (m_lastFunds > actualBalance) {
|
if (m_lastFunds > actualBalance) {
|
||||||
m_GotActual.notify();
|
m_GotActual.notify();
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ public:
|
||||||
public:
|
public:
|
||||||
WaitForPendingGrowObserver(Tests::Common::Semaphore& GotActual, uint64_t lastFunds) : m_GotActual(GotActual), m_lastFunds(lastFunds) { }
|
WaitForPendingGrowObserver(Tests::Common::Semaphore& GotActual, uint64_t lastFunds) : m_GotActual(GotActual), m_lastFunds(lastFunds) { }
|
||||||
|
|
||||||
virtual void pendingBalanceUpdated(uint64_t pendingBalance) {
|
virtual void pendingBalanceUpdated(uint64_t pendingBalance) override {
|
||||||
if (m_lastFunds < pendingBalance) {
|
if (m_lastFunds < pendingBalance) {
|
||||||
m_GotActual.notify();
|
m_GotActual.notify();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ TEST(EventTests, eventIsWorking) {
|
||||||
|
|
||||||
TEST(EventTests, movedEventIsWorking) {
|
TEST(EventTests, movedEventIsWorking) {
|
||||||
Dispatcher dispatcher;
|
Dispatcher dispatcher;
|
||||||
Event event(std::move(Event(dispatcher)));
|
Event event{Event(dispatcher)};
|
||||||
Context<> context(dispatcher, [&]() {
|
Context<> context(dispatcher, [&]() {
|
||||||
event.set();
|
event.set();
|
||||||
});
|
});
|
||||||
|
|
|
@ -47,7 +47,7 @@ TEST_F(TimerTests, timerIsWorking) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TimerTests, movedTimerIsWorking) {
|
TEST_F(TimerTests, movedTimerIsWorking) {
|
||||||
Timer t(std::move(Timer(dispatcher)));
|
Timer t{Timer{dispatcher}};
|
||||||
bool done = false;
|
bool done = false;
|
||||||
contextGroup.spawn([&]() {
|
contextGroup.spawn([&]() {
|
||||||
done = true;
|
done = true;
|
||||||
|
@ -143,7 +143,7 @@ TEST_F(TimerTests, movedTimerIsWorking2) {
|
||||||
bool done = false;
|
bool done = false;
|
||||||
contextGroup.spawn([&] {
|
contextGroup.spawn([&] {
|
||||||
Timer t(dispatcher);
|
Timer t(dispatcher);
|
||||||
t = std::move(Timer(dispatcher));
|
t = Timer{dispatcher};
|
||||||
//contextGroup.spawn([&]() { done = true; });
|
//contextGroup.spawn([&]() { done = true; });
|
||||||
|
|
||||||
ASSERT_FALSE(done);
|
ASSERT_FALSE(done);
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace {
|
||||||
|
|
||||||
class PoolChangedObserver : public INodeObserver {
|
class PoolChangedObserver : public INodeObserver {
|
||||||
public:
|
public:
|
||||||
virtual void poolChanged() {
|
virtual void poolChanged() override {
|
||||||
std::unique_lock<std::mutex> lk(mutex);
|
std::unique_lock<std::mutex> lk(mutex);
|
||||||
ready = true;
|
ready = true;
|
||||||
cv.notify_all();
|
cv.notify_all();
|
||||||
|
|
|
@ -43,13 +43,13 @@ public:
|
||||||
|
|
||||||
class WalletLegacyObserver : public IWalletLegacyObserver {
|
class WalletLegacyObserver : public IWalletLegacyObserver {
|
||||||
public:
|
public:
|
||||||
virtual void actualBalanceUpdated(uint64_t actualBalance) {
|
virtual void actualBalanceUpdated(uint64_t actualBalance) override {
|
||||||
std::cout << "Actual balance updated = " << currency.formatAmount(actualBalance) << std::endl;
|
std::cout << "Actual balance updated = " << currency.formatAmount(actualBalance) << std::endl;
|
||||||
m_actualBalance = actualBalance;
|
m_actualBalance = actualBalance;
|
||||||
m_sem.notify();
|
m_sem.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void sendTransactionCompleted(TransactionId transactionId, std::error_code result) {
|
virtual void sendTransactionCompleted(TransactionId transactionId, std::error_code result) override {
|
||||||
std::cout << "Transaction sent, result = " << result << std::endl;
|
std::cout << "Transaction sent, result = " << result << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace
|
||||||
protected:
|
protected:
|
||||||
static const uint64_t alreadyGeneratedCoins = 0;
|
static const uint64_t alreadyGeneratedCoins = 0;
|
||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() override {
|
||||||
m_blockTooBig = !m_currency.getBlockReward(0, 0, alreadyGeneratedCoins, 0, false,
|
m_blockTooBig = !m_currency.getBlockReward(0, 0, alreadyGeneratedCoins, 0, false,
|
||||||
m_standardBlockReward, m_emissionChange);
|
m_standardBlockReward, m_emissionChange);
|
||||||
ASSERT_FALSE(m_blockTooBig);
|
ASSERT_FALSE(m_blockTooBig);
|
||||||
|
@ -190,7 +190,7 @@ namespace
|
||||||
static const size_t testMedian = 7 * TEST_GRANTED_FULL_REWARD_ZONE;
|
static const size_t testMedian = 7 * TEST_GRANTED_FULL_REWARD_ZONE;
|
||||||
static const uint64_t alreadyGeneratedCoins = 0;
|
static const uint64_t alreadyGeneratedCoins = 0;
|
||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() override {
|
||||||
m_blockTooBig = !m_currency.getBlockReward(testMedian, 0, alreadyGeneratedCoins, 0, false,
|
m_blockTooBig = !m_currency.getBlockReward(testMedian, 0, alreadyGeneratedCoins, 0, false,
|
||||||
m_standardBlockReward, m_emissionChange);
|
m_standardBlockReward, m_emissionChange);
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() override {
|
||||||
uint64_t blockReward;
|
uint64_t blockReward;
|
||||||
int64_t emissionChange;
|
int64_t emissionChange;
|
||||||
|
|
||||||
|
|
|
@ -26,11 +26,11 @@ class ICryptoNoteProtocolQueryStub: public CryptoNote::ICryptoNoteProtocolQuery
|
||||||
public:
|
public:
|
||||||
ICryptoNoteProtocolQueryStub() : peers(0), observedHeight(0), synchronized(false) {}
|
ICryptoNoteProtocolQueryStub() : peers(0), observedHeight(0), synchronized(false) {}
|
||||||
|
|
||||||
virtual bool addObserver(CryptoNote::ICryptoNoteProtocolObserver* observer);
|
virtual bool addObserver(CryptoNote::ICryptoNoteProtocolObserver* observer) override;
|
||||||
virtual bool removeObserver(CryptoNote::ICryptoNoteProtocolObserver* observer);
|
virtual bool removeObserver(CryptoNote::ICryptoNoteProtocolObserver* observer) override;
|
||||||
virtual uint32_t getObservedHeight() const;
|
virtual uint32_t getObservedHeight() const override;
|
||||||
virtual size_t getPeerCount() const;
|
virtual size_t getPeerCount() const override;
|
||||||
virtual bool isSynchronized() const;
|
virtual bool isSynchronized() const override;
|
||||||
|
|
||||||
void setPeerCount(uint32_t count);
|
void setPeerCount(uint32_t count);
|
||||||
void setObservedHeight(uint32_t height);
|
void setObservedHeight(uint32_t height);
|
||||||
|
|
|
@ -390,10 +390,10 @@ TEST_F(BcSTest, stopIsWaiting) {
|
||||||
|
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
|
|
||||||
o1.updFunc = std::move([&e, &flag](uint32_t, uint32_t) {
|
o1.updFunc = [&e, &flag](uint32_t, uint32_t) {
|
||||||
e.notify(); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); flag = true;
|
e.notify(); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); flag = true;
|
||||||
|
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -413,9 +413,9 @@ TEST_F(BcSTest, syncCompletedError) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
|
|
||||||
o1.updFunc = std::move([&e](uint32_t curr, uint32_t total) {
|
o1.updFunc = [&e](uint32_t curr, uint32_t total) {
|
||||||
e.notify(); std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
e.notify(); std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o);
|
m_sync.addObserver(&o);
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
|
@ -434,9 +434,9 @@ TEST_F(BcSTest, onLastKnownBlockHeightUpdated) {
|
||||||
generator.generateEmptyBlocks(20);
|
generator.generateEmptyBlocks(20);
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -460,9 +460,9 @@ TEST_F(BcSTest, onPoolChanged) {
|
||||||
generator.generateEmptyBlocks(20);
|
generator.generateEmptyBlocks(20);
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -594,9 +594,9 @@ TEST_F(BcSTest, firstPoolSynchronizationCheck) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -635,9 +635,9 @@ TEST_F(BcSTest, firstPoolSynchronizationCheckNonActual) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -671,9 +671,9 @@ TEST_F(BcSTest, firstPoolSynchronizationCheckGetPoolErr) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -692,9 +692,9 @@ TEST_F(BcSTest, poolSynchronizationCheckActual) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -730,10 +730,10 @@ TEST_F(BcSTest, poolSynchronizationCheckError) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -778,9 +778,9 @@ TEST_F(BcSTest, poolSynchronizationCheckTxAdded) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -836,9 +836,9 @@ TEST_F(BcSTest, poolSynchronizationCheckTxDeleted) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -892,9 +892,9 @@ TEST_F(BcSTest, poolSynchronizationCheckNotification) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.start();
|
m_sync.start();
|
||||||
|
@ -920,9 +920,9 @@ TEST_F(BcSTest, poolSynchronizationCheckConsumersNotififcation) {
|
||||||
|
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
o1.syncFunc = std::move([&e](std::error_code) {
|
o1.syncFunc = [&e](std::error_code) {
|
||||||
e.notify();
|
e.notify();
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.addConsumer(&c1);
|
m_sync.addConsumer(&c1);
|
||||||
|
@ -956,10 +956,10 @@ TEST_F(BcSTest, poolSynchronizationCheckConsumerReturnError) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
m_sync.addObserver(&o1);
|
m_sync.addObserver(&o1);
|
||||||
m_sync.addConsumer(&c1);
|
m_sync.addConsumer(&c1);
|
||||||
|
@ -996,10 +996,10 @@ TEST_F(BcSTest, checkINodeError) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
m_node.queryBlocksFunctor = [](const std::vector<Hash>& knownBlockIds, uint64_t timestamp, std::vector<BlockShortEntry>& newBlocks, uint32_t& startHeight, const INode::Callback& callback) -> bool {
|
m_node.queryBlocksFunctor = [](const std::vector<Hash>& knownBlockIds, uint64_t timestamp, std::vector<BlockShortEntry>& newBlocks, uint32_t& startHeight, const INode::Callback& callback) -> bool {
|
||||||
callback(std::make_error_code(std::errc::invalid_argument));
|
callback(std::make_error_code(std::errc::invalid_argument));
|
||||||
|
@ -1021,10 +1021,10 @@ TEST_F(BcSTest, checkConsumerError) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
generator.generateEmptyBlocks(10);
|
generator.generateEmptyBlocks(10);
|
||||||
|
|
||||||
|
@ -1048,10 +1048,10 @@ TEST_F(BcSTest, checkBlocksRequesting) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
|
||||||
size_t blocksExpected = 20;
|
size_t blocksExpected = 20;
|
||||||
|
@ -1082,10 +1082,10 @@ TEST_F(BcSTest, checkConsumerHeightReceived) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
|
||||||
uint32_t firstlySnchronizedHeight = 20;
|
uint32_t firstlySnchronizedHeight = 20;
|
||||||
|
@ -1127,10 +1127,10 @@ TEST_F(BcSTest, checkConsumerOldBlocksNotIvoked) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
generator.generateEmptyBlocks(20);
|
generator.generateEmptyBlocks(20);
|
||||||
m_node.setGetNewBlocksLimit(50);
|
m_node.setGetNewBlocksLimit(50);
|
||||||
|
@ -1169,10 +1169,10 @@ TEST_F(BcSTest, checkConsumerHeightReceivedOnDetach) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
generator.generateEmptyBlocks(20);
|
generator.generateEmptyBlocks(20);
|
||||||
m_node.setGetNewBlocksLimit(50);
|
m_node.setGetNewBlocksLimit(50);
|
||||||
|
@ -1218,10 +1218,10 @@ TEST_F(BcSTest, checkStatePreservingBetweenSynchronizations) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
generator.generateEmptyBlocks(20);
|
generator.generateEmptyBlocks(20);
|
||||||
|
|
||||||
|
@ -1255,10 +1255,10 @@ TEST_F(BcSTest, checkBlocksRerequestingOnError) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
generator.generateEmptyBlocks(20);
|
generator.generateEmptyBlocks(20);
|
||||||
m_node.setGetNewBlocksLimit(10);
|
m_node.setGetNewBlocksLimit(10);
|
||||||
|
@ -1325,10 +1325,10 @@ TEST_F(BcSTest, checkTxOrder) {
|
||||||
IBlockchainSynchronizerFunctorialObserver o1;
|
IBlockchainSynchronizerFunctorialObserver o1;
|
||||||
EventWaiter e;
|
EventWaiter e;
|
||||||
std::error_code errc;
|
std::error_code errc;
|
||||||
o1.syncFunc = std::move([&](std::error_code ec) {
|
o1.syncFunc = [&](std::error_code ec) {
|
||||||
e.notify();
|
e.notify();
|
||||||
errc = ec;
|
errc = ec;
|
||||||
});
|
};
|
||||||
|
|
||||||
auto tx1ptr = createTransaction();
|
auto tx1ptr = createTransaction();
|
||||||
auto tx2ptr = createTransaction();
|
auto tx2ptr = createTransaction();
|
||||||
|
|
|
@ -104,8 +104,8 @@ public:
|
||||||
nodeStub(generator),
|
nodeStub(generator),
|
||||||
blockchainExplorer(nodeStub, logger) {
|
blockchainExplorer(nodeStub, logger) {
|
||||||
}
|
}
|
||||||
void SetUp();
|
void SetUp() override;
|
||||||
void TearDown();
|
void TearDown() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Currency currency;
|
Currency currency;
|
||||||
|
|
|
@ -62,7 +62,7 @@ public:
|
||||||
node(coreStub, protocolQueryStub),
|
node(coreStub, protocolQueryStub),
|
||||||
currency(CryptoNote::CurrencyBuilder(logger).currency()),
|
currency(CryptoNote::CurrencyBuilder(logger).currency()),
|
||||||
generator(currency) {}
|
generator(currency) {}
|
||||||
void SetUp();
|
void SetUp() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initNode();
|
void initNode();
|
||||||
|
|
|
@ -41,8 +41,8 @@ public:
|
||||||
void sendBlockchainMessage(const BlockchainMessage& message);
|
void sendBlockchainMessage(const BlockchainMessage& message);
|
||||||
void interruptBlockchainMessageWaiting();
|
void interruptBlockchainMessageWaiting();
|
||||||
|
|
||||||
void SetUp();
|
void SetUp() override;
|
||||||
void TearDown();
|
void TearDown() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
System::Dispatcher dispatcher;
|
System::Dispatcher dispatcher;
|
||||||
|
@ -97,7 +97,7 @@ TEST_F(MessageQueueTest, singleNewBlockMessage) {
|
||||||
ASSERT_NO_THROW(queue.pop());
|
ASSERT_NO_THROW(queue.pop());
|
||||||
});
|
});
|
||||||
|
|
||||||
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(randomHash)))));
|
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(randomHash))));
|
||||||
|
|
||||||
contextGroup.wait();
|
contextGroup.wait();
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ TEST_F(MessageQueueTest, singleNewAlternativeBlockMessage) {
|
||||||
ASSERT_NO_THROW(queue.pop());
|
ASSERT_NO_THROW(queue.pop());
|
||||||
});
|
});
|
||||||
|
|
||||||
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewAlternativeBlockMessage(randomHash)))));
|
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewAlternativeBlockMessage(randomHash))));
|
||||||
|
|
||||||
contextGroup.wait();
|
contextGroup.wait();
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ TEST_F(MessageQueueTest, singleChainSwitchMessage) {
|
||||||
|
|
||||||
|
|
||||||
std::vector<Crypto::Hash> copy = randomHashes;
|
std::vector<Crypto::Hash> copy = randomHashes;
|
||||||
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(ChainSwitchMessage(std::move(copy))))));
|
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(ChainSwitchMessage(std::move(copy)))));
|
||||||
|
|
||||||
contextGroup.wait();
|
contextGroup.wait();
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ TEST_F(MessageQueueTest, manyMessagesOneListener) {
|
||||||
});
|
});
|
||||||
|
|
||||||
for (auto h : randomHashes) {
|
for (auto h : randomHashes) {
|
||||||
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(h)))));
|
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(h))));
|
||||||
}
|
}
|
||||||
|
|
||||||
contextGroup.wait();
|
contextGroup.wait();
|
||||||
|
@ -193,8 +193,8 @@ TEST_F(MessageQueueTest, manyMessagesManyListeners) {
|
||||||
std::array<std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>, NUMBER_OF_LISTENERS> quards;
|
std::array<std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>, NUMBER_OF_LISTENERS> quards;
|
||||||
|
|
||||||
for (size_t i = 0; i < NUMBER_OF_LISTENERS; ++i) {
|
for (size_t i = 0; i < NUMBER_OF_LISTENERS; ++i) {
|
||||||
queues[i] = std::move(std::unique_ptr<MessageQueue<BlockchainMessage>>(new MessageQueue<BlockchainMessage>(dispatcher)));
|
queues[i] = std::unique_ptr<MessageQueue<BlockchainMessage>>(new MessageQueue<BlockchainMessage>(dispatcher));
|
||||||
quards[i] = std::move(std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>(new MesageQueueGuard<MessageQueueTest, BlockchainMessage>(*this, *queues[i])));
|
quards[i] = std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>(new MesageQueueGuard<MessageQueueTest, BlockchainMessage>(*this, *queues[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t NUMBER_OF_BLOCKS = 10;
|
const size_t NUMBER_OF_BLOCKS = 10;
|
||||||
|
@ -222,7 +222,7 @@ TEST_F(MessageQueueTest, manyMessagesManyListeners) {
|
||||||
|
|
||||||
|
|
||||||
for (auto h : randomHashes) {
|
for (auto h : randomHashes) {
|
||||||
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(h)))));
|
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(h))));
|
||||||
}
|
}
|
||||||
|
|
||||||
contextGroup.wait();
|
contextGroup.wait();
|
||||||
|
@ -234,8 +234,8 @@ TEST_F(MessageQueueTest, interruptWaiting) {
|
||||||
std::array<std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>, NUMBER_OF_LISTENERS> quards;
|
std::array<std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>, NUMBER_OF_LISTENERS> quards;
|
||||||
|
|
||||||
for (size_t i = 0; i < NUMBER_OF_LISTENERS; ++i) {
|
for (size_t i = 0; i < NUMBER_OF_LISTENERS; ++i) {
|
||||||
queues[i] = std::move(std::unique_ptr<MessageQueue<BlockchainMessage>>(new MessageQueue<BlockchainMessage>(dispatcher)));
|
queues[i] = std::unique_ptr<MessageQueue<BlockchainMessage>>(new MessageQueue<BlockchainMessage>(dispatcher));
|
||||||
quards[i] = std::move(std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>(new MesageQueueGuard<MessageQueueTest, BlockchainMessage>(*this, *queues[i])));
|
quards[i] = std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>(new MesageQueueGuard<MessageQueueTest, BlockchainMessage>(*this, *queues[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
const size_t NUMBER_OF_BLOCKS = 10;
|
const size_t NUMBER_OF_BLOCKS = 10;
|
||||||
|
@ -272,7 +272,7 @@ TEST_F(MessageQueueTest, interruptWaiting) {
|
||||||
});
|
});
|
||||||
|
|
||||||
for (auto h : randomHashes) {
|
for (auto h : randomHashes) {
|
||||||
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(h)))));
|
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(h))));
|
||||||
}
|
}
|
||||||
|
|
||||||
interruptBlockchainMessageWaiting();
|
interruptBlockchainMessageWaiting();
|
||||||
|
|
|
@ -1599,7 +1599,7 @@ class INodeNoRelay : public INodeTrivialRefreshStub {
|
||||||
public:
|
public:
|
||||||
INodeNoRelay(TestBlockchainGenerator& generator) : INodeTrivialRefreshStub(generator) {}
|
INodeNoRelay(TestBlockchainGenerator& generator) : INodeTrivialRefreshStub(generator) {}
|
||||||
|
|
||||||
virtual void relayTransaction(const CryptoNote::Transaction& transaction, const Callback& callback) {
|
virtual void relayTransaction(const CryptoNote::Transaction& transaction, const Callback& callback) override {
|
||||||
m_asyncCounter.addAsyncContext();
|
m_asyncCounter.addAsyncContext();
|
||||||
std::thread task(&INodeNoRelay::doNoRelayTransaction, this, transaction, callback);
|
std::thread task(&INodeNoRelay::doNoRelayTransaction, this, transaction, callback);
|
||||||
task.detach();
|
task.detach();
|
||||||
|
|
|
@ -158,7 +158,7 @@ public:
|
||||||
WalletLegacyApi() : m_currency(CryptoNote::CurrencyBuilder(m_logger).currency()), generator(m_currency) {
|
WalletLegacyApi() : m_currency(CryptoNote::CurrencyBuilder(m_logger).currency()), generator(m_currency) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetUp();
|
void SetUp() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void prepareAliceWallet();
|
void prepareAliceWallet();
|
||||||
|
|
|
@ -75,7 +75,7 @@ struct IWalletBaseStub : public CryptoNote::IWallet {
|
||||||
virtual uint64_t getPendingBalance(const std::string& address) const override { return 0; }
|
virtual uint64_t getPendingBalance(const std::string& address) const override { return 0; }
|
||||||
|
|
||||||
virtual size_t getTransactionCount() const override { return 0; }
|
virtual size_t getTransactionCount() const override { return 0; }
|
||||||
virtual WalletTransaction getTransaction(size_t transactionIndex) const { return WalletTransaction(); }
|
virtual WalletTransaction getTransaction(size_t transactionIndex) const override { return WalletTransaction(); }
|
||||||
virtual size_t getTransactionTransferCount(size_t transactionIndex) const override { return 0; }
|
virtual size_t getTransactionTransferCount(size_t transactionIndex) const override { return 0; }
|
||||||
virtual WalletTransfer getTransactionTransfer(size_t transactionIndex, size_t transferIndex) const override { return WalletTransfer(); }
|
virtual WalletTransfer getTransactionTransfer(size_t transactionIndex, size_t transferIndex) const override { return WalletTransfer(); }
|
||||||
|
|
||||||
|
@ -902,7 +902,7 @@ struct WalletGetDelayedTransactionIdsStub : public IWalletBaseStub {
|
||||||
return {0};
|
return {0};
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual WalletTransaction getTransaction(size_t transactionIndex) const {
|
virtual WalletTransaction getTransaction(size_t transactionIndex) const override {
|
||||||
return WalletTransactionBuilder().hash(hash).build();
|
return WalletTransactionBuilder().hash(hash).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
: timeNow(currentTime) {}
|
: timeNow(currentTime) {}
|
||||||
|
|
||||||
time_t timeNow;
|
time_t timeNow;
|
||||||
virtual time_t now() { return timeNow; }
|
virtual time_t now() override { return timeNow; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue