Merge #13282: trivial: Mark overrides as such.
60ebc7da4c
trivial: Mark overrides as such. (Daniel Kraft)
Pull request description:
This trivial change adds the `override` keyword to some methods that override virtual base class / interface methods. This ensures that any future changes to the interface's method signatures which are not correctly mirrored in the subclasses will break at compile time with a clear error message, rather than at runtime.
Tree-SHA512: cc1bfa5f03b5e29d20e3eab07b0b5fa2f77b47f79e08263dbff43e4f463e9dd8f4f537e2c8c9b6cb3663220dcf40cfd77723cd9fcbd623c9efc90a4cd44facfc
This commit is contained in:
commit
6916024768
2 changed files with 9 additions and 9 deletions
|
@ -111,9 +111,9 @@ public:
|
||||||
class ConsolePrinter : public Printer
|
class ConsolePrinter : public Printer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void header();
|
void header() override;
|
||||||
void result(const State& state);
|
void result(const State& state) override;
|
||||||
void footer();
|
void footer() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
// creates box plot with plotly.js
|
// creates box plot with plotly.js
|
||||||
|
@ -121,9 +121,9 @@ class PlotlyPrinter : public Printer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PlotlyPrinter(std::string plotly_url, int64_t width, int64_t height);
|
PlotlyPrinter(std::string plotly_url, int64_t width, int64_t height);
|
||||||
void header();
|
void header() override;
|
||||||
void result(const State& state);
|
void result(const State& state) override;
|
||||||
void footer();
|
void footer() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_plotly_url;
|
std::string m_plotly_url;
|
||||||
|
|
|
@ -25,12 +25,12 @@ struct TestSubscriber : public CValidationInterface {
|
||||||
|
|
||||||
TestSubscriber(uint256 tip) : m_expected_tip(tip) {}
|
TestSubscriber(uint256 tip) : m_expected_tip(tip) {}
|
||||||
|
|
||||||
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
|
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override
|
||||||
{
|
{
|
||||||
BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash());
|
BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted)
|
void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted) override
|
||||||
{
|
{
|
||||||
BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock);
|
BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock);
|
||||||
BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash());
|
BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash());
|
||||||
|
@ -38,7 +38,7 @@ struct TestSubscriber : public CValidationInterface {
|
||||||
m_expected_tip = block->GetHash();
|
m_expected_tip = block->GetHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlockDisconnected(const std::shared_ptr<const CBlock>& block)
|
void BlockDisconnected(const std::shared_ptr<const CBlock>& block) override
|
||||||
{
|
{
|
||||||
BOOST_CHECK_EQUAL(m_expected_tip, block->GetHash());
|
BOOST_CHECK_EQUAL(m_expected_tip, block->GetHash());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue