Skip to content

8351010: Test java/io/File/GetXSpace.java failed: / usable space 56380809216 > free space 14912244940 #25704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions test/jdk/java/io/File/GetXSpace.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ private static void compare(Space s) {
long fs = f.getFreeSpace();
long us = f.getUsableSpace();

// Verify inequalities us <= fs <= ts (JDK-8349092)
// Verify inequalities us <= ts and fs <= ts (JDK-8349092)
if (fs > ts)
throw new RuntimeException(f + " free space " + fs + " > total space " + ts);
if (us > fs)
throw new RuntimeException(f + " usable space " + us + " > free space " + fs);
if (us > ts)
throw new RuntimeException(f + " usable space " + us + " > total space " + ts);

out.format("%s (%d):%n", s.name(), s.size());
String fmt = " %-4s total = %12d free = %12d usable = %12d%n";
Expand Down Expand Up @@ -269,15 +269,9 @@ private static void compare(Space s) {
pass();
}

// usable space <= free space
if (us > s.free()) {
// free and usable change dynamically
System.err.println("Warning: us > s.free()");
if (1.0 - Math.abs((double)s.free()/(double)us) > 0.01) {
fail(s.name() + " usable vs. free space", us, ">", s.free());
} else {
pass();
}
// usable space <= total space
if (us > s.total()) {
fail(s.name() + " usable vs. total space", us, ">", s.total());
} else {
pass();
}
Expand Down