aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/template_typemaps_typedef_runme.js
blob: d94c4be8278cf071f642f2e9f590d2c929d27faf (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var template_typemaps_typedef = require("template_typemaps_typedef");

m1 = new template_typemaps_typedef.MultimapIntA();

dummy_pair = m1.make_dummy_pair();
val = m1.typemap_test(dummy_pair).val;
if (val != 1234) {
    throw new Error("typemaps not working");
}

m2 = new template_typemaps_typedef.MultimapAInt();

// TODO: typemaps and specializations not quite working as expected. T needs expanding, but at least the right typemap is being picked up.
//dummy_pair = m2.make_dummy_pair()
//val = m2.typemap_test(dummy_pair)

// if (val != 4321) {
//    throw new Error, "typemaps not working"

if (template_typemaps_typedef.typedef_test1(dummy_pair).val != 1234) {
    throw new Error("template_typemaps_typedef.typedef_test1 not working");
}

if (template_typemaps_typedef.typedef_test2(dummy_pair).val != 1234) {
    throw new Error("template_typemaps_typedef.typedef_test2 not working");
}

if (template_typemaps_typedef.typedef_test3(dummy_pair).val != 1234) {
    throw new Error("template_typemaps_typedef.typedef_test3 not working");
}

if (template_typemaps_typedef.typedef_test4(dummy_pair).val != 1234) {
    throw new Error("template_typemaps_typedef.typedef_test4 not working");
}

if (template_typemaps_typedef.typedef_test5(dummy_pair).val != 1234) {
    throw new Error("template_typemaps_typedef.typedef_test5 not working");
}

if (template_typemaps_typedef.typedef_test6(dummy_pair).val != 1234) {
    throw new Error("template_typemaps_typedef.typedef_test6 not working");
}