[haiku-commits] r40452 - haiku/trunk/src/tests/kits/net/libnetapi

Author: axeld
Date: 2011-02-11 23:48:24 +0100 (Fri, 11 Feb 2011)
New Revision: 40452
Changeset: http://dev.haiku-os.org/changeset/40452

Modified:
   haiku/trunk/src/tests/kits/net/libnetapi/NetworkInterfaceTest.cpp
Log:
* The test now runs through.


Modified: haiku/trunk/src/tests/kits/net/libnetapi/NetworkInterfaceTest.cpp
===================================================================
--- haiku/trunk/src/tests/kits/net/libnetapi/NetworkInterfaceTest.cpp   
2011-02-11 22:31:49 UTC (rev 40451)
+++ haiku/trunk/src/tests/kits/net/libnetapi/NetworkInterfaceTest.cpp   
2011-02-11 22:48:24 UTC (rev 40452)
@@ -27,8 +27,11 @@
 NetworkInterfaceTest::setUp()
 {
        fInterface.SetTo("loopTest");
+       BNetworkRoster::Default().RemoveInterface(fInterface);
+               // just in case
+
        CPPUNIT_ASSERT(BNetworkRoster::Default().AddInterface(fInterface) == 
B_OK);
-       CPPUNIT_ASSERT(fInterface.CountAddresses() == 0);
+       CPPUNIT_ASSERT(fInterface.CountAddresses() == 1);
                // every interface has one unspec address
 }
 
@@ -53,6 +56,9 @@
 void
 NetworkInterfaceTest::TestFindAddress()
 {
+       fInterface.RemoveAddressAt(0);
+               // Remove empty address
+
        // Add first
 
        BNetworkInterfaceAddress first;
@@ -66,6 +72,7 @@
 
        BNetworkInterfaceAddress second;
        second.SetAddress(BNetworkAddress(AF_INET6, "::1"));
+
        CPPUNIT_ASSERT(fInterface.FindAddress(second.Address()) < 0);
        CPPUNIT_ASSERT(fInterface.AddAddress(second) == B_OK);
        CPPUNIT_ASSERT(fInterface.FindAddress(second.Address()) >= 0);
@@ -85,6 +92,9 @@
 void
 NetworkInterfaceTest::TestFindFirstAddress()
 {
+       fInterface.RemoveAddressAt(0);
+               // Remove empty address
+
        // Add first
 
        BNetworkInterfaceAddress first;


Other related posts:

  • » [haiku-commits] r40452 - haiku/trunk/src/tests/kits/net/libnetapi - axeld