Changeset View
Changeset View
Standalone View
Standalone View
src/test/miner_tests.cpp
Show All 27 Lines | |||||
#include <memory> | #include <memory> | ||||
BOOST_FIXTURE_TEST_SUITE(miner_tests, TestingSetup) | BOOST_FIXTURE_TEST_SUITE(miner_tests, TestingSetup) | ||||
// BOOST_CHECK_EXCEPTION predicates to check the specific validation error | // BOOST_CHECK_EXCEPTION predicates to check the specific validation error | ||||
class HasReason { | class HasReason { | ||||
public: | 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 { | bool operator()(const std::runtime_error &e) const { | ||||
return std::string(e.what()).find(m_reason) != std::string::npos; | return std::string(e.what()).find(m_reason) != std::string::npos; | ||||
}; | }; | ||||
private: | private: | ||||
const std::string m_reason; | const std::string m_reason; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 739 Lines • Show Last 20 Lines |