[Lldb-commits] [lldb] r264850 - Fix SocketAddressTest (again)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 30 02:43:04 PDT 2016


Author: labath
Date: Wed Mar 30 04:43:04 2016
New Revision: 264850

URL: http://llvm.org/viewvc/llvm-project?rev=264850&view=rev
Log:
Fix SocketAddressTest (again)

On some versions of Windows, the address is returned as "::1", while on others it's
"0:0:...:0:1". Accept both versions, as they represent the same address.

Modified:
    lldb/trunk/unittests/Host/SocketAddressTest.cpp

Modified: lldb/trunk/unittests/Host/SocketAddressTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SocketAddressTest.cpp?rev=264850&r1=264849&r2=264850&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/SocketAddressTest.cpp (original)
+++ lldb/trunk/unittests/Host/SocketAddressTest.cpp Wed Mar 30 04:43:04 2016
@@ -33,7 +33,8 @@ TEST_F (SocketAddressTest, Set)
     ASSERT_EQ (0, sa.GetPort ());
 
     ASSERT_TRUE (sa.SetToLocalhost (AF_INET6, 1139));
-    ASSERT_STREQ ("::1", sa.GetIPAddress ().c_str ());
+    ASSERT_TRUE(sa.GetIPAddress() == "::1" || sa.GetIPAddress() == "0:0:0:0:0:0:0:1") << "Address was: "
+                                                                                      << sa.GetIPAddress();
     ASSERT_EQ (1139, sa.GetPort ());
 }
 




More information about the lldb-commits mailing list