]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2202] Try throwing std::exception too
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 1 Oct 2012 13:17:51 +0000 (15:17 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 1 Oct 2012 13:17:51 +0000 (15:17 +0200)
src/lib/util/threads/tests/thread_unittest.cc

index 97cace2a53f8d04cab62cedb2d94218af7d6c21b..4d477ee9878ac261d57b99b0acdb97088ec27aa1 100644 (file)
@@ -73,18 +73,28 @@ throwSomething() {
     throw 42; // Throw something really unusual, to see everything is caught.
 }
 
+void
+throwException() {
+    throw std::exception();
+}
+
 // Exception in the thread we forget about should not do anything to us
 TEST(ThreadTest, detachedException) {
     for (size_t i = 0; i < detached_iterations; ++i) {
         Thread thread(throwSomething);
     }
+    for (size_t i = 0; i < detached_iterations; ++i) {
+        Thread thread(throwException);
+    }
 }
 
 // An uncaught exception in the thread should propagate through wait
 TEST(ThreadTest, exception) {
     for (size_t i = 0; i < iterations; ++i) {
         Thread thread(throwSomething);
+        Thread thread2(throwException);
         ASSERT_THROW(thread.wait(), Thread::UncaughtException);
+        ASSERT_THROW(thread2.wait(), Thread::UncaughtException);
     }
 }