BIND 10 trac1698-test, updated. 292fc936f6bfbcf84e56e67b52a16368a726d32f [1698-test] Address issues raised by re-review

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Mar 12 11:55:23 UTC 2012


The branch, trac1698-test has been updated
       via  292fc936f6bfbcf84e56e67b52a16368a726d32f (commit)
      from  4bb8254e151217f9ac5c29743d57b239c8f11d1c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 292fc936f6bfbcf84e56e67b52a16368a726d32f
Author: Stephen Morris <stephen at isc.org>
Date:   Mon Mar 12 11:52:43 2012 +0000

    [1698-test] Address issues raised by re-review
    
    1. Enclose death tests within suitable #ifdef for systems that don't
       support them.
    2. Minor comment changes.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/log/message_initializer.h                  |    5 ++---
 src/lib/log/tests/logger_unittest.cc               |    7 +++++--
 .../log/tests/message_initializer_1_unittest.cc    |    8 ++++----
 .../log/tests/message_initializer_1a_unittest.cc   |    2 +-
 .../log/tests/message_initializer_2_unittest.cc    |   10 +++++++---
 5 files changed, 19 insertions(+), 13 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/log/message_initializer.h b/src/lib/log/message_initializer.h
index 8fab9f6..28b0e61 100644
--- a/src/lib/log/message_initializer.h
+++ b/src/lib/log/message_initializer.h
@@ -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.
diff --git a/src/lib/log/tests/logger_unittest.cc b/src/lib/log/tests/logger_unittest.cc
index 64158b5..d60bcb0 100644
--- a/src/lib/log/tests/logger_unittest.cc
+++ b/src/lib/log/tests/logger_unittest.cc
@@ -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
 }
diff --git a/src/lib/log/tests/message_initializer_1_unittest.cc b/src/lib/log/tests/message_initializer_1_unittest.cc
index 62d6f85..994174c 100644
--- a/src/lib/log/tests/message_initializer_1_unittest.cc
+++ b/src/lib/log/tests/message_initializer_1_unittest.cc
@@ -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,11 +12,11 @@
 // 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;
diff --git a/src/lib/log/tests/message_initializer_1a_unittest.cc b/src/lib/log/tests/message_initializer_1a_unittest.cc
index ff8e060..3360167 100644
--- a/src/lib/log/tests/message_initializer_1a_unittest.cc
+++ b/src/lib/log/tests/message_initializer_1a_unittest.cc
@@ -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
diff --git a/src/lib/log/tests/message_initializer_2_unittest.cc b/src/lib/log/tests/message_initializer_2_unittest.cc
index 8f46a91..ca34b36 100644
--- a/src/lib/log/tests/message_initializer_2_unittest.cc
+++ b/src/lib/log/tests/message_initializer_2_unittest.cc
@@ -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
 }



More information about the bind10-changes mailing list