2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 23:45:27 +00:00

[#2617] fixed warnings on macos clang c++20

This commit is contained in:
Razvan Becheriu
2022-12-05 18:03:55 +02:00
committed by Andrei Pavel
parent a4d61bf7b2
commit b90c09255f
15 changed files with 32 additions and 32 deletions

View File

@@ -156,7 +156,7 @@ TEST(D2QueueMgrBasicTest, basicQueue) {
// Verify the peeked entry is the one it should be.
ASSERT_TRUE(ncr);
EXPECT_TRUE (*(ref_msgs[i]) == *ncr);
EXPECT_EQ(*(ref_msgs[i]), *ncr);
// Verify that peek did not alter the queue size.
EXPECT_EQ(VALID_MSG_CNT - i, queue_mgr->getQueueSize());
@@ -181,13 +181,13 @@ TEST(D2QueueMgrBasicTest, basicQueue) {
// Verify that peekAt returns the correct entry.
EXPECT_NO_THROW(ncr = queue_mgr->peekAt(1));
EXPECT_TRUE (*(ref_msgs[1]) == *ncr);
EXPECT_EQ(*(ref_msgs[1]), *ncr);
// Verify that dequeueAt removes the correct entry.
// Removing it, this should shift the queued entries forward by one.
EXPECT_NO_THROW(queue_mgr->dequeueAt(1));
EXPECT_NO_THROW(ncr = queue_mgr->peekAt(1));
EXPECT_TRUE (*(ref_msgs[2]) == *ncr);
EXPECT_EQ(*(ref_msgs[2]), *ncr);
// Verify the peekAt and dequeueAt throw when given indexes beyond the end.
EXPECT_THROW(queue_mgr->peekAt(VALID_MSG_CNT + 1), D2QueueMgrInvalidIndex);

View File

@@ -455,7 +455,7 @@ protected:
/// @param request Pointer to the HTTP request.
/// @return Pointer to an object representing HTTP response.
virtual HttpResponsePtr
createDynamicHttpResponse(HttpRequestPtr request) {
createDynamicHttpResponse(HttpRequestPtr request) override {
// Request must always be JSON.
PostHttpRequestJsonPtr request_json =
boost::dynamic_pointer_cast<PostHttpRequestJson>(request);

View File

@@ -674,7 +674,7 @@ NameChangeRequest::toText() const {
}
bool
NameChangeRequest::operator == (const NameChangeRequest& other) {
NameChangeRequest::operator == (const NameChangeRequest& other) const {
return ((change_type_ == other.change_type_) &&
(forward_change_ == other.forward_change_) &&
(reverse_change_ == other.reverse_change_) &&
@@ -687,7 +687,7 @@ NameChangeRequest::operator == (const NameChangeRequest& other) {
}
bool
NameChangeRequest::operator != (const NameChangeRequest& other) {
NameChangeRequest::operator != (const NameChangeRequest& other) const {
return (!(*this == other));
}

View File

@@ -709,8 +709,8 @@ public:
/// @return a string containing the text.
std::string toText() const;
bool operator == (const NameChangeRequest& b);
bool operator != (const NameChangeRequest& b);
bool operator == (const NameChangeRequest& b) const;
bool operator != (const NameChangeRequest& b) const;
private:
/// @brief Denotes the type of this change as either an Add or a Remove.

View File

@@ -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();

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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());

View File

@@ -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);

View File

@@ -191,7 +191,7 @@ public:
/// (This method is principally for testing.)
///
/// \return true if the logger objects are instances of the same logger.
bool operator==(const LoggerImpl& other) {
bool operator==(const LoggerImpl& other) const {
return (name_ == other.name_);
}

View File

@@ -36,11 +36,11 @@ bool
ConfigDbInfo::getParameterValue(const std::string& name, std::string& value) const {
auto param = access_params_.find(name);
if (param == access_params_.end()) {
return(false);
return (false);
}
value = param->second;
return(true);
return (true);
}
//******** ConfigControlInfo ********//
@@ -117,13 +117,13 @@ ConfigControlInfo::toElement() const {
Element::create(static_cast<int>(config_fetch_wait_time_)));
}
return(result);
return (result);
}
bool
ConfigControlInfo::equals(const ConfigControlInfo& other) const {
return ((db_infos_ == other.db_infos_) &&
(config_fetch_wait_time_ == other.config_fetch_wait_time_));
return ((db_infos_ == other.db_infos_) &&
(config_fetch_wait_time_.get() == other.config_fetch_wait_time_.get()));
}
} // end of namespace isc::process

View File

@@ -50,7 +50,7 @@ public:
///
/// @return database access string with password redacted.
std::string redactedAccessString() const {
return(db::DatabaseConnection::redactedAccessString(access_params_));
return (db::DatabaseConnection::redactedAccessString(access_params_));
}
/// @brief Retrieve the map of parameter values.

View File

@@ -45,7 +45,6 @@ TcpListener::TcpListener(IOService& io_service,
}
}
TcpListener::~TcpListener() {
stop();
}

View File

@@ -454,7 +454,6 @@ public:
// Iterate over the clients, checking their outcomes.
size_t total_responses = 0;
size_t connection_id = 1;
for (auto const& client : clients_) {
// Client should have completed its receive successfully.
ASSERT_TRUE(client->receiveDone());

View File

@@ -13,6 +13,8 @@
#include <sysrepo-cpp/Connection.hpp>
#include <sysrepo-cpp/Session.hpp>
#include <unordered_map>
namespace isc {
namespace yang {