mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 13:07:50 +00:00
[2898] pair<a,b> replaced with make_pair
This commit is contained in:
parent
468687262b
commit
bc6af598cf
@ -1699,7 +1699,7 @@ TEST_F(Dhcpv6SrvTest, selectSubnetRelayInterfaceId) {
|
||||
relay.linkaddr_ = IOAddress("2001:db8:2::1234");
|
||||
relay.peeraddr_ = IOAddress("fe80::1");
|
||||
OptionPtr opt = generateInterfaceId("relay2");
|
||||
relay.options_.insert(pair<int, OptionPtr>(opt->getType(), opt));
|
||||
relay.options_.insert(make_pair(opt->getType(), opt));
|
||||
pkt->relay_info_.push_back(relay);
|
||||
|
||||
// There is only one subnet configured and we are outside of that subnet
|
||||
|
@ -265,11 +265,11 @@ TEST_F(LibDhcpTest, packOptions6) {
|
||||
OptionPtr opt4(new Option(Option::V6, 6, buf.begin() + 8, buf.begin() + 12));
|
||||
OptionPtr opt5(new Option(Option::V6, 8, buf.begin() + 12, buf.begin() + 14));
|
||||
|
||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt1));
|
||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt2));
|
||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt3));
|
||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt4));
|
||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt5));
|
||||
opts.insert(make_pair(opt1->getType(), opt1));
|
||||
opts.insert(make_pair(opt1->getType(), opt2));
|
||||
opts.insert(make_pair(opt1->getType(), opt3));
|
||||
opts.insert(make_pair(opt1->getType(), opt4));
|
||||
opts.insert(make_pair(opt1->getType(), opt5));
|
||||
|
||||
OutputBuffer assembled(512);
|
||||
|
||||
|
@ -507,7 +507,7 @@ TEST_F(Pkt6Test, relayPack) {
|
||||
|
||||
OptionPtr optRelay1(new Option(Option::V6, 200, relay_data));
|
||||
|
||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(optRelay1->getType(), optRelay1));
|
||||
relay1.options_.insert(make_pair(optRelay1->getType(), optRelay1));
|
||||
|
||||
OptionPtr opt1(new Option(Option::V6, 100));
|
||||
OptionPtr opt2(new Option(Option::V6, 101));
|
||||
@ -581,9 +581,9 @@ TEST_F(Pkt6Test, getAnyRelayOption) {
|
||||
OptionPtr relay1_opt2(generateRandomOption(201));
|
||||
OptionPtr relay1_opt3(generateRandomOption(202));
|
||||
|
||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(200, relay1_opt1));
|
||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(201, relay1_opt2));
|
||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(202, relay1_opt3));
|
||||
relay1.options_.insert(make_pair(200, relay1_opt1));
|
||||
relay1.options_.insert(make_pair(201, relay1_opt2));
|
||||
relay1.options_.insert(make_pair(202, relay1_opt3));
|
||||
msg->addRelayInfo(relay1);
|
||||
|
||||
// generate options for relay2
|
||||
@ -592,16 +592,16 @@ TEST_F(Pkt6Test, getAnyRelayOption) {
|
||||
OptionPtr relay2_opt2(new Option(Option::V6, 101));
|
||||
OptionPtr relay2_opt3(new Option(Option::V6, 102));
|
||||
OptionPtr relay2_opt4(new Option(Option::V6, 200)); // the same code as relay1_opt3
|
||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(100, relay2_opt1));
|
||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(101, relay2_opt2));
|
||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(102, relay2_opt3));
|
||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(200, relay2_opt4));
|
||||
relay2.options_.insert(make_pair(100, relay2_opt1));
|
||||
relay2.options_.insert(make_pair(101, relay2_opt2));
|
||||
relay2.options_.insert(make_pair(102, relay2_opt3));
|
||||
relay2.options_.insert(make_pair(200, relay2_opt4));
|
||||
msg->addRelayInfo(relay2);
|
||||
|
||||
// generate options for relay3
|
||||
Pkt6::RelayInfo relay3;
|
||||
OptionPtr relay3_opt1(generateRandomOption(200, 7));
|
||||
relay3.options_.insert(pair<int, boost::shared_ptr<Option> >(200, relay3_opt1));
|
||||
relay3.options_.insert(make_pair(200, relay3_opt1));
|
||||
msg->addRelayInfo(relay3);
|
||||
|
||||
// Ok, so we now have a packet that traversed the following network:
|
||||
|
@ -40,8 +40,7 @@ CfgMgr::addOptionSpace4(const OptionSpacePtr& space) {
|
||||
isc_throw(InvalidOptionSpace, "option space " << space->getName()
|
||||
<< " already added.");
|
||||
}
|
||||
spaces4_.insert(std::pair<std::string,
|
||||
OptionSpacePtr>(space->getName(), space));
|
||||
spaces4_.insert(make_pair(space->getName(), space));
|
||||
}
|
||||
|
||||
void
|
||||
@ -55,8 +54,7 @@ CfgMgr::addOptionSpace6(const OptionSpacePtr& space) {
|
||||
isc_throw(InvalidOptionSpace, "option space " << space->getName()
|
||||
<< " already added.");
|
||||
}
|
||||
spaces6_.insert(std::pair<std::string,
|
||||
OptionSpacePtr>(space->getName(), space));
|
||||
spaces6_.insert(make_pair(space->getName(), space));
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user