diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-08-27 13:32:59 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-08-27 13:33:04 -0400 |
commit | dd34204611e1dd13be441e2d54c8f659e9c7a9cd (patch) | |
tree | c2ff516614a1e43382087b9408caefc80f8f6374 /src/test | |
parent | f180e81d5780805a28bcc71c2bb6b16076336c3c (diff) | |
parent | 1ac3c983bfe06f75542e4f4e30142952802a46d8 (diff) |
Merge #13769: Mark single-argument constructors "explicit"
1ac3c983bf Mark single-argument constructors "explicit" (practicalswift)
Pull request description:
Mark single-argument constructors `explicit`.
Rationale:
* Avoid unexpected implicit promotions.
From the developer notes:
> **By default, declare single-argument constructors explicit.**
> Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions.
Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/miner_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/validation_block_tests.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 2b9641b6d4..c4793472d4 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -29,7 +29,7 @@ BOOST_FIXTURE_TEST_SUITE(miner_tests, TestingSetup) // BOOST_CHECK_EXCEPTION predicates to check the specific validation error class HasReason { public: - HasReason(const std::string& reason) : m_reason(reason) {} + explicit HasReason(const std::string& reason) : m_reason(reason) {} bool operator() (const std::runtime_error& e) const { return std::string(e.what()).find(m_reason) != std::string::npos; }; diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp index 37c4f79133..4316f37999 100644 --- a/src/test/validation_block_tests.cpp +++ b/src/test/validation_block_tests.cpp @@ -23,7 +23,7 @@ BOOST_FIXTURE_TEST_SUITE(validation_block_tests, RegtestingSetup) struct TestSubscriber : public CValidationInterface { uint256 m_expected_tip; - TestSubscriber(uint256 tip) : m_expected_tip(tip) {} + explicit TestSubscriber(uint256 tip) : m_expected_tip(tip) {} void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override { |