diff --git a/Examples/test-suite/java/java_lib_arrays_runme.java b/Examples/test-suite/java/java_lib_arrays_runme.java index 9490e5e2f..9c245e0e9 100644 --- a/Examples/test-suite/java/java_lib_arrays_runme.java +++ b/Examples/test-suite/java/java_lib_arrays_runme.java @@ -40,6 +40,13 @@ public class java_lib_arrays_runme { array_struct[0].setDouble_field(222.333); array_struct[1].setDouble_field(444.555); + AnotherStruct[] another_struct={new AnotherStruct(), new AnotherStruct()}; + another_struct[0].setSimple(array_struct[0]); + another_struct[1].setSimple(array_struct[1]); + + if (another_struct[0].getSimple().getDouble_field() != 222.333) throw new RuntimeException("AnotherStruct[0] failed"); + if (another_struct[1].getSimple().getDouble_field() != 444.555) throw new RuntimeException("AnotherStruct[1] failed"); + // Now set the array members and check that they have been set correctly as.setArray_c(array_c); check_string(array_c, as.getArray_c()); @@ -87,63 +94,55 @@ public class java_lib_arrays_runme { // Functions to check that the array values were set correctly public static void check_string(String original, String checking) { if (!checking.equals(original)) { - System.err.println("Runtime test failed. checking = [" + checking + "]"); - System.exit(1); + throw new RuntimeException("Runtime test failed. checking = [" + checking + "]"); } } public static void check_byte_array(byte[] original, byte[] checking) { for (int i=0; i