Skip to content

Commit

Permalink
Avoid timeout on Windows in test case JACOBIN-0251-array-type-perf
Browse files Browse the repository at this point in the history
  • Loading branch information
texadactyl committed Nov 20, 2024
1 parent dbfbf6e commit 3263d16
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file is a version history of jacotest amendments. Entries appear in versio
| `Date` | `Version` | `Contents` |
| :------------: | :---: | :--- |
|<img width=90/>|<img width=60/>|<img width=600/>|
| 2024-11-20 | 3.4.21 | Avoid timeout on Windows in test case JACOBIN-0251-array-type-perf. |
| 2024-11-19 | 3.4.20 | Enhanced test case ex-finally. |
| 2024-11-18 | 3.4.19 | New test case: hexxed. |
| 2024-11-17 | 3.4.18 | Enhanced test case JACOBIN-0433-HexFormat. |
| 2024-11-15 | 3.4.17 | Deleted trivial test JACOBIN-0280. |
Expand Down
1 change: 1 addition & 0 deletions TEST_CASE_CATALOGUE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This file is a catalogue of jacotest test cases. Entries appear in alphabetic o
| hashed-map | java.util.HashMap |
| hashed-set | java.util.HashSet |
| hex-decode-numeric | Loop stability of decoding numeric values |
| hexxed | java.util.HexMap |
| http-client-server | Simple non-secure web client and server |
| https-client-getter | Simple secure web GET |
| imageio-output | Simple writing to a PNG file |
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.4.19
v3.4.21
2 changes: 2 additions & 0 deletions tests/JACOBIN-0211-pbcrypto/main.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ public static void main(String[] args) throws Exception {

// Make the key.
byte[] salt = getSalt();
System.out.println("getSalt() ok");
SecretKeySpec secretKeySpec = makeSecretKeySpec(password, salt, keySize, iterations);
System.out.println("SecretKeySpec instantiation ok");

// Perform encryption.
EncryptionOutput eo = encrypt(secretKeySpec, msgBytes);
Expand Down
4 changes: 2 additions & 2 deletions tests/JACOBIN-0251-array-type-perf/main.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public class main {

final static int NELEMS = 1000000;
final static int NLOOPS = 1000000;
final static int NELEMS = 10000;
final static int NLOOPS = 10000;

public static void reporter(String label, long t1, long t2) {
double et = (double) (t2 - t1) / 1000.0;
Expand Down
16 changes: 15 additions & 1 deletion tests/ex-finally/main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@ public static void main(String[] args) {

System.out.println("Try-Catch-Finally exercise");
boolean finny = false;
Double DBL = Double.valueOf(42.0);
double dbl = DBL.doubleValue();
if (dbl != 42.0) {
String errMsg = String.format("*** ERROR, expected dbl=42.0, observed: %d\n", dbl);
throw new AssertionError(errMsg);
}
System.out.println("Success :: Double.valueOf(42.0)");
DBL = Double.valueOf("42.0");
dbl = DBL.doubleValue();
if (dbl != 42.0) {
String errMsg = String.format("*** ERROR, expected dbl=42.0 based on \"42.0\", observed: %d\n", dbl);
throw new AssertionError(errMsg);
}
System.out.println("Success :: Double.valueOf(\"42.0\")");
try {
double dud = Double.valueOf("foobar");
throw new AssertionError("*** ERROR, I did not catch an exception from Double.valueOf(\"foobar\")!");
} catch (NumberFormatException ex) {
System.out.println("Caught the Number Format Exception!");
System.out.println("Caught the Number Format Exception with Double.valueOf(\"foobar\")!"); // <============ not getting here
} catch (Exception ex) {
throw new AssertionError("Caught an unexpected exception!");
} finally {
Expand Down

0 comments on commit 3263d16

Please sign in to comment.