Browse Source

[3534] Reset unit test logger in the Daemon.parsingConsoleOutput test.

Marcin Siodelski 10 years ago
parent
commit
c962fd5403
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/lib/dhcpsrv/tests/daemon_unittest.cc

+ 6 - 0
src/lib/dhcpsrv/tests/daemon_unittest.cc

@@ -16,6 +16,7 @@
 #include <exceptions/exceptions.h>
 #include <dhcpsrv/daemon.h>
 #include <dhcpsrv/logging.h>
+#include <log/logger_unittest_support.h>
 #include <cc/data.h>
 #include <gtest/gtest.h>
 
@@ -71,6 +72,11 @@ TEST(DaemonTest, parsingConsoleOutput) {
     Daemon x;
     EXPECT_NO_THROW(x.configureLogger(config, storage, false));
 
+    // configureLogger will modify the logging options of the log4cplus logger.
+    // We need to reset the logger settings so as the following tests are
+    // not affected by this modification.
+    isc::log::resetUnitTestRootLogger();
+
     // The parsed configuration should be processed by the daemon and
     // stored in configuration storage.
     ASSERT_EQ(1, storage->getLoggingInfo().size());