diff --git a/Examples/test-suite/arrays.i b/Examples/test-suite/arrays.i index f252d800f..37a4f0029 100644 --- a/Examples/test-suite/arrays.i +++ b/Examples/test-suite/arrays.i @@ -25,10 +25,10 @@ typedef struct { unsigned long array_ul[ARRAY_LEN]; long long array_ll[ARRAY_LEN]; float array_f [ARRAY_LEN]; - double array_d [ARRAY_LEN]; - SimpleStruct array_struct[ARRAY_LEN]; - SimpleStruct* array_structpointers[ARRAY_LEN]; - int* array_ipointers [ARRAY_LEN]; + double array_d [ARRAY_LEN]; + SimpleStruct array_struct[ARRAY_LEN]; + SimpleStruct* array_structpointers[ARRAY_LEN]; + int* array_ipointers [ARRAY_LEN]; finger array_enum[ARRAY_LEN]; finger* array_enumpointers[ARRAY_LEN]; const int array_const_i[ARRAY_LEN]; diff --git a/Examples/test-suite/java/java_lib_arrays_runme.java b/Examples/test-suite/java/java_lib_arrays_runme.java index 6866d3a96..f5dc8b84e 100644 --- a/Examples/test-suite/java/java_lib_arrays_runme.java +++ b/Examples/test-suite/java/java_lib_arrays_runme.java @@ -47,6 +47,9 @@ public class java_lib_arrays_runme { 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"); + if (java_lib_arrays.extract(another_struct, 0) != 222.333) throw new RuntimeException("extract 0 failed"); + if (java_lib_arrays.extract(another_struct, 1) != 444.555) throw new RuntimeException("extract 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()); diff --git a/Examples/test-suite/java_lib_arrays.i b/Examples/test-suite/java_lib_arrays.i index 955c3c37e..ba8974daa 100644 --- a/Examples/test-suite/java_lib_arrays.i +++ b/Examples/test-suite/java_lib_arrays.i @@ -17,5 +17,8 @@ JAVA_ARRAYSOFCLASSES(struct AnotherStruct) struct AnotherStruct { SimpleStruct simple; }; +double extract(struct AnotherStruct as[], int index) { + return as[index].simple.double_field; +} %}