]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2043] fixed compilation
authorRazvan Becheriu <razvan@isc.org>
Tue, 24 Aug 2021 09:08:59 +0000 (12:08 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 24 Aug 2021 18:52:09 +0000 (21:52 +0300)
src/lib/http/tests/client_mt_unittests.cc

index 2a5c48182df3af4f5628b2266b2cf1a82b59679c..da1dc8c4aebd548ee4481972f4ebc2c78be20e16 100644 (file)
@@ -271,6 +271,14 @@ public:
         return (request);
     }
 
+    /// @brief Test that owned threads are not permitted to change thread pool
+    /// state.
+    void testIllegalThreadPoolActions() {
+        ASSERT_THROW(client_->start(), MultiThreadingInvalidOperation);
+        ASSERT_THROW(client_->pause(), MultiThreadingInvalidOperation);
+        ASSERT_THROW(client_->resume(), MultiThreadingInvalidOperation);
+    }
+
     /// @brief Initiates a single HTTP request.
     ///
     /// Constructs an HTTP post whose body is a JSON map containing a
@@ -323,9 +331,7 @@ public:
             // If running on multiple threads, threads should be prohibited from
             // changing the thread pool state.
             if (num_threads_) {
-                ASSERT_THROW(client_->start(), MultiThreadingInvalidOperation);
-                ASSERT_THROW(client_->pause(), MultiThreadingInvalidOperation);
-                ASSERT_THROW(client_->resume(), MultiThreadingInvalidOperation);
+                testIllegalThreadPoolActions();
             }
 
             // Get stringified thread-id.