mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Add BEAST_THROWS
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
Version 272:
|
||||
|
||||
* Add BEAST_THROWS
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Version 271:
|
||||
|
||||
* Add HTTP async client with system_executor example
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user