Project health: print disk space metrics when there is an exception in testRandomAccessFile_seekMoreThan2gb.
Change on 2019/03/22 by antoniocortes
@@ -995,6 +995,8 @@ public class RandomAccessFileTest extends junit.framework.TestCase {
// require 2GB of free disk space
return;
}
+ // J2ObjC modified: print disk space metrics when there is an exception.
+ try {
// (all?) unix platforms support sparse files so this should not
// need to have 2GB free disk space to pass
RandomAccessFile raf = new RandomAccessFile(f, "rw");
@@ -1014,6 +1016,13 @@ public class RandomAccessFileTest extends junit.framework.TestCase {
raf.seek(0);
assertEquals("seek back to 0", 1, raf.read());
raf.close();
+ } catch (IOException e) {
+ long gb = 1024L * 1024L * 1024L;
+ System.err.println("Total space: " + ((double) f.getTotalSpace())/gb + " GB");
+ System.err.println("Free space: " + ((double) f.getFreeSpace())/gb + " GB");
+ System.err.println("Usable space: " + ((double) f.getUsableSpace())/gb + " GB");
+ throw e;
+ }
}
/**
