Skip to content

Commit

Permalink
test exception safety net
Browse files Browse the repository at this point in the history
  • Loading branch information
Frotty committed May 27, 2018
1 parent a205fcf commit 4e9fd7d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/test/java/systems/crigges/jmpq3test/MpqTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ public void testRebuild() throws IOException {
for (File mpq : mpqs) {
log.info(mpq.getName());
JMpqEditor mpqEditor = new JMpqEditor(mpq, MPQOpenOption.FORCE_V0);
mpqEditor.deleteFile("(listfile)");
mpqEditor.close(false, false, false);
if (mpqEditor.isCanWrite()) {
mpqEditor.deleteFile("(listfile)");
mpqEditor.close(false, false, false);
}
}
}

Expand All @@ -114,10 +116,12 @@ public void testRecompressBuild() throws IOException {
for (File mpq : mpqs) {
log.info(mpq.getName());
JMpqEditor mpqEditor = new JMpqEditor(mpq, MPQOpenOption.FORCE_V0);
long length = mpq.length();
mpqEditor.close(true, true, true);
long newlength = mpq.length();
System.out.println("Size win: " + (length - newlength));
if (mpqEditor.isCanWrite()) {
long length = mpq.length();
mpqEditor.close(true, true, true);
long newlength = mpq.length();
System.out.println("Size win: " + (length - newlength));
}
}
}

Expand Down

0 comments on commit 4e9fd7d

Please sign in to comment.