aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/template_typemaps_typedef2_runme.js
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2024-04-10 14:15:29 -0700
committerAlistair Delva <adelva@google.com>2024-04-11 12:58:28 -0700
commitd0f0f90be16c2ac553b5fa08512045273135147a (patch)
tree5d9ebb7a04807ea8a609ddd18b0162bc87530e4b /Examples/test-suite/javascript/template_typemaps_typedef2_runme.js
parent6ffc1dbf29ba98c4d8aa71ebc9b484e973fe1030 (diff)
downloadswig-d0f0f90be16c2ac553b5fa08512045273135147a.tar.gz
Update to v4.2.1HEADmastermain
Change-Id: I47cef2be94299220d80265d949a95b58eee2c23b
Diffstat (limited to 'Examples/test-suite/javascript/template_typemaps_typedef2_runme.js')
-rw-r--r--Examples/test-suite/javascript/template_typemaps_typedef2_runme.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/template_typemaps_typedef2_runme.js b/Examples/test-suite/javascript/template_typemaps_typedef2_runme.js
new file mode 100644
index 000000000..911a3fce6
--- /dev/null
+++ b/Examples/test-suite/javascript/template_typemaps_typedef2_runme.js
@@ -0,0 +1,42 @@
+var template_typemaps_typedef2 = require("template_typemaps_typedef2");
+
+m1 = new template_typemaps_typedef2.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_typedef2.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_typedef2.typedef_test1(dummy_pair).val != 1234) {
+ throw new Error("template_typemaps_typedef2.typedef_test1 not working");
+}
+
+if (template_typemaps_typedef2.typedef_test2(dummy_pair).val != 1234) {
+ throw new Error("template_typemaps_typedef2.typedef_test2 not working");
+}
+
+if (template_typemaps_typedef2.typedef_test3(dummy_pair).val != 1234) {
+ throw new Error("template_typemaps_typedef2.typedef_test3 not working");
+}
+
+if (template_typemaps_typedef2.typedef_test4(dummy_pair).val != 1234) {
+ throw new Error("template_typemaps_typedef2.typedef_test4 not working");
+}
+
+if (template_typemaps_typedef2.typedef_test5(dummy_pair).val != 1234) {
+ throw new Error("template_typemaps_typedef2.typedef_test5 not working");
+}
+
+if (template_typemaps_typedef2.typedef_test6(dummy_pair).val != 1234) {
+ throw new Error("template_typemaps_typedef2.typedef_test6 not working");
+}