From: Tomek Mrugalski Date: Tue, 7 Feb 2017 12:29:04 +0000 (+0100) Subject: [5076] decommentJSONFile moved to isc::test X-Git-Tag: trac3590_base~3^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2c9ba565e161a51b0281f2aa5920cbada0e315a3;p=thirdparty%2Fkea.git [5076] decommentJSONFile moved to isc::test --- diff --git a/src/bin/agent/tests/parser_unittests.cc b/src/bin/agent/tests/parser_unittests.cc index d7dee07b5e..4b61d18149 100644 --- a/src/bin/agent/tests/parser_unittests.cc +++ b/src/bin/agent/tests/parser_unittests.cc @@ -11,6 +11,7 @@ #include using namespace isc::data; +using namespace isc::test; using namespace std; namespace isc { diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc index e9078c4fa9..6da5d1c825 100644 --- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc +++ b/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 { diff --git a/src/bin/dhcp4/tests/parser_unittest.cc b/src/bin/dhcp4/tests/parser_unittest.cc index 6b37b4fbc9..bfb69c1c74 100644 --- a/src/bin/dhcp4/tests/parser_unittest.cc +++ b/src/bin/dhcp4/tests/parser_unittest.cc @@ -10,6 +10,7 @@ #include using namespace isc::data; +using namespace isc::test; using namespace std; namespace isc { diff --git a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc index 202380b083..addc1ab8d8 100644 --- a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc +++ b/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 { diff --git a/src/bin/dhcp6/tests/parser_unittest.cc b/src/bin/dhcp6/tests/parser_unittest.cc index d0262225c9..16895d0d55 100644 --- a/src/bin/dhcp6/tests/parser_unittest.cc +++ b/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 { diff --git a/src/lib/dhcp/tests/duid_factory_unittest.cc b/src/lib/dhcp/tests/duid_factory_unittest.cc index 87fcf92501..c7e115bfe2 100644 --- a/src/lib/dhcp/tests/duid_factory_unittest.cc +++ b/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 diff --git a/src/lib/dhcpsrv/tests/cfg_duid_unittest.cc b/src/lib/dhcpsrv/tests/cfg_duid_unittest.cc index cb83b097f0..1d7699383d 100644 --- a/src/lib/dhcpsrv/tests/cfg_duid_unittest.cc +++ b/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 diff --git a/src/lib/testutils/io_utils.cc b/src/lib/testutils/io_utils.cc index 25b1458856..5e0e3554d7 100644 --- a/src/lib/testutils/io_utils.cc +++ b/src/lib/testutils/io_utils.cc @@ -12,7 +12,6 @@ #include 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 diff --git a/src/lib/testutils/io_utils.h b/src/lib/testutils/io_utils.h index 1aa15570a4..ce4b57ccf2 100644 --- a/src/lib/testutils/io_utils.h +++ b/src/lib/testutils/io_utils.h @@ -11,7 +11,6 @@ #include 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