提交 b6b9432b 编写于 作者: J jjg

6876753: javap tests fail on Windows

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