From 23ac573ae78bf64891fa9b448c6e58b9810090de Mon Sep 17 00:00:00 2001 From: Kelly O'Hair Date: Mon, 4 Jan 2010 15:30:26 -0800 Subject: [PATCH] 6910834: TEST: java/io/File/Basic.java fails on Windows CYGWIN environment Reviewed-by: tbell, alanb --- jdk/test/java/io/File/Basic.java | 4 ++-- jdk/test/java/io/File/basic.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/test/java/io/File/Basic.java b/jdk/test/java/io/File/Basic.java index a57c6ccddef..cbb8259e5fe 100644 --- a/jdk/test/java/io/File/Basic.java +++ b/jdk/test/java/io/File/Basic.java @@ -75,7 +75,7 @@ public class Basic { 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 @@ public class Basic { 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"); diff --git a/jdk/test/java/io/File/basic.sh b/jdk/test/java/io/File/basic.sh index fa11c66536b..cc87ac32e84 100644 --- a/jdk/test/java/io/File/basic.sh +++ b/jdk/test/java/io/File/basic.sh @@ -32,10 +32,10 @@ fi 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)