From ab5d8f2a51507a7b568c3889e3f22ad179e9a0eb Mon Sep 17 00:00:00 2001 From: Daniel_M_Williams Date: Tue, 28 Oct 2014 13:37:38 -0600 Subject: [PATCH] [Fix][Cont] Added Unit test for RSE-load negative mass bug. - Added Test case in TestMotorLoader.java - Added Test load file 'test3.rse' which would previously raise an IOException on load. - Added this test case to the 'testGeneralMotorLoader' method as well. - Adjusted the digest string so that 'test3.rse' will pass the unit tests. - TestMotorLoader currently passes 5/5 unit tests. --- .../file/motor/TestMotorLoader.java | 12 +++++++-- .../net/sf/openrocket/file/motor/test3.rse | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 core/test/net/sf/openrocket/file/motor/test3.rse diff --git a/core/test/net/sf/openrocket/file/motor/TestMotorLoader.java b/core/test/net/sf/openrocket/file/motor/TestMotorLoader.java index dbc23e745..ee8e47978 100644 --- a/core/test/net/sf/openrocket/file/motor/TestMotorLoader.java +++ b/core/test/net/sf/openrocket/file/motor/TestMotorLoader.java @@ -1,6 +1,8 @@ package net.sf.openrocket.file.motor; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.InputStream; @@ -16,6 +18,7 @@ public class TestMotorLoader { private static final String DIGEST1 = "e523030bc96d5e63313b5723aaea267d"; private static final String DIGEST2 = "6a41f0f10b7283793eb0e6b389753729"; + private static final String DIGEST3 = "e3164a735f9a50500f2725f0a33d246b"; @Test @@ -25,7 +28,7 @@ public class TestMotorLoader { test(loader, "test1.eng", DIGEST1); test(loader, "test2.rse", DIGEST2); test(loader, "test.zip", DIGEST2, DIGEST1); - + test(loader, "test3.rse", DIGEST3); } @Test @@ -38,6 +41,11 @@ public class TestMotorLoader { test(new RockSimMotorLoader(), "test2.rse", DIGEST2); } + @Test + public void testRocksimMotorLoader3() throws IOException { + test(new RockSimMotorLoader(), "test3.rse", DIGEST3); + } + @Test public void testZipMotorLoader() throws IOException { test(new ZipFileMotorLoader(), "test.zip", DIGEST2, DIGEST1); diff --git a/core/test/net/sf/openrocket/file/motor/test3.rse b/core/test/net/sf/openrocket/file/motor/test3.rse new file mode 100644 index 000000000..95a86c555 --- /dev/null +++ b/core/test/net/sf/openrocket/file/motor/test3.rse @@ -0,0 +1,27 @@ + + + + Water Rocket, 90 psi, 800g + + + + + + + + + + + + + + + + + +