MCPcopy Create free account
hub / github.com/ElementsProject/elements / HasReason

Class HasReason

src/test/util/setup_common.h:229–240  ·  view source on GitHub ↗

* BOOST_CHECK_EXCEPTION predicates to check the specific validation error. * Use as * BOOST_CHECK_EXCEPTION(code that throws, exception type, HasReason("foo")); */

Source from the content-addressed store, hash-verified

227 * BOOST_CHECK_EXCEPTION(code that throws, exception type, HasReason("foo"));
228 */
229class HasReason
230{
231public:
232 explicit HasReason(const std::string& reason) : m_reason(reason) {}
233 bool operator()(const std::exception& e) const
234 {
235 return std::string(e.what()).find(m_reason) != std::string::npos;
236 };
237
238private:
239 const std::string m_reason;
240};
241
242#endif // BITCOIN_TEST_UTIL_SETUP_COMMON_H

Callers 7

BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
TestDoubleLockFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls

no outgoing calls

Tested by 7

BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
TestDoubleLockFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68