From: JINMEI Tatuya Date: Thu, 14 Jun 2012 04:08:26 +0000 (-0700) Subject: [master] make the intentional dup'ed log messages for test consistent. X-Git-Tag: trac2351_base~97^2~9^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7da3e0c3ab187eb6f4293eea34f65deef0cd249;p=thirdparty%2Fkea.git [master] make the intentional dup'ed log messages for test consistent. otherwise it might cause failure with --enable-logger-checks, depending on which one is initialized first (which is ultimately enviornment dependent). should be obvious, and also okayed on jabber. made one piggyback cleanup: use an unnamed namespace instead of file-scope static, and hid the initializer there, too. --- diff --git a/src/lib/log/tests/message_dictionary_unittest.cc b/src/lib/log/tests/message_dictionary_unittest.cc index 394fea0a73..b8bded364c 100644 --- a/src/lib/log/tests/message_dictionary_unittest.cc +++ b/src/lib/log/tests/message_dictionary_unittest.cc @@ -28,16 +28,17 @@ using namespace std; // global dictionary is loaded, the former should be marked as a duplicate // and the latter should be present. -static const char* values[] = { - "LOG_DUPLICATE_NAMESPACE", "duplicate $NAMESPACE directive found", +namespace { +const char* values[] = { + // This message for DUPLICATE_NAMESPACE must be copied from + // ../log_messages.mes; otherwise logger check might fail. + "LOG_DUPLICATE_NAMESPACE", "line %1: duplicate $NAMESPACE directive found", "NEWSYM", "new symbol added", NULL }; MessageInitializer init(values); - - - +} class MessageDictionaryTest : public ::testing::Test { protected: