From 814a9749c206d933ff56574c995b6f6d937fab96 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Wed, 25 Jul 2018 06:00:43 +0200 Subject: [PATCH] [5682] Sanity checks unittests in libdhcpsrv are now working --- src/lib/dhcpsrv/dhcpsrv_messages.mes | 4 ++-- src/lib/dhcpsrv/sanity_checker.cc | 2 +- src/lib/dhcpsrv/sanity_checker.h | 2 +- src/lib/dhcpsrv/tests/sanity_checks_unittest.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 39614ed5bc..4b4661444b 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -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 diff --git a/src/lib/dhcpsrv/sanity_checker.cc b/src/lib/dhcpsrv/sanity_checker.cc index 6328bf22d4..317111b505 100644 --- a/src/lib/dhcpsrv/sanity_checker.cc +++ b/src/lib/dhcpsrv/sanity_checker.cc @@ -26,7 +26,7 @@ void SanityChecker::checkLease(Lease6Ptr& lease) { } template -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) { diff --git a/src/lib/dhcpsrv/sanity_checker.h b/src/lib/dhcpsrv/sanity_checker.h index 6cc46bc59d..ef376d04d0 100644 --- a/src/lib/dhcpsrv/sanity_checker.h +++ b/src/lib/dhcpsrv/sanity_checker.h @@ -51,7 +51,7 @@ class SanityChecker { /// specified here) /// @param subnets configuration structure with subnets template - 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 diff --git a/src/lib/dhcpsrv/tests/sanity_checks_unittest.cc b/src/lib/dhcpsrv/tests/sanity_checks_unittest.cc index 8f76c155d3..41388fd2fe 100644 --- a/src/lib/dhcpsrv/tests/sanity_checks_unittest.cc +++ b/src/lib/dhcpsrv/tests/sanity_checks_unittest.cc @@ -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) { -- 2.47.2