From: Stephen Morris Date: Mon, 12 Mar 2012 11:52:43 +0000 (+0000) Subject: [1698-test] Address issues raised by re-review X-Git-Tag: trac2351_base~226^2~116^2~127^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=292fc936f6bfbcf84e56e67b52a16368a726d32f;p=thirdparty%2Fkea.git [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. --- diff --git a/src/lib/log/message_initializer.h b/src/lib/log/message_initializer.h index 8fab9f69fc..28b0e6163b 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 64158b5a81..d60bcb075a 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 62d6f85dcd..994174ced1 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 -#include -#include #include #include +#include +#include +#include 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 ff8e060512..3360167460 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 8f46a911ab..ca34b36ef9 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 #include +#include 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 }