]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5682] Sanity checks unittests in libdhcpsrv are now working
authorTomek Mrugalski <tomasz@isc.org>
Wed, 25 Jul 2018 04:00:43 +0000 (06:00 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 30 Jul 2018 17:03:18 +0000 (19:03 +0200)
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/sanity_checker.cc
src/lib/dhcpsrv/sanity_checker.h
src/lib/dhcpsrv/tests/sanity_checks_unittest.cc

index 39614ed5bcd4e54ec4408f547db2961dd3872e65..4b4661444b51957a9e81e71fc9fbaad26ee7df97 100644 (file)
@@ -432,9 +432,9 @@ the message.
 
 % DHCPSRV_LEASE_SANITY_FAIL The lease %1 with subnet-id %2 failed subnet-id checks.
 
-% DHCPSRV_LEASE_SANITY_FIXED The lease %2 with subnet-id %2 failed subnet-id checks, but was correced to subnet-id %3.
+% DHCPSRV_LEASE_SANITY_FIXED The lease %1 with subnet-id %2 failed subnet-id checks, but was correced to subnet-id %3.
 
-% DHCPSRV_LEASE_SANITY_FAIL_DISCARD The lease %2 with subnet-id %2 failed subnet-id checks and was dropped.
+% DHCPSRV_LEASE_SANITY_FAIL_DISCARD The lease %1 with subnet-id %2 failed subnet-id checks and was dropped.
 
 % DHCPSRV_MEMFILE_ADD_ADDR4 adding IPv4 lease with address %1
 A debug message issued when the server is about to add an IPv4 lease
index 6328bf22d4e4f75f1a67b549c6b635c61580c699..317111b505942b61476013926f31d5e6923437eb 100644 (file)
@@ -26,7 +26,7 @@ void SanityChecker::checkLease(Lease6Ptr& lease) {
 }
 
 template<typename LeasePtrType, typename SubnetsType>
-void SanityChecker::checkLeaseInternal(LeasePtrType lease, const CfgConsistencyPtr& checks,
+void SanityChecker::checkLeaseInternal(LeasePtrType& lease, const CfgConsistencyPtr& checks,
                                const SubnetsType& subnets) {
 
     if (checks->getLeaseSanityCheck() == CfgConsistency::LEASE_CHECK_NONE) {
index 6cc46bc59d40714f309c5a981a47c9b96f29ddc9..ef376d04d0165ca7098753f373b041732fff5c89 100644 (file)
@@ -51,7 +51,7 @@ class SanityChecker {
     ///        specified here)
     /// @param subnets configuration structure with subnets
     template<typename LeaseType, typename SubnetsType>
-    void checkLeaseInternal(LeaseType lease, const CfgConsistencyPtr& checks,
+    void checkLeaseInternal(LeaseType& lease, const CfgConsistencyPtr& checks,
                             const SubnetsType& subnets);
 
     /// @brief Internal method for finding appropriate subnet-id
index 8f76c155d36dd927d91ae59d48d52e728e402859..41388fd2fe4a810bcca99b02bc62f42bfede2de5 100644 (file)
@@ -257,7 +257,7 @@ TEST_F(SanityChecksTest, memfileAdd4_checksFix) {
 }
 
 TEST_F(SanityChecksTest, memfileAdd4_checksFixdel1) {
-    leaseAddCheck4("192.0.2.1", 1, "192.0.2.0/24", 2, CfgConsistency::LEASE_CHECK_FIX_DEL, true, 1);
+    leaseAddCheck4("192.0.2.1", 1, "192.0.2.0/24", 2, CfgConsistency::LEASE_CHECK_FIX_DEL, true, 2);
 }
 
 TEST_F(SanityChecksTest, memfileAdd4_checksFixdel2) {