// 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());
// 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);
/// @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);
}
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_) &&
}
bool
-NameChangeRequest::operator != (const NameChangeRequest& other) {
+NameChangeRequest::operator != (const NameChangeRequest& other) const {
return (!(*this == other));
}
/// @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.
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();
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) {
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) {
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());
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());
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_);
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_);
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_);
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_);
123, 1000, 2000, 1)));
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
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());
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());
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());
123, 1000, 2000, 1)));
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
lease->setContext(user_context);
// Add the lease.
- bool ret;
+ bool ret = false;
EXPECT_NO_THROW(ret = lease_mgr_->addLease(lease));
EXPECT_TRUE(ret);
/// (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_);
}
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 ********//
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
///
/// @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.
}
}
-
TcpListener::~TcpListener() {
stop();
}
// 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());
#include <sysrepo-cpp/Connection.hpp>
#include <sysrepo-cpp/Session.hpp>
+#include <unordered_map>
+
namespace isc {
namespace yang {