mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Style fixes and better exception message format
This commit is contained in:
parent
4534ff8792
commit
e2c01948f4
10
TestHelper.h
10
TestHelper.h
@ -49,14 +49,15 @@ namespace test
|
|||||||
/// @param _expression The expression for which to make sure no exceptions are thrown
|
/// @param _expression The expression for which to make sure no exceptions are thrown
|
||||||
/// @param _message A message to act as a prefix to the expression's error information
|
/// @param _message A message to act as a prefix to the expression's error information
|
||||||
#define ETH_TEST_REQUIRE_NO_THROW(_expression, _message) \
|
#define ETH_TEST_REQUIRE_NO_THROW(_expression, _message) \
|
||||||
do { \
|
do \
|
||||||
|
{ \
|
||||||
try \
|
try \
|
||||||
{ \
|
{ \
|
||||||
_expression; \
|
_expression; \
|
||||||
} \
|
} \
|
||||||
catch (boost::exception const& _e) \
|
catch (boost::exception const& _e) \
|
||||||
{ \
|
{ \
|
||||||
auto msg = std::string(_message) + boost::diagnostic_information(_e); \
|
auto msg = std::string(_message"\n") + boost::diagnostic_information(_e); \
|
||||||
BOOST_FAIL(msg); \
|
BOOST_FAIL(msg); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -66,14 +67,15 @@ namespace test
|
|||||||
/// @param _expression The expression for which to make sure no exceptions are thrown
|
/// @param _expression The expression for which to make sure no exceptions are thrown
|
||||||
/// @param _message A message to act as a prefix to the expression's error information
|
/// @param _message A message to act as a prefix to the expression's error information
|
||||||
#define ETH_TEST_CHECK_NO_THROW(_expression, _message) \
|
#define ETH_TEST_CHECK_NO_THROW(_expression, _message) \
|
||||||
do { \
|
do \
|
||||||
|
{ \
|
||||||
try \
|
try \
|
||||||
{ \
|
{ \
|
||||||
_expression; \
|
_expression; \
|
||||||
} \
|
} \
|
||||||
catch (boost::exception const& _e) \
|
catch (boost::exception const& _e) \
|
||||||
{ \
|
{ \
|
||||||
auto msg = std::string(_message) + boost::diagnostic_information(_e); \
|
auto msg = std::string(_message"\n") + boost::diagnostic_information(_e); \
|
||||||
BOOST_MESSAGE(msg); \
|
BOOST_MESSAGE(msg); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
Loading…
Reference in New Issue
Block a user