Skip to content

Commit f7786a9

Browse files
committed
Fix tests for JDK 9
1 parent f46ab5a commit f7786a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/runtests.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,16 @@ end
150150
@test length(listmethods(getclass(JString("test")), "indexOf")) >= 3
151151
m = listmethods(JString("test"), "indexOf")[1]
152152
@test getname(getreturntype(m)) == "int"
153-
@test [getname(typ) for typ in getparametertypes(m)] == ["java.lang.String", "int"]
153+
154+
v=jcall(@jimport("java.lang.System"), "getProperty", JString, (JString,), "java.version")
155+
java_ver = macroexpand(:(@v_str($v)))
156+
157+
#Order of methods is different in JDK 9
158+
if java_ver < v"9"
159+
@test [getname(typ) for typ in getparametertypes(m)] == ["java.lang.String", "int"]
160+
else
161+
@test [getname(typ) for typ in getparametertypes(m)] == ["int"]
162+
end
154163

155164
#Test for double free bug, #20
156165
#Fix in #28. The following lines will segfault without the fix

0 commit comments

Comments
 (0)