summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2022-12-05 17:03:55 +0100
committerAndrei Pavel <andrei@isc.org>2022-12-06 14:28:49 +0100
commitb90c09255fb653c3f0009fc49f573fd12fc94e99 (patch)
tree4167ac67ef21d4e62656084a032c9dca45473d64 /src/lib/dhcpsrv
parent[#2617] fix Wdeprecated-declarations warnings on std::iterator (diff)
downloadkea-b90c09255fb653c3f0009fc49f573fd12fc94e99.tar.xz
kea-b90c09255fb653c3f0009fc49f573fd12fc94e99.zip
[#2617] fixed warnings on macos clang c++20
Diffstat (limited to 'src/lib/dhcpsrv')
-rw-r--r--src/lib/dhcpsrv/shared_network.cc2
-rw-r--r--src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc2
-rw-r--r--src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc2
-rw-r--r--src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc4
-rw-r--r--src/lib/dhcpsrv/tests/memfile_lease_extended_info_unittest.cc20
5 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/dhcpsrv/shared_network.cc b/src/lib/dhcpsrv/shared_network.cc
index d63fc02361..61e5e3aa15 100644
--- a/src/lib/dhcpsrv/shared_network.cc
+++ b/src/lib/dhcpsrv/shared_network.cc
@@ -304,7 +304,7 @@ public:
auto preferred_subnet = selected_subnet;
for (auto s = subnets.begin(); s != subnets.end(); ++s) {
- if ((*s)->getClientClass() != selected_subnet->getClientClass()) {
+ if ((*s)->getClientClass().get() != selected_subnet->getClientClass().get()) {
continue;
}
auto current_subnet_state = (*s)->getAllocationState();
diff --git a/src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc b/src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc
index d81be1e2e5..4c49218f2c 100644
--- a/src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cfg_shared_networks4_unittest.cc
@@ -31,7 +31,7 @@ void checkMergedNetwork(const CfgSharedNetworks4& networks, const std::string& n
const std::vector<SubnetID>& exp_subnets) {
auto network = networks.getByName(name);
ASSERT_TRUE(network) << "expected network: " << name << " not found";
- ASSERT_EQ(exp_valid, network->getValid()) << " network valid lifetime wrong";
+ ASSERT_EQ(exp_valid, network->getValid().get()) << " network valid lifetime wrong";
const Subnet4SimpleCollection* subnets = network->getAllSubnets();
ASSERT_EQ(exp_subnets.size(), subnets->size()) << " wrong number of subnets";
for (auto exp_id : exp_subnets) {
diff --git a/src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc b/src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc
index a9a45d9a91..53a2fa8bb1 100644
--- a/src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cfg_shared_networks6_unittest.cc
@@ -31,7 +31,7 @@ void checkMergedNetwork(const CfgSharedNetworks6& networks, const std::string& n
const std::vector<SubnetID>& exp_subnets) {
auto network = networks.getByName(name);
ASSERT_TRUE(network) << "expected network: " << name << " not found";
- ASSERT_EQ(exp_valid, network->getValid()) << " network valid lifetime wrong";
+ ASSERT_EQ(exp_valid, network->getValid().get()) << " network valid lifetime wrong";
const Subnet6SimpleCollection* subnets = network->getAllSubnets();
ASSERT_EQ(exp_subnets.size(), subnets->size()) << " wrong number of subnets";
for (auto exp_id : exp_subnets) {
diff --git a/src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc b/src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc
index 9b3da68134..a97b1c8847 100644
--- a/src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc
+++ b/src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc
@@ -1968,7 +1968,7 @@ TEST_F(ClientClassDefParserTest, validLifetimeTests) {
if (scenario.exp_triplet_.unspecified()) {
EXPECT_TRUE(class_def->getValid().unspecified());
} else {
- EXPECT_EQ(class_def->getValid(), scenario.exp_triplet_);
+ EXPECT_EQ(class_def->getValid().unspecified(), scenario.exp_triplet_.unspecified());
EXPECT_EQ(class_def->getValid().getMin(), scenario.exp_triplet_.getMin());
EXPECT_EQ(class_def->getValid().get(), scenario.exp_triplet_.get());
EXPECT_EQ(class_def->getValid().getMax(), scenario.exp_triplet_.getMax());
@@ -2031,7 +2031,7 @@ TEST_F(ClientClassDefParserTest, preferredLifetimeTests) {
if (scenario.exp_triplet_.unspecified()) {
EXPECT_TRUE(class_def->getPreferred().unspecified());
} else {
- EXPECT_EQ(class_def->getPreferred(), scenario.exp_triplet_);
+ EXPECT_EQ(class_def->getPreferred().unspecified(), scenario.exp_triplet_.unspecified());
EXPECT_EQ(class_def->getPreferred().getMin(), scenario.exp_triplet_.getMin());
EXPECT_EQ(class_def->getPreferred().get(), scenario.exp_triplet_.get());
EXPECT_EQ(class_def->getPreferred().getMax(), scenario.exp_triplet_.getMax());
diff --git a/src/lib/dhcpsrv/tests/memfile_lease_extended_info_unittest.cc b/src/lib/dhcpsrv/tests/memfile_lease_extended_info_unittest.cc
index f9e26d2f61..198fefe225 100644
--- a/src/lib/dhcpsrv/tests/memfile_lease_extended_info_unittest.cc
+++ b/src/lib/dhcpsrv/tests/memfile_lease_extended_info_unittest.cc
@@ -1066,7 +1066,7 @@ TEST_F(MemfileExtendedInfoTest, deleteLease6) {
EXPECT_NE(lease_addr, lease->addr_);
// Put a value different of the expected one.
lease->extended_info_action_ = Lease::ACTION_UPDATE;
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->deleteLease(lease));
EXPECT_TRUE(ret);
EXPECT_EQ(Lease::ACTION_IGNORE, lease->extended_info_action_);
@@ -1108,7 +1108,7 @@ TEST_F(MemfileExtendedInfoTest, deleteLease6disabled) {
EXPECT_EQ(lease_addr, lease->addr_);
// Put a value different from the expected one.
lease->extended_info_action_ = Lease::ACTION_UPDATE;
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->deleteLease(lease));
EXPECT_TRUE(ret);
EXPECT_EQ(Lease::ACTION_IGNORE, lease->extended_info_action_);
@@ -1141,7 +1141,7 @@ TEST_F(MemfileExtendedInfoTest, addLease6) {
lease->setContext(user_context);
// Put a value different of the expected one.
lease->extended_info_action_ = Lease::ACTION_DELETE;
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
EXPECT_EQ(Lease::ACTION_IGNORE, lease->extended_info_action_);
@@ -1191,7 +1191,7 @@ TEST_F(MemfileExtendedInfoTest, addLease6disabled) {
ASSERT_NO_THROW(user_context = Element::fromJSON(user_context_txt));
lease->setContext(user_context);
lease->extended_info_action_ = Lease::ACTION_UPDATE;
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
EXPECT_EQ(Lease::ACTION_IGNORE, lease->extended_info_action_);
@@ -1214,7 +1214,7 @@ TEST_F(MemfileExtendedInfoTest, updateLease6ignore) {
123, 1000, 2000, 1)));
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
@@ -1269,7 +1269,7 @@ TEST_F(MemfileExtendedInfoTest, updateLease6delete) {
lease->setContext(user_context);
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
EXPECT_EQ(1, lease_mgr_->relay_id6_.size());
@@ -1310,7 +1310,7 @@ TEST_F(MemfileExtendedInfoTest, updateLease6deleteDisabled) {
lease->setContext(user_context);
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
EXPECT_EQ(1, lease_mgr_->relay_id6_.size());
@@ -1347,7 +1347,7 @@ TEST_F(MemfileExtendedInfoTest, updateLease6update) {
123, 1000, 2000, 1)));
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
EXPECT_TRUE(lease_mgr_->relay_id6_.empty());
@@ -1407,7 +1407,7 @@ TEST_F(MemfileExtendedInfoTest, updateLease6updateDisabled) {
123, 1000, 2000, 1)));
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
@@ -1459,7 +1459,7 @@ TEST_F(MemfileExtendedInfoTest, updateLease6update2) {
lease->setContext(user_context);
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);