6910834: TEST: java/io/File/Basic.java fails on Windows CYGWIN environment
Reviewed-by: tbell, alanb
--- a/jdk/test/java/io/File/Basic.java Thu Dec 24 13:56:28 2009 +0800
+++ b/jdk/test/java/io/File/Basic.java Mon Jan 04 15:30:26 2010 -0800
@@ -75,7 +75,7 @@
if (!f.canRead()) fail(f, "is not readable");
if (f.canWrite() != writeable)
fail(f, writeable ? "is not writeable" : "is writeable");
- int rwLen = (File.separatorChar == '/' ? 6 : 7);
+ int rwLen = 6;
if (f.length() != length) fail(f, "has wrong length");
}
@@ -89,7 +89,7 @@
if (nonExistantFile.exists()) fail(nonExistantFile, "exists");
show(rwFile);
- testFile(rwFile, true, File.separatorChar == '/' ? 6 : 7);
+ testFile(rwFile, true, 6);
rwFile.delete();
if (rwFile.exists())
fail(rwFile, "could not delete");
--- a/jdk/test/java/io/File/basic.sh Thu Dec 24 13:56:28 2009 +0800
+++ b/jdk/test/java/io/File/basic.sh Mon Jan 04 15:30:26 2010 -0800
@@ -32,10 +32,10 @@
rm -rf x.Basic.*
rm -f x.Basic.non
-echo xyzzy > x.Basic.rw
+printf "%s" "xyzzyN" > x.Basic.rw
touch x.Basic.ro; chmod ugo-w x.Basic.ro
mkdir x.Basic.dir
-if $TESTJAVA/bin/java $* -classpath $TESTCLASSES Basic; then
+if $TESTJAVA/bin/java $* -classpath "$TESTCLASSES" Basic; then
[ -f x.Basic.rw ] && (echo "x.Basic.rw not deleted"; exit 1)
([ -d x.Basic.dir ] || [ \! -d x.Basic.dir2 ]) \
&& (echo "x.Basic.dir not renamed"; exit 1)