From 5feb6b8a53675c27715e9e8fbeb312bd6eb17547 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Fri, 31 Aug 2018 20:21:15 +0200 Subject: [PATCH] [#92,!13] Fully qualified namespaces in dora and host_mgr unittests. --- src/bin/dhcp4/tests/dora_unittest.cc | 18 +++++------ src/lib/dhcpsrv/tests/host_mgr_unittest.cc | 36 +++++++++++----------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/bin/dhcp4/tests/dora_unittest.cc b/src/bin/dhcp4/tests/dora_unittest.cc index 6a030a2e18..b72d9763f1 100644 --- a/src/bin/dhcp4/tests/dora_unittest.cc +++ b/src/bin/dhcp4/tests/dora_unittest.cc @@ -1964,15 +1964,15 @@ public: /// /// Recreates MySQL schema for a test. DORAMySQLTest() : DORATest() { - destroyMySQLSchema(); - createMySQLSchema(); + db::test::destroyMySQLSchema(); + db::test::createMySQLSchema(); } /// @brief Destructor. /// /// Destroys MySQL schema. virtual ~DORAMySQLTest() { - destroyMySQLSchema(); + db::test::destroyMySQLSchema(); } }; @@ -1997,15 +1997,15 @@ public: /// /// Recreates PgSQL schema for a test. DORAPgSQLTest() : DORATest() { - destroyPgSQLSchema(); - createPgSQLSchema(); + db::test::destroyPgSQLSchema(); + db::test::createPgSQLSchema(); } /// @brief Destructor. /// /// Destroys PgSQL schema. virtual ~DORAPgSQLTest() { - destroyPgSQLSchema(); + db::test::destroyPgSQLSchema(); } }; @@ -2029,15 +2029,15 @@ public: /// /// Recreates CQL schema for a test. DORACQLTest() : DORATest() { - destroyCqlSchema(false, true); - createCqlSchema(false, true); + db::test::destroyCqlSchema(false, true); + db::test::createCqlSchema(false, true); } /// @brief Destructor. /// /// Destroys CQL schema. virtual ~DORACQLTest() { - destroyCqlSchema(false, true); + db::test::destroyCqlSchema(false, true); } }; diff --git a/src/lib/dhcpsrv/tests/host_mgr_unittest.cc b/src/lib/dhcpsrv/tests/host_mgr_unittest.cc index de50132bd1..bac9a6711c 100644 --- a/src/lib/dhcpsrv/tests/host_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/host_mgr_unittest.cc @@ -668,12 +668,12 @@ MySQLHostMgrTest::SetUp() { HostMgrTest::SetUp(); // Ensure schema is the correct one. - destroyMySQLSchema(); - createMySQLSchema(); + db::test::destroyMySQLSchema(); + db::test::createMySQLSchema(); // Connect to the database try { - HostMgr::addBackend(validMySQLConnectionString()); + HostMgr::addBackend(db::test::validMySQLConnectionString()); } catch (...) { std::cerr << "*** ERROR: unable to open database. The test\n" "*** environment is broken and must be fixed before\n" @@ -688,7 +688,7 @@ void MySQLHostMgrTest::TearDown() { HostMgr::instance().getHostDataSource()->rollback(); HostMgr::delBackend("mysql"); - destroyMySQLSchema(); + db::test::destroyMySQLSchema(); } /// @brief Test fixture class for validating @c HostMgr using @@ -696,15 +696,15 @@ MySQLHostMgrTest::TearDown() { class MySQLHostMgrDbLostCallbackTest : public HostMgrDbLostCallbackTest { public: virtual void destroySchema() { - destroyMySQLSchema(); + db::test::destroyMySQLSchema(); } virtual void createSchema() { - createMySQLSchema(); + db::test::createMySQLSchema(); } virtual std::string validConnectString() { - return (validMySQLConnectionString()); + return (db::test::validMySQLConnectionString()); } }; @@ -765,12 +765,12 @@ PostgreSQLHostMgrTest::SetUp() { HostMgrTest::SetUp(); // Ensure schema is the correct one. - destroyPgSQLSchema(); - createPgSQLSchema(); + db::test::destroyPgSQLSchema(); + db::test::createPgSQLSchema(); // Connect to the database try { - HostMgr::addBackend(validPgSQLConnectionString()); + HostMgr::addBackend(db::test::validPgSQLConnectionString()); } catch (...) { std::cerr << "*** ERROR: unable to open database. The test\n" "*** environment is broken and must be fixed before\n" @@ -785,7 +785,7 @@ void PostgreSQLHostMgrTest::TearDown() { HostMgr::instance().getHostDataSource()->rollback(); HostMgr::delBackend("postgresql"); - destroyPgSQLSchema(); + db::test::destroyPgSQLSchema(); } /// @brief Test fixture class for validating @c HostMgr using @@ -793,15 +793,15 @@ PostgreSQLHostMgrTest::TearDown() { class PostgreSQLHostMgrDbLostCallbackTest : public HostMgrDbLostCallbackTest { public: virtual void destroySchema() { - destroyPgSQLSchema(); + db::test::destroyPgSQLSchema(); } virtual void createSchema() { - createPgSQLSchema(); + db::test::createPgSQLSchema(); } virtual std::string validConnectString() { - return (validPgSQLConnectionString()); + return (db::test::validPgSQLConnectionString()); } }; @@ -860,12 +860,12 @@ CQLHostMgrTest::SetUp() { HostMgrTest::SetUp(); // Ensure schema is the correct one. - destroyCqlSchema(false, true); - createCqlSchema(false, true); + db::test::destroyCqlSchema(false, true); + db::test::createCqlSchema(false, true); // Connect to the database try { - HostMgr::addBackend(validCqlConnectionString()); + HostMgr::addBackend(db::test::validCqlConnectionString()); } catch (...) { std::cerr << "*** ERROR: unable to open database. The test\n" "*** environment is broken and must be fixed before\n" @@ -880,7 +880,7 @@ void CQLHostMgrTest::TearDown() { HostMgr::instance().getHostDataSource()->rollback(); HostMgr::delBackend("cql"); - destroyCqlSchema(false, true); + db::test::destroyCqlSchema(false, true); } // This test verifies that reservations for a particular client can -- 2.47.2