Browse Source

[5076] decommentJSONFile moved to isc::test

Tomek Mrugalski 8 years ago
parent
commit
2c9ba565e1

+ 1 - 0
src/bin/agent/tests/parser_unittests.cc

@@ -11,6 +11,7 @@
 #include <testutils/io_utils.h>
 
 using namespace isc::data;
+using namespace isc::test;
 using namespace std;
 
 namespace isc {

+ 1 - 0
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc

@@ -42,6 +42,7 @@ using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::hooks;
 using namespace isc::stats;
+using namespace isc::test;
 
 namespace {
 

+ 1 - 0
src/bin/dhcp4/tests/parser_unittest.cc

@@ -10,6 +10,7 @@
 #include <testutils/io_utils.h>
 
 using namespace isc::data;
+using namespace isc::test;
 using namespace std;
 
 namespace isc {

+ 1 - 0
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc

@@ -39,6 +39,7 @@ using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::hooks;
 using namespace isc::stats;
+using namespace isc::test;
 
 namespace {
 

+ 1 - 0
src/bin/dhcp6/tests/parser_unittest.cc

@@ -11,6 +11,7 @@
 
 using namespace isc::data;
 using namespace std;
+using namespace isc::test;
 
 namespace isc {
 namespace dhcp {

+ 1 - 1
src/lib/dhcp/tests/duid_factory_unittest.cc

@@ -180,7 +180,7 @@ DUIDFactoryTest::removeDefaultFile() const {
 
 std::string
 DUIDFactoryTest::readDefaultFile() const {
-    return (dhcp::test::readFile(absolutePath(DEFAULT_DUID_FILE)));
+    return (isc::test::readFile(absolutePath(DEFAULT_DUID_FILE)));
 }
 
 std::vector<uint8_t>

+ 4 - 4
src/lib/dhcpsrv/tests/cfg_duid_unittest.cc

@@ -165,7 +165,7 @@ TEST_F(CfgDUIDTest, createLLT) {
               duid->toText());
 
     // Verify that the DUID file has been created.
-    EXPECT_TRUE(dhcp::test::fileExists(absolutePath(DUID_FILE_NAME)));
+    EXPECT_TRUE(isc::test::fileExists(absolutePath(DUID_FILE_NAME)));
 }
 
 // This method checks that the DUID-EN can be created from the
@@ -185,7 +185,7 @@ TEST_F(CfgDUIDTest, createEN) {
     EXPECT_EQ("00:02:00:00:10:10:25:0f:3e:26:a7:62", duid->toText());
 
     // Verify that the DUID file has been created.
-    EXPECT_TRUE(dhcp::test::fileExists(absolutePath(DUID_FILE_NAME)));
+    EXPECT_TRUE(isc::test::fileExists(absolutePath(DUID_FILE_NAME)));
 }
 
 // This method checks that the DUID-LL can be created from the
@@ -205,7 +205,7 @@ TEST_F(CfgDUIDTest, createLL) {
     EXPECT_EQ("00:03:00:02:12:41:34:a4:b3:67", duid->toText());
 
     // Verify that the DUID file has been created.
-    EXPECT_TRUE(dhcp::test::fileExists(absolutePath(DUID_FILE_NAME)));
+    EXPECT_TRUE(isc::test::fileExists(absolutePath(DUID_FILE_NAME)));
 }
 
 // This test verifies that it is possible to disable storing
@@ -226,7 +226,7 @@ TEST_F(CfgDUIDTest, createDisableWrite) {
     EXPECT_EQ("00:02:00:00:10:10:25:0f:3e:26:a7:62", duid->toText());
 
     // DUID persistence is disabled so there should be no DUID file.
-    EXPECT_FALSE(dhcp::test::fileExists(absolutePath(DUID_FILE_NAME)));
+    EXPECT_FALSE(isc::test::fileExists(absolutePath(DUID_FILE_NAME)));
 }
 
 } // end of anonymous namespace

+ 1 - 3
src/lib/testutils/io_utils.cc

@@ -12,7 +12,6 @@
 #include <string>
 
 namespace isc {
-namespace dhcp {
 namespace test {
 
 bool fileExists(const std::string& file_path) {
@@ -109,6 +108,5 @@ std::string decommentJSONfile(const std::string& input_file) {
     return (outfile);
 }
 
-}; // end of isc::dhcp::test namespace
-}; // end of isc::dhcp namespace
+}; // end of isc::test namespace
 }; // end of isc namespace

+ 1 - 3
src/lib/testutils/io_utils.h

@@ -11,7 +11,6 @@
 #include <sys/stat.h>
 
 namespace isc {
-namespace dhcp {
 namespace test {
 
 /// @brief Checks if specified file exists.
@@ -40,8 +39,7 @@ std::string readFile(const std::string& file_path);
 /// @throw BadValue if the input file cannot be opened
 std::string decommentJSONfile(const std::string& input_file);
 
-}; // end of isc::dhcp::test namespace
-}; // end of isc::dhcp namespace
+}; // end of isc::test namespace
 }; // end of isc namespace
 
 #endif // TEST_IO_UTILS_H