Issue #57. Add missing 'override' keyword

This commit is contained in:
Antonio Juarez 2015-12-14 18:40:07 +01:00
parent 6d4e1d1ea3
commit 64feea7374
44 changed files with 213 additions and 214 deletions

View file

@ -75,7 +75,7 @@ class GTEST_API_ ScopedFakeTestPartResultReporter
//
// This method is from the TestPartResultReporterInterface
// interface.
virtual void ReportTestPartResult(const TestPartResult& result);
virtual void ReportTestPartResult(const TestPartResult& result) override;
private:
void Init();

View file

@ -162,8 +162,8 @@ class GTEST_API_ HasNewFatalFailureHelper
: public TestPartResultReporterInterface {
public:
HasNewFatalFailureHelper();
virtual ~HasNewFatalFailureHelper();
virtual void ReportTestPartResult(const TestPartResult& result);
virtual ~HasNewFatalFailureHelper() override;
virtual void ReportTestPartResult(const TestPartResult& result) override;
bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
private:
bool has_new_fatal_failure_;

View file

@ -1011,21 +1011,21 @@ class TestEventListener {
// above.
class EmptyTestEventListener : public TestEventListener {
public:
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 OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
virtual void OnTestStart(const TestInfo& /*test_info*/) {}
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
int /*iteration*/) override {}
virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
virtual void OnTestCaseStart(const TestCase& /*test_case*/) override {}
virtual void OnTestStart(const TestInfo& /*test_info*/) override {}
virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {}
virtual void OnTestEnd(const TestInfo& /*test_info*/) override {}
virtual void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
int /*iteration*/) {}
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
int /*iteration*/) override {}
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
};
// TestEventListeners lets users add listeners to track events in Google Test.

View file

