Skip to content

Commit 81029b7

Browse files
committed
Add testDoubleArray to parameter passing, based on #122
1 parent eb43d3e commit 81029b7

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

test/Test$TestInner.class

0 Bytes
Binary file not shown.

test/Test.class

142 Bytes
Binary file not shown.

test/Test.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ public static String testString(String i) {
3636
return i;
3737
}
3838

39+
public static double testDoubleArray(double[] array) {
40+
//Inspired from jsum of #122
41+
double sum = 0;
42+
for (double value : array) {
43+
sum += value;
44+
}
45+
return sum;
46+
}
47+
3948
public static java.util.HashMap testNull() {
4049
return null;
4150
}

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ T = @jimport Test
5656
c=JString(C_NULL)
5757
@test isnull(c)
5858
@test "" == jcall(T, "testString", JString, (JString,), c)
59+
a = rand(10^7)
60+
@test [jcall(T, "testDoubleArray", jdouble, (Array{jdouble,1},),a)
61+
for i in 1:10][1] sum(a)
62+
a = nothing
5963
end
6064

6165
@testset "static_method_call_1" begin

0 commit comments

Comments
 (0)