// interfaces.txt instead. It will pretend to have detected
// fe80::1234 link-local address on eth0 interface. Obviously
// an attempt to bind this socket will fail.
- Dhcpv6Srv* srv = 0;
+ Dhcpv6Srv* srv = NULL;
ASSERT_NO_THROW( {
// open an unpriviledged port
srv = new Dhcpv6Srv(DHCP6_SERVER_PORT + 10000);
}
TEST_F(Dhcpv6SrvTest, Solicit_basic) {
- NakedDhcpv6Srv * srv = 0;
+ NakedDhcpv6Srv* srv = NULL;
ASSERT_NO_THROW( srv = new NakedDhcpv6Srv(); );
// a dummy content for client-id
boost::shared_ptr<Option> tmp = reply->getOption(D6O_IA_NA);
ASSERT_TRUE( tmp );
- Option6IA * reply_ia = dynamic_cast<Option6IA*> ( tmp.get() );
+ Option6IA* reply_ia = dynamic_cast<Option6IA*> ( tmp.get() );
EXPECT_EQ( 234, reply_ia->getIAID() );
// check that there's an address included
interfaces << "eth0 fe80::21e:8cff:fe9b:7349";
interfaces.close();
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
+ NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
- Pkt6 * pkt = 0;
+ Pkt6* pkt = NULL;
int cnt = 0;
cout << "---8X-----------------------------------------" << endl;
while (true) {
TEST_F(IfaceMgrTest, ifaceClass) {
// basic tests for Iface inner class
- IfaceMgr::Iface * iface = new IfaceMgr::Iface("eth5", 7);
+ IfaceMgr::Iface* iface = new IfaceMgr::Iface("eth5", 7);
EXPECT_STREQ("eth5/7", iface->getFullName().c_str());
TEST_F(IfaceMgrTest, getIface) {
cout << "Interface checks. Please ignore socket binding errors." << endl;
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
+ NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
// interface name, ifindex
IfaceMgr::Iface iface1("lo1", 1);
// check that interface can be retrieved by ifindex
- IfaceMgr::Iface * tmp = ifacemgr->getIface(5);
+ IfaceMgr::Iface* tmp = ifacemgr->getIface(5);
// ASSERT_NE(NULL, tmp); is not supported. hmmmm.
ASSERT_TRUE( tmp != NULL );
// interfaces. Nevertheless, this fake interface should
// be on list, but if_nametoindex() will fail.
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
+ NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
ASSERT_TRUE( ifacemgr->getIface("eth0") != NULL );
- IfaceMgr::Iface * eth0 = ifacemgr->getIface("eth0");
+ IfaceMgr::Iface* eth0 = ifacemgr->getIface("eth0");
// there should be one address
IfaceMgr::AddressCollection addrs = eth0->getAddresses();
EXPECT_STREQ( "fe80::1234", addr.toText().c_str() );
delete ifacemgr;
+ unlink(INTERFACE_FILE);
}
TEST_F(IfaceMgrTest, sockets6) {
createLoInterfacesTxt();
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
+ NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
IOAddress loAddr("::1");
close(socket2);
delete ifacemgr;
+ unlink(INTERFACE_FILE);
}
// TODO: disabled due to other naming on various systems
// testing socket operation in a portable way is tricky
// without interface detection implemented
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
+ NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
IOAddress loAddr("::1");
IOAddress mcastAddr("ff02::1:2");
EXPECT_TRUE( (rcvPkt->remote_port_ == 10546) || (rcvPkt->remote_port_ == 10547) );
delete ifacemgr;
+ unlink(INTERFACE_FILE);
}
TEST_F(IfaceMgrTest, socket4) {
close(socket1);
delete ifacemgr;
+ unlink(INTERFACE_FILE);
}
// Test the Iface structure itself
TEST_F(IfaceMgrTest, iface) {
- IfaceMgr::Iface* iface = 0;
+ IfaceMgr::Iface* iface = NULL;
EXPECT_NO_THROW(
iface = new IfaceMgr::Iface("eth0",1);
);
// now let's test if IfaceMgr handles socket info properly
createLoInterfacesTxt();
- NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
+ NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
IfaceMgr::Iface* loopback = ifacemgr->getIface(LOOPBACK);
ASSERT_TRUE(loopback);
loopback->addSocket(sock1);
);
delete ifacemgr;
+ unlink(INTERFACE_FILE);
}
}