@ -148,7 +148,7 @@ class DeathTestFactory {
class DefaultDeathTestFactory : public DeathTestFactory {
public:
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

View file

@ -451,7 +451,7 @@ class TestFactoryBase {
template <class TestClass>
class TestFactoryImpl : public TestFactoryBase {
public:
virtual Test* CreateTest() { return new TestClass; }
virtual Test* CreateTest() override { return new TestClass; }
};
#if GTEST_OS_WINDOWS
@ -1138,7 +1138,7 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
public:\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
private:\
virtual void TestBody();\
virtual void TestBody() override;\
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
GTEST_DISALLOW_COPY_AND_ASSIGN_(\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\

View file

@ -270,12 +270,12 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
template <typename ForwardIterator>
ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator 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());
}
virtual ParamIteratorInterface<T>* End() const {
virtual ParamIteratorInterface<T>* End() const override {
return new Iterator(this, container_.end());
}
@ -287,16 +287,16 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
Iterator(const ParamGeneratorInterface<T>* base,
typename ContainerType::const_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_;
}
virtual void Advance() {
virtual void Advance() override {
++iterator_;
value_.reset();
}
virtual ParamIteratorInterface<T>* Clone() const {
virtual ParamIteratorInterface<T>* Clone() const override {
return new Iterator(*this);
}
// 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
// detect that fact. The client code, on the other hand, is
// 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)
value_.reset(new T(*iterator_));
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
// iterator is of the same type and we can downcast.
GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
@ -355,7 +355,7 @@ class ParameterizedTestFactory : public TestFactoryBase {
typedef typename TestClass::ParamType ParamType;
explicit ParameterizedTestFactory(ParamType parameter) :
parameter_(parameter) {}
virtual Test* CreateTest() {
virtual Test* CreateTest() override {
TestClass::SetParam(&parameter_);
return new TestClass();
}
@ -454,9 +454,9 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
: test_case_name_(name) {}
// 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.
virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
virtual TypeId GetTestCaseTypeId() const override { return GetTypeId<TestCase>(); }
// TEST_P macro uses AddTestPattern() to record information
// about a single test in a LocalTestInfo structure.
// 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
// instance of a ParameterizedTestCaseInfoBase derived class.
// 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();
test_it != tests_.end(); ++test_it) {
linked_ptr<TestInfo> test_info = *test_it;

View file

@ -1296,7 +1296,7 @@ class ThreadWithParam : public ThreadWithParamBase {
}
}
virtual void Run() {
virtual void Run() override {
if (thread_can_start_ != NULL)
thread_can_start_->WaitForNotification();
func_(param_);

View file

@ -373,8 +373,8 @@ class DeathTestImpl : public DeathTest {
// read_fd_ is expected to be closed and cleared by a derived class.
~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
void Abort(AbortReason reason);
virtual bool Passed(bool status_ok);
void Abort(AbortReason reason) override;
virtual bool Passed(bool status_ok) override;
const char* statement() const { return statement_; }
const RE* regex() const { return regex_; }
@ -778,7 +778,7 @@ class ForkingDeathTest : public DeathTestImpl {
ForkingDeathTest(const char* statement, const RE* regex);
// All of these virtual functions are inherited from DeathTest.
virtual int Wait();
virtual int Wait() override;
protected:
void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
@ -814,7 +814,7 @@ class NoExecDeathTest : public ForkingDeathTest {
public:
NoExecDeathTest(const char* a_statement, const RE* 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
@ -870,7 +870,7 @@ class ExecDeathTest : public ForkingDeathTest {
ExecDeathTest(const char* a_statement, const RE* a_regex,
const char* file, int line) :
ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
virtual TestRole AssumeRole();
virtual TestRole AssumeRole() override;
private:
static ::std::vector<testing::internal::string>
GetArgvsForDeathTestChildProcess() {

View file

@ -441,10 +441,10 @@ class OsStackTraceGetter : public OsStackTraceGetterInterface {
public:
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_);
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
// Google Test's implementation.
@ -477,7 +477,7 @@ class DefaultGlobalTestPartResultReporter
explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
// Implements the TestPartResultReporterInterface. Reports the test part
// result in the current test.
virtual void ReportTestPartResult(const TestPartResult& result);
virtual void ReportTestPartResult(const TestPartResult& result) override;
private:
UnitTestImpl* const unit_test_;
@ -493,7 +493,7 @@ class DefaultPerThreadTestPartResultReporter
explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
// Implements the TestPartResultReporterInterface. The implementation just
// 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:
UnitTestImpl* const unit_test_;
@ -1100,7 +1100,7 @@ class StreamingListener : public EmptyTestEventListener {
}
// Sends a string to the socket.
virtual void Send(const string& message) {
virtual void Send(const string& message) override {
GTEST_CHECK_(sockfd_ != -1)
<< "Send() can be called only when there is a connection.";
@ -1117,7 +1117,7 @@ class StreamingListener : public EmptyTestEventListener {
void MakeConnection();
// Closes the socket.
void CloseConnection() {
void CloseConnection() override {
GTEST_CHECK_(sockfd_ != -1)
<< "CloseConnection() can be called only when there is a connection.";
@ -1141,11 +1141,11 @@ class StreamingListener : public EmptyTestEventListener {
explicit StreamingListener(AbstractSocketWriter* socket_writer)
: socket_writer_(socket_writer) { Start(); }
void OnTestProgramStart(const UnitTest& /* unit_test */) {
void OnTestProgramStart(const UnitTest& /* unit_test */) override {
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
// test iteration, not for the entire test program.
SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
@ -1154,39 +1154,39 @@ class StreamingListener : public EmptyTestEventListener {
socket_writer_->CloseConnection();
}
void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) override {
SendLn("event=TestIterationStart&iteration=" +
StreamableToString(iteration));
}
void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) override {
SendLn("event=TestIterationEnd&passed=" +
FormatBool(unit_test.Passed()) + "&elapsed_time=" +
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());
}
void OnTestCaseEnd(const TestCase& test_case) {
void OnTestCaseEnd(const TestCase& test_case) override {
SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
+ "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
+ "ms");
}
void OnTestStart(const TestInfo& test_info) {
void OnTestStart(const TestInfo& test_info) override {
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=" +
FormatBool((test_info.result())->Passed()) +
"&elapsed_time=" +
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();
if (file_name == NULL)
file_name = "";

View file

@ -2697,19 +2697,19 @@ class PrettyUnitTestResultPrinter : public TestEventListener {
}
// The following methods override what's in the TestEventListener class.
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
virtual void OnTestCaseStart(const TestCase& test_case);
virtual void OnTestStart(const TestInfo& test_info);
virtual void OnTestPartResult(const TestPartResult& result);
virtual void OnTestEnd(const TestInfo& test_info);
virtual void OnTestCaseEnd(const TestCase& test_case);
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
virtual void OnTestCaseStart(const TestCase& test_case) override;
virtual void OnTestStart(const TestInfo& test_info) override;
virtual void OnTestPartResult(const TestPartResult& result) override;
virtual void OnTestEnd(const TestInfo& test_info) override;
virtual void OnTestCaseEnd(const TestCase& test_case) override;
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
private:
static void PrintFailedTests(const UnitTest& unit_test);
@ -2908,19 +2908,19 @@ class TestEventRepeater : public TestEventListener {
bool forwarding_enabled() const { return forwarding_enabled_; }
void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
virtual void OnTestProgramStart(const UnitTest& unit_test);
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
virtual void OnTestCaseStart(const TestCase& test_case);
virtual void OnTestStart(const TestInfo& test_info);
virtual void OnTestPartResult(const TestPartResult& result);
virtual void OnTestEnd(const TestInfo& test_info);
virtual void OnTestCaseEnd(const TestCase& test_case);
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
virtual void OnTestProgramEnd(const UnitTest& unit_test);
virtual void OnTestProgramStart(const UnitTest& unit_test) override;
virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) override;
virtual void OnTestCaseStart(const TestCase& test_case) override;
virtual void OnTestStart(const TestInfo& test_info) override;
virtual void OnTestPartResult(const TestPartResult& result) override;
virtual void OnTestEnd(const TestInfo& test_info) override;
virtual void OnTestCaseEnd(const TestCase& test_case) override;
virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) override;
virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
virtual void OnTestProgramEnd(const UnitTest& unit_test) override;
private:
// Controls whether events will be forwarded to listeners_. Set to false
@ -3013,7 +3013,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
public:
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:
// Is c a whitespace character that is normalized to a space character

View file

@ -550,12 +550,10 @@ void BlockchainExplorer::poolChanged() {
for (const Hash hash : *removedTransactionsPtr) {
auto iter = knownPoolState.find(hash);
if (iter != knownPoolState.end()) {
removedTransactionsHashesPtr->push_back(
std::move(std::make_pair(
hash,
TransactionRemoveReason::INCLUDED_IN_BLOCK //Can't have real reason here.
))
);
removedTransactionsHashesPtr->push_back({
hash,
TransactionRemoveReason::INCLUDED_IN_BLOCK // Can't have real reason here.
});
knownPoolState.erase(iter);
}
}

View file

@ -67,7 +67,7 @@ bool BlockchainExplorerDataBuilder::fillTxExtra(const std::vector<uint8_t>& rawE
} else if (typeid(TransactionExtraPublicKey) == field.type()) {
extraDetails.publicKey.push_back(std::move(boost::get<TransactionExtraPublicKey>(field).publicKey));
} 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;

View file

@ -34,15 +34,15 @@ class BlockchainExplorerErrorCategory : public std::error_category {
public:
static BlockchainExplorerErrorCategory INSTANCE;
virtual const char* name() const throw() {
virtual const char* name() const throw() override {
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);
}
virtual std::string message(int ev) const {
virtual std::string message(int ev) const override {
switch (ev) {
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";

View file

@ -32,6 +32,8 @@ public:
const static Size MAXIMUM_SIZE = MAXIMUM_SIZE_VALUE;
const static Size INVALID;
static_assert(MAXIMUM_SIZE != 0, "StringBuffer's size must not be zero");
// Default constructor.
// After construction, 'StringBuffer' is empty, that is 'size' == 0
StringBuffer() : size(0) {
@ -202,7 +204,6 @@ public:
// Compare two strings character-wise.
bool operator<(StringView other) const {
assert(data != nullptr || size == 0);
Size count = other.getSize() < size ? other.getSize() : size;
for (Size i = 0; i < count; ++i) {
Object char1 = *(data + i);
@ -354,7 +355,6 @@ public:
// Looks for the last occurence of 'object' in 'StringView',
// returns index or INVALID if there are no occurences.
Size findLast(const Object& object) const {
assert(data != nullptr || size == 0);
for (Size i = 0; i < size; ++i) {
if (*(data + (size - 1 - i)) == object) {
return size - 1 - i;

View file

@ -166,7 +166,8 @@ const CheckpointData CHECKPOINTS[] = {
{816000, "32b7fdd4e4d715db81f8f09f4ba5e5c78e8113f2804d61a57378baee479ce745"},
{822000, "a3c9603c6813a0dc0efc40db288c356d1a7f02d1d2e47bee04346e73715f8984"},
{841000, "2cffb6504ee38f708a6256a63585f9382b3b426e64b4504236c70678bd160dce"},
{890000, "a7132932ea31236ce6b8775cd1380edf90b5e536ee4202c77b69a3d62445fcd2"}
{890000, "a7132932ea31236ce6b8775cd1380edf90b5e536ee4202c77b69a3d62445fcd2"},
{894000, "ae2624ea1472ecc36de0d812f21a32da2d4afc7d5770830083cbaf652209d316"}
};
} // CryptoNote

View file

@ -775,7 +775,7 @@ bool Blockchain::switch_to_alternative_blockchain(std::list<blocks_ext_by_hash::
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();
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 << "difficulty:\t" << current_diff;
if (sendNewAlternativeBlockMessage) {
sendMessage(BlockchainMessage(std::move(NewAlternativeBlockMessage(id))));
sendMessage(BlockchainMessage(NewAlternativeBlockMessage(id)));
}
return true;
}
@ -1688,7 +1688,7 @@ bool Blockchain::addNewBlock(const Block& bl_, block_verification_context& bvc)
} else {
add_result = pushBlock(bl, bvc);
if (add_result) {
sendMessage(BlockchainMessage(std::move(NewBlockMessage(id))));
sendMessage(BlockchainMessage(NewBlockMessage(id)));
}
}
}

View file

@ -27,7 +27,7 @@ namespace CryptoNote {
};
struct RealTimeProvider : public ITimeProvider {
virtual time_t now() {
virtual time_t now() override {
return time(nullptr);
}
};

View file

@ -35,15 +35,15 @@ class HttpParserErrorCategory : public std::error_category {
public:
static HttpParserErrorCategory INSTANCE;
virtual const char* name() const throw() {
virtual const char* name() const throw() override {
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);
}
virtual std::string message(int ev) const {
virtual std::string message(int ev) const override {
switch (ev) {
case STREAM_NOT_GOOD: return "The stream is not good";
case END_OF_STREAM: return "The stream is ended";

View file

@ -36,15 +36,15 @@ class InProcessNodeErrorCategory : public std::error_category {
public:
static InProcessNodeErrorCategory INSTANCE;
virtual const char* name() const throw() {
virtual const char* name() const throw() override {
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);
}
virtual std::string message(int ev) const {
virtual std::string message(int ev) const override {
switch (ev) {
case NOT_INITIALIZED: return "Object was not initialized";
case ALREADY_INITIALIZED: return "Object has been already initialized";

View file

@ -39,15 +39,15 @@ class NodeErrorCategory : public std::error_category {
public:
static NodeErrorCategory INSTANCE;
virtual const char* name() const throw() {
virtual const char* name() const throw() override {
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);
}
virtual std::string message(int ev) const {
virtual std::string message(int ev) const override {
switch (ev) {
case NOT_INITIALIZED: return "Object was not initialized";
case ALREADY_INITIALIZED: return "Object has been already initialized";

View file

@ -34,10 +34,10 @@ namespace CryptoNote {
};
struct p2p_endpoint_stub: public IP2pEndpoint {
virtual void relay_notify_to_all(int command, const BinaryArray& data_buff, const net_connection_id* excludeConnection) {}
virtual bool invoke_notify_to_peer(int command, const BinaryArray& req_buff, const CryptoNote::CryptoNoteConnectionContext& context) { return true; }
virtual void for_each_connection(std::function<void(CryptoNote::CryptoNoteConnectionContext&, PeerIdType)> f) {}
virtual uint64_t get_connections_count() { return 0; }
virtual void externalRelayNotifyToAll(int command, const BinaryArray& data_buff) {}
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) override { return true; }
virtual void for_each_connection(std::function<void(CryptoNote::CryptoNoteConnectionContext&, PeerIdType)> f) override {}
virtual uint64_t get_connections_count() override { return 0; }
virtual void externalRelayNotifyToAll(int command, const BinaryArray& data_buff) override {}
};
}

View file

@ -35,15 +35,15 @@ class WalletServiceErrorCategory : public std::error_category {
public:
static WalletServiceErrorCategory INSTANCE;
virtual const char* name() const throw() {
virtual const char* name() const throw() override {
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);
}
virtual std::string message(int ev) const {
virtual std::string message(int ev) const override {
WalletServiceErrorCode code = static_cast<WalletServiceErrorCode>(ev);
switch (code) {

View file

@ -23,7 +23,7 @@ namespace System {
class InterruptedException : public std::exception {
public:
const char* what() const throw() {
virtual const char* what() const throw() override {
return "interrupted";
}
};

View file

@ -58,15 +58,15 @@ class WalletErrorCategory : public std::error_category {
public:
static WalletErrorCategory INSTANCE;
virtual const char* name() const throw() {
virtual const char* name() const throw() override {
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);
}
virtual std::string message(int ev) const {
virtual std::string message(int ev) const override {
switch (ev) {
case NOT_INITIALIZED: return "Object was not initialized";
case WRONG_PASSWORD: return "The password is wrong";

View file

@ -94,7 +94,7 @@ public:
SyncStarter(BlockchainSynchronizer& sync) : m_sync(sync) {}
virtual ~SyncStarter() {}
virtual void initCompleted(std::error_code result) {
virtual void initCompleted(std::error_code result) override {
if (!result) {
m_sync.start();
}

View file

@ -38,7 +38,7 @@ public:
WalletTransactionUpdatedEvent(TransactionId transactionId) : m_id(transactionId) {};
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);
}
@ -53,7 +53,7 @@ public:
WalletSendTransactionCompletedEvent(TransactionId transactionId, std::error_code result) : m_id(transactionId), m_error(result) {};
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);
}
@ -69,7 +69,7 @@ public:
WalletExternalTransactionCreatedEvent(TransactionId transactionId) : m_id(transactionId) {};
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);
}
@ -83,7 +83,7 @@ public:
WalletSynchronizationProgressUpdatedEvent(uint32_t current, uint32_t total) : m_current(current), m_total(total) {};
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);
}
@ -98,7 +98,7 @@ public:
WalletSynchronizationCompletedEvent(uint32_t current, uint32_t total, std::error_code result) : m_ec(result) {};
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);
}
@ -112,7 +112,7 @@ public:
WalletActualBalanceUpdatedEvent(uint64_t balance) : m_balance(balance) {};
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);
}
@ -126,7 +126,7 @@ public:
WalletPendingBalanceUpdatedEvent(uint64_t balance) : m_balance(balance) {};
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);
}

View file

@ -48,7 +48,7 @@ public:
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));
};
@ -66,7 +66,7 @@ public:
WalletRelayTransactionRequest(const CryptoNote::Transaction& tx, Callback cb) : m_tx(tx), m_cb(cb) {};
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));
}

View file

@ -1,4 +1,4 @@
#define BUILD_COMMIT_ID "@VERSION@"
#define PROJECT_VERSION "1.0.9"
#define PROJECT_VERSION_BUILD_NO "661"
#define PROJECT_VERSION "1.0.9.1"
#define PROJECT_VERSION_BUILD_NO "662"
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"

View file

@ -70,7 +70,7 @@ namespace {
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]() {
if (m_waiting && m_expectedTxId == transactionId) {
m_result = result;

View file

@ -120,7 +120,7 @@ public:
public:
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) {
m_GotActual.notify();
}
@ -136,7 +136,7 @@ public:
public:
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) {
m_GotActual.notify();
}
@ -152,7 +152,7 @@ public:
public:
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) {
m_GotActual.notify();
}

View file

@ -42,7 +42,7 @@ TEST(EventTests, eventIsWorking) {
TEST(EventTests, movedEventIsWorking) {
Dispatcher dispatcher;
Event event(std::move(Event(dispatcher)));
Event event{Event(dispatcher)};
Context<> context(dispatcher, [&]() {
event.set();
});

View file

@ -47,7 +47,7 @@ TEST_F(TimerTests, timerIsWorking) {
}
TEST_F(TimerTests, movedTimerIsWorking) {
Timer t(std::move(Timer(dispatcher)));
Timer t{Timer{dispatcher}};
bool done = false;
contextGroup.spawn([&]() {
done = true;
@ -143,7 +143,7 @@ TEST_F(TimerTests, movedTimerIsWorking2) {
bool done = false;
contextGroup.spawn([&] {
Timer t(dispatcher);
t = std::move(Timer(dispatcher));
t = Timer{dispatcher};
//contextGroup.spawn([&]() { done = true; });
ASSERT_FALSE(done);

View file

@ -47,7 +47,7 @@ namespace {
class PoolChangedObserver : public INodeObserver {
public:
virtual void poolChanged() {
virtual void poolChanged() override {
std::unique_lock<std::mutex> lk(mutex);
ready = true;
cv.notify_all();

View file

@ -43,13 +43,13 @@ public:
class WalletLegacyObserver : public IWalletLegacyObserver {
public:
virtual void actualBalanceUpdated(uint64_t actualBalance) {
virtual void actualBalanceUpdated(uint64_t actualBalance) override {
std::cout << "Actual balance updated = " << currency.formatAmount(actualBalance) << std::endl;
m_actualBalance = actualBalance;
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;
}

View file

@ -93,7 +93,7 @@ namespace
protected:
static const uint64_t alreadyGeneratedCoins = 0;
virtual void SetUp() {
virtual void SetUp() override {
m_blockTooBig = !m_currency.getBlockReward(0, 0, alreadyGeneratedCoins, 0, false,
m_standardBlockReward, m_emissionChange);
ASSERT_FALSE(m_blockTooBig);
@ -190,7 +190,7 @@ namespace
static const size_t testMedian = 7 * TEST_GRANTED_FULL_REWARD_ZONE;
static const uint64_t alreadyGeneratedCoins = 0;
virtual void SetUp() {
virtual void SetUp() override {
m_blockTooBig = !m_currency.getBlockReward(testMedian, 0, alreadyGeneratedCoins, 0, false,
m_standardBlockReward, m_emissionChange);
@ -293,7 +293,7 @@ namespace
}
protected:
virtual void SetUp() {
virtual void SetUp() override {
uint64_t blockReward;
int64_t emissionChange;

View file

@ -26,11 +26,11 @@ class ICryptoNoteProtocolQueryStub: public CryptoNote::ICryptoNoteProtocolQuery
public:
ICryptoNoteProtocolQueryStub() : peers(0), observedHeight(0), synchronized(false) {}
virtual bool addObserver(CryptoNote::ICryptoNoteProtocolObserver* observer);
virtual bool removeObserver(CryptoNote::ICryptoNoteProtocolObserver* observer);
virtual uint32_t getObservedHeight() const;
virtual size_t getPeerCount() const;
virtual bool isSynchronized() const;
virtual bool addObserver(CryptoNote::ICryptoNoteProtocolObserver* observer) override;
virtual bool removeObserver(CryptoNote::ICryptoNoteProtocolObserver* observer) override;
virtual uint32_t getObservedHeight() const override;
virtual size_t getPeerCount() const override;
virtual bool isSynchronized() const override;
void setPeerCount(uint32_t count);
void setObservedHeight(uint32_t height);

View file

@ -390,10 +390,10 @@ TEST_F(BcSTest, stopIsWaiting) {
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;
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -413,9 +413,9 @@ TEST_F(BcSTest, syncCompletedError) {
IBlockchainSynchronizerFunctorialObserver o1;
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));
});
};
m_sync.addObserver(&o);
m_sync.addObserver(&o1);
@ -434,9 +434,9 @@ TEST_F(BcSTest, onLastKnownBlockHeightUpdated) {
generator.generateEmptyBlocks(20);
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -460,9 +460,9 @@ TEST_F(BcSTest, onPoolChanged) {
generator.generateEmptyBlocks(20);
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -594,9 +594,9 @@ TEST_F(BcSTest, firstPoolSynchronizationCheck) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -635,9 +635,9 @@ TEST_F(BcSTest, firstPoolSynchronizationCheckNonActual) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -671,9 +671,9 @@ TEST_F(BcSTest, firstPoolSynchronizationCheckGetPoolErr) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -692,9 +692,9 @@ TEST_F(BcSTest, poolSynchronizationCheckActual) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -730,10 +730,10 @@ TEST_F(BcSTest, poolSynchronizationCheckError) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -778,9 +778,9 @@ TEST_F(BcSTest, poolSynchronizationCheckTxAdded) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -836,9 +836,9 @@ TEST_F(BcSTest, poolSynchronizationCheckTxDeleted) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -892,9 +892,9 @@ TEST_F(BcSTest, poolSynchronizationCheckNotification) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.start();
@ -920,9 +920,9 @@ TEST_F(BcSTest, poolSynchronizationCheckConsumersNotififcation) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
o1.syncFunc = std::move([&e](std::error_code) {
o1.syncFunc = [&e](std::error_code) {
e.notify();
});
};
m_sync.addObserver(&o1);
m_sync.addConsumer(&c1);
@ -956,10 +956,10 @@ TEST_F(BcSTest, poolSynchronizationCheckConsumerReturnError) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
m_sync.addObserver(&o1);
m_sync.addConsumer(&c1);
@ -996,10 +996,10 @@ TEST_F(BcSTest, checkINodeError) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
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 {
callback(std::make_error_code(std::errc::invalid_argument));
@ -1021,10 +1021,10 @@ TEST_F(BcSTest, checkConsumerError) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
generator.generateEmptyBlocks(10);
@ -1048,10 +1048,10 @@ TEST_F(BcSTest, checkBlocksRequesting) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
size_t blocksExpected = 20;
@ -1082,10 +1082,10 @@ TEST_F(BcSTest, checkConsumerHeightReceived) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
uint32_t firstlySnchronizedHeight = 20;
@ -1127,10 +1127,10 @@ TEST_F(BcSTest, checkConsumerOldBlocksNotIvoked) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
generator.generateEmptyBlocks(20);
m_node.setGetNewBlocksLimit(50);
@ -1169,10 +1169,10 @@ TEST_F(BcSTest, checkConsumerHeightReceivedOnDetach) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
generator.generateEmptyBlocks(20);
m_node.setGetNewBlocksLimit(50);
@ -1218,10 +1218,10 @@ TEST_F(BcSTest, checkStatePreservingBetweenSynchronizations) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
generator.generateEmptyBlocks(20);
@ -1255,10 +1255,10 @@ TEST_F(BcSTest, checkBlocksRerequestingOnError) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
generator.generateEmptyBlocks(20);
m_node.setGetNewBlocksLimit(10);
@ -1325,10 +1325,10 @@ TEST_F(BcSTest, checkTxOrder) {
IBlockchainSynchronizerFunctorialObserver o1;
EventWaiter e;
std::error_code errc;
o1.syncFunc = std::move([&](std::error_code ec) {
o1.syncFunc = [&](std::error_code ec) {
e.notify();
errc = ec;
});
};
auto tx1ptr = createTransaction();
auto tx2ptr = createTransaction();

View file

@ -104,8 +104,8 @@ public:
nodeStub(generator),
blockchainExplorer(nodeStub, logger) {
}
void SetUp();
void TearDown();
void SetUp() override;
void TearDown() override;
protected:
Currency currency;

View file

@ -62,7 +62,7 @@ public:
node(coreStub, protocolQueryStub),
currency(CryptoNote::CurrencyBuilder(logger).currency()),
generator(currency) {}
void SetUp();
void SetUp() override;
protected:
void initNode();

View file

@ -41,8 +41,8 @@ public:
void sendBlockchainMessage(const BlockchainMessage& message);
void interruptBlockchainMessageWaiting();
void SetUp();
void TearDown();
void SetUp() override;
void TearDown() override;
protected:
System::Dispatcher dispatcher;
@ -97,7 +97,7 @@ TEST_F(MessageQueueTest, singleNewBlockMessage) {
ASSERT_NO_THROW(queue.pop());
});
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(randomHash)))));
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(randomHash))));
contextGroup.wait();
}
@ -120,7 +120,7 @@ TEST_F(MessageQueueTest, singleNewAlternativeBlockMessage) {
ASSERT_NO_THROW(queue.pop());
});
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewAlternativeBlockMessage(randomHash)))));
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewAlternativeBlockMessage(randomHash))));
contextGroup.wait();
}
@ -150,7 +150,7 @@ TEST_F(MessageQueueTest, singleChainSwitchMessage) {
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();
}
@ -181,7 +181,7 @@ TEST_F(MessageQueueTest, manyMessagesOneListener) {
});
for (auto h : randomHashes) {
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(h)))));
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(h))));
}
contextGroup.wait();
@ -193,8 +193,8 @@ TEST_F(MessageQueueTest, manyMessagesManyListeners) {
std::array<std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>, NUMBER_OF_LISTENERS> quards;
for (size_t i = 0; i < NUMBER_OF_LISTENERS; ++i) {
queues[i] = std::move(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])));
queues[i] = std::unique_ptr<MessageQueue<BlockchainMessage>>(new MessageQueue<BlockchainMessage>(dispatcher));
quards[i] = std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>(new MesageQueueGuard<MessageQueueTest, BlockchainMessage>(*this, *queues[i]));
}
const size_t NUMBER_OF_BLOCKS = 10;
@ -222,7 +222,7 @@ TEST_F(MessageQueueTest, manyMessagesManyListeners) {
for (auto h : randomHashes) {
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(h)))));
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(h))));
}
contextGroup.wait();
@ -234,8 +234,8 @@ TEST_F(MessageQueueTest, interruptWaiting) {
std::array<std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>, NUMBER_OF_LISTENERS> quards;
for (size_t i = 0; i < NUMBER_OF_LISTENERS; ++i) {
queues[i] = std::move(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])));
queues[i] = std::unique_ptr<MessageQueue<BlockchainMessage>>(new MessageQueue<BlockchainMessage>(dispatcher));
quards[i] = std::unique_ptr<MesageQueueGuard<MessageQueueTest, BlockchainMessage>>(new MesageQueueGuard<MessageQueueTest, BlockchainMessage>(*this, *queues[i]));
}
const size_t NUMBER_OF_BLOCKS = 10;
@ -272,7 +272,7 @@ TEST_F(MessageQueueTest, interruptWaiting) {
});
for (auto h : randomHashes) {
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(std::move(NewBlockMessage(h)))));
ASSERT_NO_THROW(sendBlockchainMessage(BlockchainMessage(NewBlockMessage(h))));
}
interruptBlockchainMessageWaiting();

View file

@ -1599,7 +1599,7 @@ class INodeNoRelay : public INodeTrivialRefreshStub {
public:
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();
std::thread task(&INodeNoRelay::doNoRelayTransaction, this, transaction, callback);
task.detach();

View file

@ -158,7 +158,7 @@ public:
WalletLegacyApi() : m_currency(CryptoNote::CurrencyBuilder(m_logger).currency()), generator(m_currency) {
}
void SetUp();
void SetUp() override;
protected:
void prepareAliceWallet();

View file

@ -75,7 +75,7 @@ struct IWalletBaseStub : public CryptoNote::IWallet {
virtual uint64_t getPendingBalance(const std::string& address) 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 WalletTransfer getTransactionTransfer(size_t transactionIndex, size_t transferIndex) const override { return WalletTransfer(); }
@ -902,7 +902,7 @@ struct WalletGetDelayedTransactionIdsStub : public IWalletBaseStub {
return {0};
}
virtual WalletTransaction getTransaction(size_t transactionIndex) const {
virtual WalletTransaction getTransaction(size_t transactionIndex) const override {
return WalletTransactionBuilder().hash(hash).build();
}

View file

@ -60,7 +60,7 @@ public:
: timeNow(currentTime) {}
time_t timeNow;
virtual time_t now() { return timeNow; }
virtual time_t now() override { return timeNow; }
};