Browse Source

[3752] Fixed flush and .spec stuff

Francis Dupont 10 years ago
parent
commit
50570f6baa
2 changed files with 11 additions and 12 deletions
  1. 1 1
      src/lib/dhcpsrv/logging_info.cc
  2. 10 11
      src/lib/dhcpsrv/tests/logging_unittest.cc

+ 1 - 1
src/lib/dhcpsrv/logging_info.cc

@@ -136,7 +136,7 @@ LoggingInfo::toSpec() const {
         }
 
         // Copy the immediate flush flag
-        option.flush = flush_;
+        option.flush = dest->flush_;
 
         // ... and set the destination
         spec.addOutputOption(option);

+ 10 - 11
src/lib/dhcpsrv/tests/logging_unittest.cc

@@ -15,6 +15,7 @@
 #include <config.h>
 #include <exceptions/exceptions.h>
 #include <cc/data.h>
+#include <config/module_spec.h>
 #include <dhcpsrv/logging.h>
 #include <gtest/gtest.h>
 #include <log/logger_support.h>
@@ -25,17 +26,6 @@ using namespace isc::data;
 
 namespace {
 
-// Helper to get the spec file
-std::string specfile(const std::string& name) {
-    return (std::string(TEST_DATA_BUILDDIR) + "/../" + name);
-}
-
-// Tests that the spec file is valid.
-TEST(LoggingTest, basicSpec) {
-    using namespace isc::config;
-    ASSERT_NO_THROW(moduleSpecFromFile(specfile("logging.spec")));
-}
-
 /// @brief Logging Test Fixture Class
 ///
 /// Trivial class that ensures that the logging is reset to its defaults after
@@ -56,6 +46,15 @@ class LoggingTest : public ::testing::Test {
         }
 };
 
+// Helper to get the spec file
+std::string specfile(const std::string& name) {
+    return (std::string(TEST_DATA_BUILDDIR) + "/../" + name);
+}
+
+// Tests that the spec file is valid.
+TEST_F(LoggingTest, basicSpec) {
+    ASSERT_NO_THROW(isc::config::moduleSpecFromFile(specfile("logging.spec")));
+}
 
 // Checks that contructor is able to process specified storage properly
 TEST_F(LoggingTest, constructor) {