Skip to content

Commit b3fae85

Browse files
committed
test creating a boolean array closes joeferner#67
1 parent d05f3dc commit b3fae85

5 files changed

Lines changed: 14 additions & 1 deletion

File tree

test/Test$SubClass.class

0 Bytes
Binary file not shown.

test/Test$SuperClass.class

0 Bytes
Binary file not shown.

test/Test.class

220 Bytes
Binary file not shown.

test/Test.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public Test() {}
3030

3131
public static int staticByte(byte b) { return (int)b; }
3232
public static int staticChar(char ch) { return (int)ch; }
33+
public static boolean[] staticBooleanArray(Boolean[] arg) {
34+
boolean[] b = new boolean[arg.length];
35+
for(int i=0; i<arg.length; i++) { b[i] = arg[i]; }
36+
return b;
37+
}
3338

3439
public static class SuperClass {
3540
public int getVal() { return 3; }

test/simple-test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ exports['Simple'] = nodeunit.testCase({
168168
console.log(r);
169169
test.equal(r, 97);
170170
test.done();
171-
}
171+
},
172172

173+
"new boolean array": function(test) {
174+
var booleanArray = java.newArray("java.lang.Boolean", [true, false]);
175+
var r = java.callStaticMethodSync("Test", "staticBooleanArray", booleanArray);
176+
test.equal(r.length, 2);
177+
test.equal(r[0], true);
178+
test.equal(r[1], false);
179+
test.done();
180+
}
173181
});
174182

0 commit comments

Comments
 (0)