6910834: TEST: java/io/File/Basic.java fails on Windows CYGWIN environment

Reviewed-by: tbell, alanb
This commit is contained in:
Kelly O'Hair 2010-01-04 15:30:26 -08:00
parent 56ac52238f
commit 23ac573ae7
2 changed files with 4 additions and 4 deletions

View File

@ -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");

View File

@ -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)