You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gh...@apache.org on 2006/06/23 13:27:24 UTC

svn commit: r416674 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetAddressTest.java

Author: gharley
Date: Fri Jun 23 04:27:23 2006
New Revision: 416674

URL: http://svn.apache.org/viewvc?rev=416674&view=rev
Log:
Another tweak to make test case more portable. 

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetAddressTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetAddressTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetAddressTest.java?rev=416674&r1=416673&r2=416674&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetAddressTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/InetAddressTest.java Fri Jun 23 04:27:23 2006
@@ -91,7 +91,10 @@
 					String hostName = ia.getHostName();
 					String hostAddress = ia.getHostAddress();
 
-					if (!correctName.equals(hostName)) {
+                    // Intentionally not looking for exact name match so that 
+                    // the test works across different platforms that may or 
+                    // may not include a domain suffix on the hostname
+                    if (!hostName.startsWith(correctName)) {
 						threadedTestSucceeded = false;
 						threadedTestErrorString = (testType == 0 ? "gethostbyname"
 								: "gethostbyaddr")
@@ -100,6 +103,7 @@
 								+ " instead of " + correctName;
 						break;
 					}
+                    // IP addresses should match exactly
 					if (!correctAddress.equals(hostAddress)) {
 						threadedTestSucceeded = false;
 						threadedTestErrorString = (testType == 0 ? "gethostbyname"