From: Marcin Siodelski Date: Wed, 24 Aug 2016 10:31:26 +0000 (+0200) Subject: [4323] More updates to host_mgr unit tests as a result of review. X-Git-Tag: trac4631_base~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94584f50d6cbb3ee173dbe7729e08e06cdf220c8;p=thirdparty%2Fkea.git [4323] More updates to host_mgr unit tests as a result of review. --- diff --git a/src/lib/dhcpsrv/tests/host_mgr_unittest.cc b/src/lib/dhcpsrv/tests/host_mgr_unittest.cc index 45c127069c..8e922d355d 100644 --- a/src/lib/dhcpsrv/tests/host_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/host_mgr_unittest.cc @@ -253,15 +253,19 @@ HostMgrTest::testGetAll(BaseHostDataSource& data_source1, void HostMgrTest::testGetAll4(BaseHostDataSource& data_source1, BaseHostDataSource& data_source2) { + // Initially, no hosts should be present. ConstHostCollection hosts = HostMgr::instance().getAll4(IOAddress("192.0.2.5")); ASSERT_TRUE(hosts.empty()); + // Add two hosts to different data sources. addHost4(data_source1, hwaddrs_[0], SubnetID(1), IOAddress("192.0.2.5")); addHost4(data_source2, hwaddrs_[1], SubnetID(10), IOAddress("192.0.2.5")); CfgMgr::instance().commit(); + // Retrieve all hosts, This should return hosts from both sources + // in a single container. hosts = HostMgr::instance().getAll4(IOAddress("192.0.2.5")); ASSERT_EQ(2, hosts.size());