From: Marcin Siodelski Date: Wed, 22 Mar 2023 14:02:52 +0000 (+0100) Subject: [#2780] Fixed unit tests X-Git-Tag: Kea-2.3.7~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=773e370d46dbf070b695570d92678570568b4eeb;p=thirdparty%2Fkea.git [#2780] Fixed unit tests --- diff --git a/src/lib/dhcpsrv/tests/flq_allocation_state_unittest.cc b/src/lib/dhcpsrv/tests/flq_allocation_state_unittest.cc index 8ca8c5bf51..859f3c687a 100644 --- a/src/lib/dhcpsrv/tests/flq_allocation_state_unittest.cc +++ b/src/lib/dhcpsrv/tests/flq_allocation_state_unittest.cc @@ -124,7 +124,7 @@ TEST(PoolFreeLeaseAllocationState, addDeleteFreeLeaseNA) { } // Test that duplicate leases are not added to the queue. -TEST(PoolFreeLeaseAllocationState, addFreeLeasNASeveralTimes) { +TEST(PoolFreeLeaseAllocationState, addFreeLeaseNASeveralTimes) { auto pool = boost::make_shared(Lease::TYPE_NA, IOAddress("2001:db8:1::"), IOAddress("2001:db8:1::10")); auto state = PoolFreeLeaseQueueAllocationState::create(pool); @@ -149,6 +149,15 @@ TEST(PoolFreeLeaseAllocationState, addFreeLeasNASeveralTimes) { EXPECT_TRUE(state->exhausted()); } +// Test creating a new free lease queue allocation state for an IPv6 +// prefix pool. +TEST(PoolFreeLeaseAllocationState, createPD) { + auto pool = boost::make_shared(Lease::TYPE_PD, IOAddress("3000::"), 112, 120); + auto state = PoolFreeLeaseQueueAllocationState::create(pool); + ASSERT_TRUE(state); + EXPECT_TRUE(state->exhausted()); +} + // Test creating a new free lease queue allocation state for a // delegated prefix pool. TEST(PoolFreeLeaseAllocationState, addDeleteFreeLeasePD) {