Skip to content

Commit

Permalink
Add testDoubleArray to parameter passing, based on #122
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti committed May 30, 2020
1 parent eb43d3e commit 81029b7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
Binary file modified test/Test$TestInner.class
Binary file not shown.
Binary file modified test/Test.class
Binary file not shown.
9 changes: 9 additions & 0 deletions test/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ public static String testString(String i) {
return i;
}

public static double testDoubleArray(double[] array) {
//Inspired from jsum of #122
double sum = 0;
for (double value : array) {
sum += value;
}
return sum;
}

public static java.util.HashMap testNull() {
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ T = @jimport Test
c=JString(C_NULL)
@test isnull(c)
@test "" == jcall(T, "testString", JString, (JString,), c)
a = rand(10^7)
@test [jcall(T, "testDoubleArray", jdouble, (Array{jdouble,1},),a)
for i in 1:10][1] sum(a)
a = nothing
end

@testset "static_method_call_1" begin
Expand Down

0 comments on commit 81029b7

Please sign in to comment.