Browse Source

[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.
JINMEI Tatuya 13 years ago
parent
commit
c7da3e0c3a
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/lib/log/tests/message_dictionary_unittest.cc

+ 6 - 5
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: