]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2815] Add unit tests
authorSlawek Figiel <slawek@isc.org>
Thu, 6 Apr 2023 16:46:09 +0000 (18:46 +0200)
committerSlawek Figiel <slawek@isc.org>
Thu, 25 May 2023 11:29:29 +0000 (13:29 +0200)
src/lib/dhcpsrv/tests/cfg_hosts_unittest.cc

index de45d7965b1d3139919e123e60f7896555854a4c..8bb0ff46f62089eb8354ddb0d2fa2fc7117f78a6 100644 (file)
@@ -687,6 +687,22 @@ TEST_F(CfgHostsTest, del6) {
     EXPECT_FALSE(host);
 }
 
+// This test checks that false is returned for deleting the IPv4 host that
+// doesn't exist.
+TEST_F(CfgHostsTest, del4MissingHost) {
+    CfgHosts cfg;
+    EXPECT_FALSE(cfg.del4(SubnetID(42), Host::IdentifierType::IDENT_DUID,
+                         &duids_[0]->getDuid()[0], duids_[0]->getDuid().size()));
+}
+
+// This test checks that false is returned for deleting the IPv6 host that
+// doesn't exist.
+TEST_F(CfgHostsTest, del6MissingHost) {
+    CfgHosts cfg;
+    EXPECT_FALSE(cfg.del6(SubnetID(42), Host::IdentifierType::IDENT_DUID,
+                         &duids_[0]->getDuid()[0], duids_[0]->getDuid().size()));
+}
+
 // This test checks that all reservations for the specified IPv4 subnet can
 // be deleted.
 TEST_F(CfgHostsTest, deleteAll4) {