提交 b6b9432b 编写于 作者: J jjg

6876753: javap tests fail on Windows

Reviewed-by: darcy
上级 f4fd9a1e
...@@ -65,6 +65,7 @@ public class T4975569 ...@@ -65,6 +65,7 @@ public class T4975569
int errors; int errors;
String javap(String className) { String javap(String className) {
String newline = System.getProperty("line.separator");
String testClasses = System.getProperty("test.classes", "."); String testClasses = System.getProperty("test.classes", ".");
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
PrintWriter out = new PrintWriter(sw); PrintWriter out = new PrintWriter(sw);
...@@ -73,7 +74,7 @@ public class T4975569 ...@@ -73,7 +74,7 @@ public class T4975569
if (rc != 0) if (rc != 0)
throw new Error("javap failed. rc=" + rc); throw new Error("javap failed. rc=" + rc);
out.close(); out.close();
String output = sw.toString(); String output = sw.toString().replaceAll(newline, "\n");
System.out.println("class " + className); System.out.println("class " + className);
System.out.println(output); System.out.println(output);
return output; return output;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
*/ */
import java.io.*; import java.io.*;
import java.net.*;
import java.util.*; import java.util.*;
public class T6729471 public class T6729471
...@@ -59,14 +60,22 @@ public class T6729471 ...@@ -59,14 +60,22 @@ public class T6729471
if (java_home.getName().equals("jre")) if (java_home.getName().equals("jre"))
java_home = java_home.getParentFile(); java_home = java_home.getParentFile();
File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar"); File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar");
verify("jar:file:" + rt_jar + "!/java/util/Map.class", try {
verify("jar:" + rt_jar.toURL() + "!/java/util/Map.class",
"public abstract boolean containsKey(java.lang.Object)"); "public abstract boolean containsKey(java.lang.Object)");
} catch (MalformedURLException e) {
error(e.toString());
}
// jar url: ct.sym, if it exists // jar url: ct.sym, if it exists
File ct_sym = new File(new File(java_home, "lib"), "ct.sym"); File ct_sym = new File(new File(java_home, "lib"), "ct.sym");
if (ct_sym.exists()) { if (ct_sym.exists()) {
verify("jar:file:" + ct_sym + "!/META-INF/sym/rt.jar/java/util/Map.class", try {
"public abstract boolean containsKey(java.lang.Object)"); verify("jar:" + ct_sym.toURL() + "!/META-INF/sym/rt.jar/java/util/Map.class",
"public abstract boolean containsKey(java.lang.Object)");
} catch (MalformedURLException e) {
error(e.toString());
}
} else } else
System.err.println("warning: ct.sym not found"); System.err.println("warning: ct.sym not found");
......
...@@ -40,7 +40,7 @@ echo "TESTJAVA=${TESTJAVA}" ...@@ -40,7 +40,7 @@ echo "TESTJAVA=${TESTJAVA}"
# set platform-dependent variables # set platform-dependent variables
OS=`uname -s` OS=`uname -s`
case "$OS" in case "$OS" in
SunOS | Linux ) SunOS | Linux | CYGWIN* )
FS="/" FS="/"
;; ;;
Windows* ) Windows* )
......
...@@ -53,7 +53,7 @@ printf 'CLASSPATH="%s"' "${CLASSPATH}" >&2 ; echo >&2 ...@@ -53,7 +53,7 @@ printf 'CLASSPATH="%s"' "${CLASSPATH}" >&2 ; echo >&2
# set platform-dependent variables # set platform-dependent variables
OS=`uname -s` OS=`uname -s`
case "$OS" in case "$OS" in
CYGWIN* | Windows* ) Windows* )
FS="\\" FS="\\"
;; ;;
* ) * )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册