Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / beast / _experimental / unit_test / suite.hpp
index 3cda8fe..fd6e2a2 100644 (file)
@@ -193,6 +193,10 @@ public:
     {
     }
 
+    virtual ~suite() = default;
+    suite(suite const&) = delete;
+    suite& operator=(suite const&) = delete;
+
     /** Invokes the test using the specified runner.
 
         Data members are set up here instead of the constructor as a
@@ -635,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