]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3536] remove Initializer
authorRazvan Becheriu <razvan@isc.org>
Wed, 18 Sep 2024 05:13:44 +0000 (08:13 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 3 Oct 2024 18:04:37 +0000 (21:04 +0300)
22 files changed:
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/decline_unittest.cc
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/dora_unittest.cc
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/decline_unittest.cc
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc
src/hooks/dhcp/mysql_hb/tests/mysql_host_data_source_unittest.cc
src/hooks/dhcp/mysql_lb/tests/mysql_bootp_unittest.cc
src/hooks/dhcp/mysql_lb/tests/mysql_lease_extended_info_unittest.cc
src/hooks/dhcp/mysql_lb/tests/mysql_lease_mgr_unittest.cc
src/hooks/dhcp/pgsql_hb/tests/pgsql_host_data_source_unittest.cc
src/hooks/dhcp/pgsql_lb/tests/pgsql_bootp_unittest.cc
src/hooks/dhcp/pgsql_lb/tests/pgsql_lease_extended_info_unittest.cc
src/hooks/dhcp/pgsql_lb/tests/pgsql_lease_mgr_unittest.cc
src/lib/database/database_connection.h
src/lib/dhcpsrv/host_data_source_factory.cc
src/lib/dhcpsrv/lease_mgr_factory.cc
src/lib/dhcpsrv/tests/host_data_source_factory_unittest.cc
src/lib/dhcpsrv/tests/lease_mgr_factory_unittest.cc

index 513c15a6edbbf590a45e9934049672924dd033f9..987cdc56ecf9dffd338b87814450dc77332eb0f9 100644 (file)
@@ -5020,7 +5020,7 @@ Dhcpv4Srv::getVersion(bool extended) {
         tmp << "lease backends:" << endl;
         tmp << LeaseMgrFactory::getDBVersions() << endl;
         tmp << "host backends:" << endl;
-        tmp << HostDataSourceFactory::getDBVersions() << endl;
+        tmp << HostDataSourceFactory::getDBVersions();
         // @todo: more details about database runtime
     }
 
index b21779635493dcf2963d470515474a0fc0f8d7d5..53f8db19b366e98b58da4c61a9146a28b3bd9f3e 100644 (file)
@@ -8,7 +8,6 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
-#include <database/database_connection.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/testutils/iface_mgr_test_config.h>
 #include <dhcpsrv/cfgmgr.h>
@@ -270,7 +269,7 @@ TEST_F(DeclineTest, declineNoIdentifierChangeMemfile) {
 #ifdef HAVE_MYSQL
 // This test checks that the client can acquire and decline the lease.
 TEST_F(DeclineTest, declineNoIdentifierChangeMySQL) {
-    Initializer<MySqlLeaseMgrInit> init;
+    MySqlLeaseMgrInit init;
     Dhcp4Client client(Dhcp4Client::SELECTING);
     acquireAndDecline(client, "01:02:03:04:05:06", "12:14",
                       "01:02:03:04:05:06", "12:14",
@@ -281,7 +280,7 @@ TEST_F(DeclineTest, declineNoIdentifierChangeMySQL) {
 #ifdef HAVE_PGSQL
 // This test checks that the client can acquire and decline the lease.
 TEST_F(DeclineTest, declineNoIdentifierChangePgSQL) {
-    Initializer<PgSqlLeaseMgrInit> init;
+    PgSqlLeaseMgrInit init;
     Dhcp4Client client(Dhcp4Client::SELECTING);
     acquireAndDecline(client, "01:02:03:04:05:06", "12:14",
                       "01:02:03:04:05:06", "12:14",
index 2a2c2b111e05f4e657ab2cbd80f3001b4ce7501f..226a2a19a5496876b3d84c585bf6912a8a6fed09 100644 (file)
@@ -3011,10 +3011,10 @@ class DBInitializer {
 void
 Dhcpv4SrvTest::checkConfigFiles() {
 #if defined (HAVE_MYSQL)
-    Initializer<MySqlHostDataSourceInit> mysql_init;
+    MySqlHostDataSourceInit mysql_init;
 #endif
 #if defined (HAVE_PGSQL)
-    Initializer<PgSqlHostDataSourceInit> pgsql_init;
+    PgSqlHostDataSourceInit pgsql_init;
 #endif
     DBInitializer dbi;
     IfaceMgrTestConfig test_config(true);
index de57629bddb774b758624e6ef3c11df0c8d3f812..3b592b15c046185a7496697f315afbc56152df89 100644 (file)
@@ -7,7 +7,6 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
-#include <database/database_connection.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/testutils/iface_mgr_test_config.h>
 #include <dhcpsrv/cfgmgr.h>
@@ -3348,7 +3347,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 // Test that the client using the same hardware address but multiple
@@ -3394,7 +3393,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 // Test that the client using the same hardware address but multiple
index d2af15e91faa77ce318b656991dbf997190c6af4..97d003404d01581fc385a0a235cea5abc12bbc22 100644 (file)
@@ -10,7 +10,6 @@
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
 #include <cc/command_interpreter.h>
-#include <database/database_connection.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/hwaddr.h>
 #include <dhcp/iface_mgr.h>
@@ -1005,7 +1004,7 @@ public:
                                     const std::string& backend_second);
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 std::string
index 717506762c62c12dc9164ffe43db5782534cfe1d..f2bcbce1e5402b1da28fd204d265a65fd7e7f91b 100644 (file)
@@ -4697,7 +4697,7 @@ Dhcpv6Srv::getVersion(bool extended) {
         tmp << "lease backends:" << endl;
         tmp << LeaseMgrFactory::getDBVersions() << endl;
         tmp << "host backends:" << endl;
-        tmp << HostDataSourceFactory::getDBVersions() << endl;
+        tmp << HostDataSourceFactory::getDBVersions();
         // @todo: more details about database runtime
     }
 
index 8eb8eb4601b58390e93abab7edae4577fd08af28..4fcd99f4bef43f213ea90812c920438e6c87c0d0 100644 (file)
@@ -7,7 +7,6 @@
 #include <config.h>
 #include <asiolink/io_address.h>
 #include <cc/data.h>
-#include <database/database_connection.h>
 #include <dhcp/testutils/iface_mgr_test_config.h>
 #include <dhcp6/json_config_parser.h>
 #include <dhcp6/tests/dhcp6_message_test.h>
@@ -267,7 +266,7 @@ TEST_F(DeclineTest, basicMemfile) {
 #ifdef HAVE_MYSQL
 // This test checks that the client can acquire and decline the lease.
 TEST_F(DeclineTest, basicMySQL) {
-    Initializer<MySqlLeaseMgrInit> init;
+    MySqlLeaseMgrInit init;
     Dhcp6Client client;
     acquireAndDecline(client, "01:02:03:04:05:06", 1234, "01:02:03:04:05:06",
                       1234, VALID_ADDR, SHOULD_PASS, 1);
@@ -276,7 +275,7 @@ TEST_F(DeclineTest, basicMySQL) {
 
 #ifdef HAVE_PGSQL
 TEST_F(DeclineTest, basicPgSQL) {
-    Initializer<PgSqlLeaseMgrInit> init;
+    PgSqlLeaseMgrInit init;
     Dhcp6Client client;
     acquireAndDecline(client, "01:02:03:04:05:06", 1234, "01:02:03:04:05:06",
                       1234, VALID_ADDR, SHOULD_PASS, 2);
index fc7fb7c1da2871ee927d8f1204afc6e15e740903..dbb7965ef17a212aad50925c55ed01b57e97a67a 100644 (file)
@@ -375,10 +375,10 @@ class DBInitializer {
 void
 Dhcpv6SrvTest::checkConfigFiles() {
 #if defined (HAVE_MYSQL)
-    Initializer<MySqlHostDataSourceInit> mysql_init;
+    MySqlHostDataSourceInit mysql_init;
 #endif
 #if defined (HAVE_PGSQL)
-    Initializer<PgSqlHostDataSourceInit> pgsql_init;
+    PgSqlHostDataSourceInit pgsql_init;
 #endif
     DBInitializer dbi;
     IfaceMgrTestConfig test_config(true);
index 47281a44568f43b545c7670ac441e85ee155321d..b282c5e7e0eafc3d28bb4a445ca33edf0427d7f1 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <asiolink/io_address.h>
 #include <cc/command_interpreter.h>
-#include <database/database_connection.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/duid.h>
 #include <dhcp/iface_mgr.h>
@@ -991,8 +990,7 @@ public:
                                     const std::string& backend_second);
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
-
+    MySqlLeaseMgrInit init_;
 };
 
 std::string
index 664e8fd4596e1a8c485b686a76b2e3d550e1791b..5a7f938700a7803b5fd3a065e409d2be8d8bd0ee 100644 (file)
@@ -154,7 +154,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlHostDataSourceInit> init_;
+    MySqlHostDataSourceInit init_;
 };
 
 /// @brief Check that database can be opened
@@ -164,7 +164,7 @@ public:
 /// MySqlHostMgr test fixture set.  This test checks that the database can be
 /// opened: the fixtures assume that and check basic operations.
 TEST(MySqlHostDataSource, OpenDatabase) {
-    Initializer<MySqlHostDataSourceInit> init;
+    MySqlHostDataSourceInit init;
     // Schema needs to be created for the test to work.
     destroyMySQLSchema();
     createMySQLSchema();
@@ -253,7 +253,7 @@ TEST(MySqlHostDataSource, OpenDatabase) {
 /// MySqlHostMgr test fixture set.  This test checks that the database can be
 /// opened: the fixtures assume that and check basic operations.
 TEST(MySqlHostDataSource, OpenDatabaseMultiThreading) {
-    Initializer<MySqlHostDataSourceInit> init;
+    MySqlHostDataSourceInit init;
     // Enable Multi-Threading.
     MultiThreadingTest mt(true);
 
@@ -355,7 +355,7 @@ bool db_lost_callback(ReconnectCtlPtr /* db_conn_retry */) {
 /// in a unit test is next to impossible. That has to be done
 /// as a system test.
 TEST(MySqlHostDataSource, NoCallbackOnOpenFail) {
-    Initializer<MySqlHostDataSourceInit> init;
+    MySqlHostDataSourceInit init;
     // Schema needs to be created for the test to work.
     destroyMySQLSchema();
     createMySQLSchema();
@@ -380,7 +380,7 @@ TEST(MySqlHostDataSource, NoCallbackOnOpenFail) {
 /// in a unit test is next to impossible. That has to be done
 /// as a system test.
 TEST(MySqlHostDataSource, NoCallbackOnOpenFailMultiThreading) {
-    Initializer<MySqlHostDataSourceInit> init;
+    MySqlHostDataSourceInit init;
     // Enable Multi-Threading.
     MultiThreadingTest mt(true);
 
@@ -1533,7 +1533,7 @@ protected:
     virtual void TearDown();
 
     /// @brief Initializer.
-    Initializer<MySqlHostDataSourceInit> init_;
+    MySqlHostDataSourceInit init_;
 };
 
 void
@@ -1593,7 +1593,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlHostDataSourceInit> init_;
+    MySqlHostDataSourceInit init_;
 };
 
 // This test verifies that reservations for a particular client can
@@ -1872,7 +1872,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlHostDataSourceInit> init_;
+    MySqlHostDataSourceInit init_;
 };
 
 // Tests that memfile lease manager and MySQL host data source can be created from a
index 7884854d759873a5f828e1f4607f3366885e7abd..407b1f1fe1a667bbd757c2a40633bd28a60c69e9 100644 (file)
@@ -43,7 +43,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 // This test checks that simple allocation handles BOOTP queries.
index 27fac2c033c7a47c70d782613ba69292032037f3..426e7628b1ac546541100d7c3f4bc5d088df2866 100644 (file)
@@ -61,13 +61,13 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 /// @brief Test fixture class for extended info tests.
 class MySqlExtendedInfoTest : public isc::dhcp::test::GenericExtendedInfoTest<NakedMySqlLeaseMgr> {
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 /// @brief Verifies that the lease manager can start.
index af2f7e660efc24a72f11542ba2f7919bcf67c453..da7da302225e5cdbfcf568273d14d901c0110522 100644 (file)
@@ -107,7 +107,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 /// @brief Check that database can be opened
@@ -117,7 +117,7 @@ public:
 /// MySqlLeaseMgr test fixture set.  This test checks that the database can be
 /// opened: the fixtures assume that and check basic operations.
 TEST(MySqlOpenTest, OpenDatabase) {
-    Initializer<MySqlLeaseMgrInit> init;
+    MySqlLeaseMgrInit init;
     // Explicitly disable Multi-Threading.
     MultiThreadingMgr::instance().setMode(false);
 
@@ -220,7 +220,7 @@ TEST(MySqlOpenTest, OpenDatabase) {
 
 /// @brief Check that database can be opened with Multi-Threading
 TEST(MySqlOpenTest, OpenDatabaseMultiThreading) {
-    Initializer<MySqlLeaseMgrInit> init;
+    MySqlLeaseMgrInit init;
     // Enable Multi-Threading.
     MultiThreadingTest mt(true);
 
@@ -996,7 +996,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 /// @brief Verifies that loss of connectivity to MySQL is handled correctly.
@@ -1380,7 +1380,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<MySqlLeaseMgrInit> init_;
+    MySqlLeaseMgrInit init_;
 };
 
 // Tests that MySQL lease manager and host data source can be created from a
index ee8e1dd56c4e8508407416b0f6c296c0ae394a50..b5c3d53e2cc47db0e801c2b108a7d07dab7a5c5b 100644 (file)
@@ -152,7 +152,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlHostDataSourceInit> init_;
+    PgSqlHostDataSourceInit init_;
 };
 
 /// @brief Check that database can be opened
@@ -162,7 +162,7 @@ public:
 /// PgSqlHostMgr test fixture set.  This test checks that the database can be
 /// opened: the fixtures assume that and check basic operations.
 TEST(PgSqlHostDataSource, OpenDatabase) {
-    Initializer<PgSqlHostDataSourceInit> init;
+    PgSqlHostDataSourceInit init;
     // Schema needs to be created for the test to work.
     destroyPgSQLSchema();
     createPgSQLSchema();
@@ -262,7 +262,7 @@ TEST(PgSqlHostDataSource, OpenDatabase) {
 /// PgSqlHostMgr test fixture set.  This test checks that the database can be
 /// opened: the fixtures assume that and check basic operations.
 TEST(PgSqlHostDataSource, OpenDatabaseMultiThreading) {
-    Initializer<PgSqlHostDataSourceInit> init;
+    PgSqlHostDataSourceInit init;
     // Enable Multi-Threading.
     MultiThreadingTest mt(true);
 
@@ -364,7 +364,7 @@ bool db_lost_callback(ReconnectCtlPtr /* db_conn_retry */) {
 /// in a unit test is next to impossible. That has to be done
 /// as a system test.
 TEST(PgSqlHostDataSource, NoCallbackOnOpenFail) {
-    Initializer<PgSqlHostDataSourceInit> init;
+    PgSqlHostDataSourceInit init;
     // Schema needs to be created for the test to work.
     destroyPgSQLSchema();
     createPgSQLSchema();
@@ -389,7 +389,7 @@ TEST(PgSqlHostDataSource, NoCallbackOnOpenFail) {
 /// in a unit test is next to impossible. That has to be done
 /// as a system test.
 TEST(PgSqlHostDataSource, NoCallbackOnOpenFailMultiThreading) {
-    Initializer<PgSqlHostDataSourceInit> init;
+    PgSqlHostDataSourceInit init;
     // Enable Multi-Threading.
     MultiThreadingTest mt(true);
 
@@ -1501,7 +1501,7 @@ protected:
     virtual void TearDown();
 
     /// @brief Initializer.
-    Initializer<PgSqlHostDataSourceInit> init_;
+    PgSqlHostDataSourceInit init_;
 };
 
 void
@@ -1561,7 +1561,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlHostDataSourceInit> init_;
+    PgSqlHostDataSourceInit init_;
 };
 
 // This test verifies that reservations for a particular client can
@@ -1840,7 +1840,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlHostDataSourceInit> init_;
+    PgSqlHostDataSourceInit init_;
 };
 
 // Tests that memfile lease manager and PostgreSQL host data source can be created from a
index f1367890898ce6e5b8996a48427c24de76c87043..ad08f1c54e29f89ca28a8fab66ca57f3be6a5fc6 100644 (file)
@@ -43,7 +43,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 // This test checks that simple allocation handles BOOTP queries.
index 7beb55ca1c21fa6c09a13d499dcf7fbcfe77feda..40fa6f9ca39f66f11ff151ce4c291da5dd67b854 100644 (file)
@@ -61,13 +61,13 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 /// @brief Test fixture class for extended info tests.
 class PgSqlExtendedInfoTest : public isc::dhcp::test::GenericExtendedInfoTest<NakedPgSqlLeaseMgr> {
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 /// @brief Verifies that the lease manager can start.
index c78a41b0611c237b9b94d8514b5516bfd12dd44b..7e0fa4a28dc72b1a9229216f90aaa24ddc47d5a6 100644 (file)
@@ -107,7 +107,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 /// @brief Check that database can be opened
@@ -117,7 +117,7 @@ public:
 /// PgSqlLeaseMgr test fixture set.  This test checks that the database can be
 /// opened: the fixtures assume that and check basic operations.
 TEST(PgSqlOpenTest, OpenDatabase) {
-    Initializer<PgSqlLeaseMgrInit> init;
+    PgSqlLeaseMgrInit init;
     // Explicitly disable Multi-Threading.
     MultiThreadingMgr::instance().setMode(false);
 
@@ -228,7 +228,7 @@ TEST(PgSqlOpenTest, OpenDatabase) {
 
 /// @brief Check that database can be opened with Multi-Threading
 TEST(PgSqlOpenTest, OpenDatabaseMultiThreading) {
-    Initializer<PgSqlLeaseMgrInit> init;
+    PgSqlLeaseMgrInit init;
     // Enable Multi-Threading.
     MultiThreadingTest mt(true);
 
@@ -963,7 +963,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 /// @brief Verifies that loss of connectivity to PostgreSQL is handled correctly.
@@ -1374,7 +1374,7 @@ public:
     }
 
     /// @brief Initializer.
-    Initializer<PgSqlLeaseMgrInit> init_;
+    PgSqlLeaseMgrInit init_;
 };
 
 // Tests that PostgreSQL lease manager and host data source can be created from a
index c4ccf9c2331e268a8c166964d439cb6cb4c2e6ac..7c43c7edaf29108edde107dde8d030eddbe3b914 100644 (file)
@@ -349,26 +349,6 @@ public:
     }
 };
 
-/// @brief RAII class to register a database backend by dynamically
-/// constructing an initialization object.
-///
-/// Used mostly in unittests.
-///
-/// @tparam T The initialization class which registers the database backend
-/// on constructor and deregisters it on destructor.
-template <typename T>
-struct Initializer {
-    /// @brief Constructor.
-    Initializer() : init_(new T()) {
-    }
-
-    /// @brief Destructor.
-    ~Initializer() = default;
-
-    /// @brief Smart pointer to an instance of an initializer.
-    std::unique_ptr<T> init_;
-};
-
 }  // namespace db
 }  // namespace isc
 
index ca7337292847da31a39abf7f37046c47b727b293..35f72168c009fc3e9110503c7a218b4739105e30 100644 (file)
@@ -184,10 +184,13 @@ HostDataSourceFactory::getDBVersions() {
     std::stringstream txt;
 
     for (auto const& x : map_) {
-        if (!txt.str().empty()) {
-            txt << " ";
+        auto version = x.second.second();
+        if (!txt.str().empty() && !version.empty()) {
+            txt << endl;
+        }
+        if (!version.empty()) {
+            txt << "- " << version;
         }
-        txt << x.second.second();
     }
 
     return (txt.str());
index fe6a3a94985cc15134ec38914910f09781ce5fc9..cfed1010f2bd8dca005013375310f4df83ee71f7 100644 (file)
@@ -197,10 +197,13 @@ LeaseMgrFactory::getDBVersions() {
     std::stringstream txt;
 
     for (auto const& x : map_) {
-        if (!txt.str().empty()) {
-            txt << " ";
+        auto version = x.second.second();
+        if (!txt.str().empty() && !version.empty()) {
+            txt << endl;
+        }
+        if (!version.empty()) {
+            txt << "- " << version;
         }
-        txt << x.second.second();
     }
 
     return (txt.str());
index 8de96723bf587bf14e9c1eccd627618f5478cc89..eaefd7a2ebf3e5c29efe57878adc448dc72e5893 100644 (file)
@@ -193,11 +193,11 @@ TEST_F(HostDataSourceFactoryTest, multiple) {
     EXPECT_TRUE(registerFactory2());
     EXPECT_NO_THROW(HostDataSourceFactory::add(sources_, "type=mem2"));
 
-    EXPECT_EQ("version 2", HostDataSourceFactory::getDBVersions());
+    EXPECT_EQ("version 2", HostDataSourceFactory::getDBVersions());
 
     EXPECT_TRUE(registerFactory());
 
-    EXPECT_EQ("version 1  version 2", HostDataSourceFactory::getDBVersions());
+    EXPECT_EQ("- version 1\n- version 2", HostDataSourceFactory::getDBVersions());
 
     // Delete them
     EXPECT_TRUE(HostDataSourceFactory::del(sources_, "mem1"));
index 74e95b7dd9fdb3dbdb4e6aea682e0105b807b538..bc7161faa5ab0704fb3804c256b1d75fb0852eef 100644 (file)
@@ -220,11 +220,11 @@ TEST_F(LeaseMgrFactoryTest, multipleV4) {
     EXPECT_TRUE(LeaseMgrFactory::haveInstance());
     EXPECT_EQ(LeaseMgrFactory::instance().getType(), "mem2");
 
-    EXPECT_EQ("version 2 Memfile backend 3.0", LeaseMgrFactory::getDBVersions());
+    EXPECT_EQ("- version 2\n- Memfile backend 3.0", LeaseMgrFactory::getDBVersions());
 
     EXPECT_TRUE(registerFactory());
 
-    EXPECT_EQ("version 1  version 2 Memfile backend 3.0", LeaseMgrFactory::getDBVersions());
+    EXPECT_EQ("- version 1\n- version 2\n- Memfile backend 3.0", LeaseMgrFactory::getDBVersions());
 
     // Delete them
     EXPECT_NO_THROW(LeaseMgrFactory::destroy());
@@ -247,11 +247,11 @@ TEST_F(LeaseMgrFactoryTest, multipleV6) {
     EXPECT_TRUE(LeaseMgrFactory::haveInstance());
     EXPECT_EQ(LeaseMgrFactory::instance().getType(), "mem2");
 
-    EXPECT_EQ("version 2 Memfile backend 5.0", LeaseMgrFactory::getDBVersions());
+    EXPECT_EQ("- version 2\n- Memfile backend 5.0", LeaseMgrFactory::getDBVersions());
 
     EXPECT_TRUE(registerFactory());
 
-    EXPECT_EQ("version 1  version 2 Memfile backend 5.0", LeaseMgrFactory::getDBVersions());
+    EXPECT_EQ("- version 1\n- version 2\n- Memfile backend 5.0", LeaseMgrFactory::getDBVersions());
 
     // Delete them
     EXPECT_NO_THROW(LeaseMgrFactory::destroy());