isc_throw(BadValue, "fractional timeout must be shorter than"
" one million microseconds");
}
- const SocketInfo* candidate = 0;
+ boost::shared_ptr<SocketInfo> candidate;
IfacePtr iface;
fd_set sockets;
int maxfd = 0;
BOOST_FOREACH(iface, ifaces_) {
BOOST_FOREACH(SocketInfo s, iface->getSockets()) {
if (FD_ISSET(s.sockfd_, &sockets)) {
- candidate = &(s);
+ candidate.reset(new SocketInfo(s));
break;
}
}
" one million microseconds");
}
- const SocketInfo* candidate = 0;
+ boost::shared_ptr<SocketInfo> candidate;
fd_set sockets;
int maxfd = 0;
BOOST_FOREACH(IfacePtr iface, ifaces_) {
BOOST_FOREACH(SocketInfo s, iface->getSockets()) {
if (FD_ISSET(s.sockfd_, &sockets)) {
- candidate = &(s);
+ candidate.reset(new SocketInfo(s));
break;
}
}
NakedIfaceMgr ifacemgr;
IfacePtr iface = ifacemgr.getIface(LOOPBACK);
- if (iface) {
+ if (!iface) {
cout << "Local loopback interface not found. Skipping test. " << endl;
return;
}
// Tell the interface that it should bind to this global interface
+ // It is the first attempt so it should succeed
EXPECT_NO_THROW(iface->addUnicast(IOAddress("2001:db8::1")));
// Tell the interface that it should bind to this global interface
+ // It is the second attempt so it should fail
EXPECT_THROW(iface->addUnicast(IOAddress("2001:db8::1")), BadValue);
}