Browse Source

[3615] Restore default logging config for the tests which alter it.

Marcin Siodelski 10 years ago
parent
commit
a1e376727c

+ 0 - 3
src/bin/d2/tests/bundy_d2_controller_unittests.cc

@@ -48,9 +48,6 @@ public:
     BundyD2ControllerTest() : DControllerTest(D2Controller::instance) {
     }
 
-    /// @brief Destructor
-    ~BundyD2ControllerTest() {
-    }
 };
 
 /// @brief Basic Controller instantiation testing.

+ 0 - 4
src/bin/d2/tests/d2_controller_unittests.cc

@@ -49,10 +49,6 @@ public:
     D2ControllerTest() : DControllerTest(D2Controller::instance) {
     }
 
-    /// @brief Destructor
-    ~D2ControllerTest() {
-    }
-
     /// @brief Fetches the D2Controller's D2Process
     ///
     /// @return A pointer to the process which may be null if it has not yet

+ 0 - 3
src/bin/d2/tests/d_controller_unittests.cc

@@ -41,9 +41,6 @@ public:
                                                   getController());
     }
 
-    virtual ~DStubControllerTest() {
-    }
-
     DStubControllerPtr controller_;
 };
 

+ 7 - 0
src/bin/d2/tests/d_test_stubs.h

@@ -23,6 +23,8 @@
 #include <d2/d_controller.h>
 #include <d2/d_cfg_mgr.h>
 
+#include <log/logger_support.h>
+
 #include <boost/date_time/posix_time/posix_time.hpp>
 
 using namespace boost::posix_time;
@@ -346,6 +348,11 @@ public:
     /// Note the controller singleton is destroyed. This is essential to ensure
     /// a clean start between tests.
     virtual ~DControllerTest() {
+        // Some unit tests update the logging configuration which has a side
+        // effect that all subsequent tests print the output to stdout. This
+        // is to ensure that the logging settings are back to default.
+        isc::log::setDefaultLoggingOutput();
+
         if (write_timer_) {
             write_timer_->cancel();
         }