diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-06 21:30:34 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-03-06 21:40:46 +0800 |
commit | e2c01948f45743bd90c89cf080fa4142786bf09b (patch) | |
tree | 38f88be18bd870eb505f02b0f35db353b032a06c | |
parent | 4534ff8792ad9849845457ff063ed0d3f2a2181a (diff) | |
download | dexon-solidity-e2c01948f45743bd90c89cf080fa4142786bf09b.tar.gz dexon-solidity-e2c01948f45743bd90c89cf080fa4142786bf09b.tar.zst dexon-solidity-e2c01948f45743bd90c89cf080fa4142786bf09b.zip |
Style fixes and better exception message format
-rw-r--r-- | TestHelper.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/TestHelper.h b/TestHelper.h index 37c90add..91ec977d 100644 --- a/TestHelper.h +++ b/TestHelper.h @@ -49,34 +49,36 @@ namespace test /// @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 #define ETH_TEST_REQUIRE_NO_THROW(_expression, _message) \ - do { \ + do \ + { \ try \ { \ _expression; \ } \ 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); \ } \ - }while (0) + } while (0) /// Check if an Exception is thrown during testing. If one is thrown show its info and continue the test /// Our version of BOOST_CHECK_NO_THROW() /// @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 #define ETH_TEST_CHECK_NO_THROW(_expression, _message) \ - do { \ + do \ + { \ try \ { \ _expression; \ } \ 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); \ } \ - }while (0) + } while (0) class ImportTest |