Add BEAST_THROWS

This commit is contained in:
Vinnie Falco
2019-10-06 15:15:54 -07:00
parent d6bc3da94c
commit 7dbb3bd417
2 changed files with 20 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
Version 272:
* Add BEAST_THROWS
--------------------------------------------------------------------------------
Version 271:
* Add HTTP async client with system_executor example

View File

@@ -639,6 +639,20 @@ run(runner& r)
(::boost::beast::unit_test::suite::this_suite()->fail((reason), __FILE__, __LINE__), false))
#endif
/** Ensure an exception is thrown
*/
#define BEAST_THROWS( EXPR, EXCEP ) \
try { \
EXPR; \
BEAST_FAIL(); \
} \
catch(EXCEP const&) { \
BEAST_PASS(); \
} \
catch(...) { \
BEAST_FAIL(); \
}
} // unit_test
} // beast
} // boost