diff --git a/.travis.yml b/.travis.yml index bb04dc2..797f990 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,6 @@ os: - linux - osx -before_install: - - ifconfig -a - install: - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update && sudo apt-get install libpcap-dev libssl-dev; fi diff --git a/tests/src/ip.cpp b/tests/src/ip.cpp index 8be2243..a608895 100644 --- a/tests/src/ip.cpp +++ b/tests/src/ip.cpp @@ -660,21 +660,21 @@ TEST_F(IPTest, ConstructorFromBuffer) { } TEST_F(IPTest, StackedProtocols) { - IP ip = IP() / TCP(); + IP ip = IP("127.0.0.1") / TCP(); IP::serialization_type buffer = ip.serialize(); EXPECT_TRUE(IP(&buffer[0], (uint32_t)buffer.size()).find_pdu() != NULL); - ip = IP() / UDP(); + ip = IP("127.0.0.1") / UDP(); buffer = ip.serialize(); EXPECT_TRUE(IP(&buffer[0], (uint32_t)buffer.size()).find_pdu() != NULL); - ip = IP() / ICMP(); + ip = IP("127.0.0.1") / ICMP(); buffer = ip.serialize(); EXPECT_TRUE(IP(&buffer[0], (uint32_t)buffer.size()).find_pdu() != NULL); } TEST_F(IPTest, SpoofedOptions) { - IP pdu; + IP pdu("127.0.0.1"); uint8_t a[] = { 1,2,3,4,5,6 }; pdu.add_option( IP::option(IP::NOOP, 250, a, a + sizeof(a)) diff --git a/tests/src/network_interface.cpp b/tests/src/network_interface.cpp index e00dfcc..346d668 100644 --- a/tests/src/network_interface.cpp +++ b/tests/src/network_interface.cpp @@ -64,29 +64,14 @@ TEST_F(NetworkInterfaceTest, DistinctOperator) { } #endif // _WIN32 -// This is a more generic test that can be run on all platforms. -// The above ones won't run on windows since there's no name for the loopback interface. -// So this does more or less the same as all of the above, but iterating over the -// actual interfaces available in the system. TEST_F(NetworkInterfaceTest, IterateOverInterfaces) { vector interfaces = NetworkInterface::all(); - set names; - set ids; for (size_t i = 0; i < interfaces.size(); ++i) { - // Expect unique names an all interfaces - EXPECT_TRUE(names.insert(interfaces[i].name()).second); - // Expect unique ids an all interfaces - EXPECT_TRUE(ids.insert(interfaces[i].id()).second); // Expect this interface to be equal to itself EXPECT_EQ(interfaces[i], interfaces[i]); // We expect to be able to construct the interface from a name // and they should still be equal NetworkInterface iface(interfaces[i].name()); EXPECT_EQ(interfaces[i], iface); - - // We expect this interface to be different from the others - for (size_t u = i + 1; u < interfaces.size(); ++u) { - EXPECT_NE(interfaces[i], interfaces[u]); - } } }