From: Slawek Figiel Date: Mon, 3 Apr 2023 18:14:44 +0000 (+0200) Subject: [#2815] Fix unit tests X-Git-Tag: Kea-2.3.8~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0002cbdfccae901a4cabb886792a6e47b43b289f;p=thirdparty%2Fkea.git [#2815] Fix unit tests --- diff --git a/src/lib/dhcpsrv/host_mgr.cc b/src/lib/dhcpsrv/host_mgr.cc index 55f077c1e3..0b5dd5a42c 100644 --- a/src/lib/dhcpsrv/host_mgr.cc +++ b/src/lib/dhcpsrv/host_mgr.cc @@ -645,7 +645,7 @@ HostMgr::add(const HostPtr& host, const HostMgrOperationTarget target) { if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) { // Don't throw if all targets were selected. - if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) { + if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) { isc_throw(NoHostDataSourceManager, "Unable to add new host because there is " "no hosts-database configured."); @@ -673,7 +673,7 @@ HostMgr::del(const SubnetID& subnet_id, const asiolink::IOAddress& addr, if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) { // Don't throw if all targets were selected. - if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) { + if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) { isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is " "no hosts-database configured."); } @@ -701,7 +701,7 @@ HostMgr::del4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_ if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) { // Don't throw if all targets were selected. - if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) { + if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) { isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is " "no hosts-database configured."); } @@ -729,7 +729,7 @@ HostMgr::del6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_ if (target & HostMgrOperationTarget::ALTERNATE_SOURCES) { // Don't throw if all targets were selected. - if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::ALL_SOURCES)) { + if (alternate_sources_.empty() && !(target & HostMgrOperationTarget::PRIMARY_SOURCE)) { isc_throw(NoHostDataSourceManager, "Unable to delete a host because there is " "no hosts-database configured."); } diff --git a/src/lib/dhcpsrv/host_mgr.h b/src/lib/dhcpsrv/host_mgr.h index 671433e999..06dbce31a3 100644 --- a/src/lib/dhcpsrv/host_mgr.h +++ b/src/lib/dhcpsrv/host_mgr.h @@ -169,7 +169,7 @@ public: /// /// @return Collection of const @c Host objects. ConstHostCollection - getAll4(const SubnetID& subnet_id, const HostMgrOperationTarget target) const; + getAll4(const SubnetID& subnet_id, const HostMgrOperationTarget target=HostMgrOperationTarget::ALL_SOURCES) const; /// @brief Return all hosts in a DHCPv6 subnet. ///