]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1698-test] Address issues raised by re-review
authorStephen Morris <stephen@isc.org>
Mon, 12 Mar 2012 11:52:43 +0000 (11:52 +0000)
committerStephen Morris <stephen@isc.org>
Mon, 12 Mar 2012 11:52:43 +0000 (11:52 +0000)
1. Enclose death tests within suitable #ifdef for systems that don't
   support them.
2. Minor comment changes.

src/lib/log/message_initializer.h
src/lib/log/tests/logger_unittest.cc
src/lib/log/tests/message_initializer_1_unittest.cc
src/lib/log/tests/message_initializer_1a_unittest.cc
src/lib/log/tests/message_initializer_2_unittest.cc

index 8fab9f69fcef531f5b78a7b1ba1a30ce1fd9650c..28b0e6163bf319fe3b5d73970de0c3fa1642d8cb 100644 (file)
@@ -81,9 +81,8 @@ public:
 
     /// \brief Obtain pending load count
     ///
-    /// Returns a count of the message of message arrays that have been
-    /// registered with this class and will be loaded with the next call
-    /// to loadDictionary().
+    /// Returns the number of message arrays that will be loaded by the next
+    /// call to loadDictionary().
     ///
     /// \return Number of registered message arrays.  This is reset to zero
     ///         when loadDictionary() is called.
index 64158b5a81f63ddd8ef4e87cfd259b3c5431f2ca..d60bcb075a20b789072db7f5f1ff4b7d417cf274 100644 (file)
@@ -363,12 +363,15 @@ TEST_F(LoggerTest, LoggerNameLength) {
     Logger l2(ok2.c_str());
     EXPECT_EQ(getRootLoggerName() + "." + ok2, l2.getName());
 
+    // Note: Not all systems have EXPECT_DEATH.  As it is a macro we can just
+    // test for its presence and bypass the test if not available.
+#ifdef EXPECT_DEATH
     // Too long a logger name should trigger an assertion failure.
     // Note that we just check that it dies - we don't check what message is
     // output.
-    ASSERT_DEATH({
+    EXPECT_DEATH({
                     string ok3(Logger::MAX_LOGGER_NAME_SIZE + 1, 'x');
                     Logger l3(ok3.c_str());
                  }, ".*");
-
+#endif
 }
index 62d6f85dcd81936f6822c1e3d7d1dbbe7af250a0..994174ced17ec93c32dd53715aace83900a4e4f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include <string>
-#include <gtest/gtest.h>
-#include <boost/lexical_cast.hpp>
 #include <log/message_dictionary.h>
 #include <log/message_initializer.h>
+#include <boost/lexical_cast.hpp>
+#include <gtest/gtest.h>
+#include <string>
 
 using namespace isc;
 using namespace isc::log;
index ff8e060512884614ef38e74f129795f75d591a26..3360167460cbfc52cc0292d5d7e13ab690a96b9e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
index 8f46a911ab62e728626a6abcd023fb27cd5e18bc..ca34b36ef9bdec68be56360a15d817688ac32c74 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -12,8 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#include <gtest/gtest.h>
 #include <log/message_initializer.h>
+#include <gtest/gtest.h>
 
 using namespace isc::log;
 
@@ -37,8 +37,12 @@ TEST(MessageInitializerTest2, MessageLoadTest) {
         MessageInitializer initializer1(values);
     }
 
+    // Note: Not all systems have EXPECT_DEATH.  As it is a macro we can just
+    // test for its presence and bypass the test if not available.
+#ifdef EXPECT_DEATH
     // Adding one more should take us over the limit.
-    ASSERT_DEATH({
+    EXPECT_DEATH({
         MessageInitializer initializer2(values);
         }, ".*");
+#endif
 }