Skip to content

Commit ee4434b

Browse files
author
phishman3579
committed
Updated the testing code to catch exceptions
git-svn-id: https://java-algorithms-implementation.googlecode.com/svn/trunk@416 032fbc0f-8cab-eb90-e552-f08422b9a96a
1 parent 92f0cbb commit ee4434b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/com/jwetherell/algorithms/DataStructures.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
@SuppressWarnings("unchecked")
6363
public class DataStructures {
6464

65-
private static final int NUMBER_OF_TESTS = 1;
65+
private static final int NUMBER_OF_TESTS = 10;
6666
private static final Random RANDOM = new Random();
67-
private static final int ARRAY_SIZE = 100;
67+
private static final int ARRAY_SIZE = 1000;
6868
private static final int RANDOM_SIZE = 1000 * ARRAY_SIZE;
6969
private static final Integer INVALID = RANDOM_SIZE + 10;
7070
private static final DecimalFormat FORMAT = new DecimalFormat("0.##");
@@ -88,9 +88,14 @@ public class DataStructures {
8888

8989
public static void main(String[] args) {
9090
System.out.println("Starting tests.");
91-
boolean passed = true;
91+
boolean passed = false;
9292
for (int i = 0; i < NUMBER_OF_TESTS; i++) {
93-
passed = runTests();
93+
try {
94+
passed = runTests();
95+
} catch (NullPointerException e) {
96+
System.err.println(string);
97+
throw e;
98+
}
9499
if (!passed) break;
95100
}
96101
if (passed) System.out.println("Tests finished. All passed.");

0 commit comments

Comments
 (0)