Browse Source

[2746] Clear duplicated vector at global initialization

Jelte Jansen 12 years ago
parent
commit
c1233a28b0
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/lib/log/logger_manager.cc
  2. 2 2
      src/lib/log/tests/message_dictionary_unittest.cc

+ 1 - 1
src/lib/log/logger_manager.cc

@@ -133,7 +133,7 @@ LoggerManager::init(const std::string& root, isc::log::Severity severity,
              i != duplicates.end(); ++i) {
             LOG_WARN(logger, LOG_DUPLICATE_MESSAGE_ID).arg(*i);
         }
-
+        MessageInitializer::clearDuplicates();
     }
 
     // Replace any messages with local ones (if given)

+ 2 - 2
src/lib/log/tests/message_dictionary_unittest.cc

@@ -189,9 +189,9 @@ TEST_F(MessageDictionaryTest, GlobalTest) {
 // new symbol.
 
 TEST_F(MessageDictionaryTest, GlobalLoadTest) {
+    // There were duplicates but the vector should be cleared in init() now
     vector<string>& duplicates = MessageInitializer::getDuplicates();
-    ASSERT_EQ(1, duplicates.size());
-    EXPECT_EQ(string("LOG_DUPLICATE_NAMESPACE"), duplicates[0]);
+    ASSERT_EQ(0, duplicates.size());
 
     string text = MessageDictionary::globalDictionary().getText("NEWSYM");
     EXPECT_EQ(string("new symbol added"), text);