aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/typedef_funcptr_runme.js
blob: ca0f81a1e60132e40409556659994ee1754bd600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var typedef_funcptr = require("typedef_funcptr");

a = 100;
b = 10;

if (typedef_funcptr.do_op(a, b, typedef_funcptr.addf) != 110) {
  throw new Error("addf failed");
}
if (typedef_funcptr.do_op(a, b, typedef_funcptr.subf) != 90) {
  throw new Error("subf failed");
}

if (typedef_funcptr.do_op_typedef_int(a, b, typedef_funcptr.addf) != 110) {
  throw new Error("addf failed");
}
if (typedef_funcptr.do_op_typedef_int(a, b, typedef_funcptr.subf) != 90) {
  throw new Error("subf failed");
}

if (typedef_funcptr.do_op_typedef_Integer(a, b, typedef_funcptr.addf) != 110) {
  throw new Error("addf failed");
}
if (typedef_funcptr.do_op_typedef_Integer(a, b, typedef_funcptr.subf) != 90) {
  throw new Error("subf failed");
}