]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1568] Fix a test that failed
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 14 Mar 2012 11:46:51 +0000 (12:46 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 14 Mar 2012 11:46:51 +0000 (12:46 +0100)
We can no longer EXPECT_THROW, if we don't throw.

src/lib/util/tests/buffer_unittest.cc

index 666924ed5b2eed6ea83b70f6162e00b6cf439e8e..8cccd282e3a2845ae40e670ea02818c31401bda8 100644 (file)
@@ -182,7 +182,17 @@ TEST_F(BufferTest, outputBufferReadat) {
     for (int i = 0; i < sizeof(testdata); i ++) {
         EXPECT_EQ(testdata[i], obuffer[i]);
     }
-    EXPECT_THROW(obuffer[sizeof(testdata)], isc::util::InvalidBufferPosition);
+#ifdef EXPECT_DEATH
+    // We use assert now, so we check it dies
+    EXPECT_DEATH({
+        try {
+            obuffer[sizeof(testdata)];
+        } catch (...) {
+            // Prevent exceptions killing the application, we need
+            // to make sure it dies the real hard way
+        }
+        }, "");
+#endif
 }
 
 TEST_F(BufferTest, outputBufferClear) {