Merge branch 'master' into director-unwrap-result
This commit is contained in:
commit
deb7cbf741
1099 changed files with 14845 additions and 34359 deletions
|
|
@ -13,6 +13,9 @@ srcdir = @srcdir@
|
|||
top_srcdir = @top_srcdir@
|
||||
top_builddir = @top_builddir@
|
||||
|
||||
CPP_TEST_CASES += \
|
||||
javascript_lib_arrays \
|
||||
|
||||
SWIGEXE = $(top_builddir)/swig
|
||||
SWIG_LIB_DIR = $(top_srcdir)/Lib
|
||||
|
||||
|
|
@ -44,14 +47,14 @@ ifeq (node,$(JSENGINE))
|
|||
SWIGOPT += -v8 -DBUILDING_NODE_EXTENSION=1
|
||||
|
||||
# shut up some warnings
|
||||
# contract macro has an empty 'else' at the end...
|
||||
aggregate.cpptest: GYP_CFLAGS = \"-Wno-empty-body\"
|
||||
contract.cpptest: GYP_CFLAGS = \"-Wno-empty-body\"
|
||||
|
||||
# dunno... ignoring generously
|
||||
apply_signed_char.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
constant_pointers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
cpp11_ref_qualifiers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
director_basic.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
enum_thorough.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
member_funcptr_galore.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
director_unwrap_result.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
|
||||
|
||||
setup_node = \
|
||||
|
|
@ -132,6 +135,7 @@ clean:
|
|||
rm -f imports_a$${ext} imports_b$${ext}; \
|
||||
rm -f import_stl_a$${ext} import_stl_b$${ext}; \
|
||||
rm -f mod_a$${ext} mod_b$${ext}; \
|
||||
rm -f multi_import_a$${ext} multi_import_b$${ext}; \
|
||||
rm -f multi_import_a$${ext} multi_import_b$${ext} multi_import_d$${ext}; \
|
||||
rm -f packageoption_a$${ext} packageoption_b$${ext} packageoption_c$${ext}; \
|
||||
rm -f template_typedef_cplx2$${ext}; \
|
||||
done
|
||||
|
|
|
|||
|
|
@ -4,3 +4,14 @@ f = new class_scope_weird.Foo();
|
|||
g = new class_scope_weird.Foo(3);
|
||||
if (f.bar(3) != 3)
|
||||
throw RuntimeError;
|
||||
|
||||
// Test missing new keyword during constructor call
|
||||
var caughtException = false;
|
||||
try {
|
||||
g = class_scope_weird.Foo(4);
|
||||
} catch (err) {
|
||||
caughtException = true;
|
||||
}
|
||||
if (!caughtException) {
|
||||
throw new Error("Instantiation exception not thrown");
|
||||
}
|
||||
|
|
|
|||
19
Examples/test-suite/javascript/inherit_missing_runme.js
Normal file
19
Examples/test-suite/javascript/inherit_missing_runme.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
var inherit_missing = require("inherit_missing");
|
||||
|
||||
a = inherit_missing.new_Foo()
|
||||
b = new inherit_missing.Bar()
|
||||
c = new inherit_missing.Spam()
|
||||
|
||||
x = inherit_missing.do_blah(a)
|
||||
if (x != "Foo::blah")
|
||||
throw new Error("Whoa! Bad return {}".format(x))
|
||||
|
||||
x = inherit_missing.do_blah(b)
|
||||
if (x != "Bar::blah")
|
||||
throw new Error("Whoa! Bad return {}".format(x))
|
||||
|
||||
x = inherit_missing.do_blah(c)
|
||||
if (x != "Spam::blah")
|
||||
throw new Error("Whoa! Bad return {}".format(x))
|
||||
|
||||
inherit_missing.delete_Foo(a)
|
||||
18
Examples/test-suite/javascript/integers_runme.js
Normal file
18
Examples/test-suite/javascript/integers_runme.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
var integers = require("integers");
|
||||
|
||||
var val = 3902408827
|
||||
ret = integers.signed_long_identity(val)
|
||||
if (ret != val)
|
||||
throw "Incorrect value: " + ret
|
||||
|
||||
ret = integers.unsigned_long_identity(val)
|
||||
if (ret != val)
|
||||
throw "Incorrect value: " + ret
|
||||
|
||||
ret = integers.signed_long_long_identity(val)
|
||||
if (ret != val)
|
||||
throw "Incorrect value: " + ret
|
||||
|
||||
ret = integers.unsigned_long_long_identity(val)
|
||||
if (ret != val)
|
||||
throw "Incorrect value: " + ret
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
var javascript_lib_arrays = require("javascript_lib_arrays");
|
||||
|
||||
var arr = [1, 2, 3, 4, 5];
|
||||
|
||||
function check(a, b) {
|
||||
if (a !== b) {
|
||||
throw new Error("Not equal: " + a + " " + b)
|
||||
}
|
||||
}
|
||||
|
||||
function check_array(a, b) {
|
||||
if (a.length != b.length)
|
||||
throw new Error("Array length mismatch " + a.length + " " + b.length)
|
||||
if (!a.every(function(element, index) { return element === b[index]; }))
|
||||
throw new Error("Arrays don't match a:" + a + " b:" + b)
|
||||
}
|
||||
|
||||
check(15, javascript_lib_arrays.sum1(arr, arr.length));
|
||||
check(6, javascript_lib_arrays.sum2(arr));
|
||||
check_array([1, 2, 3, 4], javascript_lib_arrays.data3)
|
||||
50
Examples/test-suite/javascript/li_typemaps_runme.js
Normal file
50
Examples/test-suite/javascript/li_typemaps_runme.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
var li_typemaps = require("li_typemaps");
|
||||
|
||||
function check(a, b) {
|
||||
if (a !== b) {
|
||||
throw new Error("Not equal: " + a + " " + b)
|
||||
}
|
||||
}
|
||||
|
||||
function check_array(a, b) {
|
||||
if (a.length != b.length)
|
||||
throw new Error("Array length mismatch " + a.length + " " + b.length)
|
||||
if (!a.every(function(element, index) { return element === b[index]; }))
|
||||
throw new Error("Arrays don't match a:" + a + " b:" + b)
|
||||
}
|
||||
|
||||
// Check double INPUT typemaps
|
||||
check(li_typemaps.in_double(22.22), 22.22)
|
||||
check(li_typemaps.inr_double(22.22), 22.22)
|
||||
|
||||
// Check double OUTPUT typemaps
|
||||
check_array(li_typemaps.out_double(22.22), [22.22])
|
||||
check_array(li_typemaps.outr_double(22.22), [22.22])
|
||||
|
||||
// Check double INOUT typemaps
|
||||
check_array(li_typemaps.inout_double(22.22), [22.22])
|
||||
check_array(li_typemaps.inoutr_double(22.22), [22.22])
|
||||
|
||||
// check long long
|
||||
check(li_typemaps.in_ulonglong(20), 20)
|
||||
check(li_typemaps.inr_ulonglong(20), 20)
|
||||
check_array(li_typemaps.out_ulonglong(20), [20])
|
||||
check_array(li_typemaps.outr_ulonglong(20), [20])
|
||||
check_array(li_typemaps.inout_ulonglong(20), [20])
|
||||
check_array(li_typemaps.inoutr_ulonglong(20), [20])
|
||||
|
||||
// check bools
|
||||
check(li_typemaps.in_bool(true), true)
|
||||
check(li_typemaps.inr_bool(false), false)
|
||||
check_array(li_typemaps.out_bool(true), [true])
|
||||
check_array(li_typemaps.outr_bool(false), [false])
|
||||
check_array(li_typemaps.inout_bool(true), [true])
|
||||
check_array(li_typemaps.inoutr_bool(false), [false])
|
||||
|
||||
// the others
|
||||
check_array(li_typemaps.inoutr_int2(1,2), [1, 2])
|
||||
|
||||
fi = li_typemaps.out_foo(10)
|
||||
check(fi[0].a, 10)
|
||||
check(fi[1], 20)
|
||||
check(fi[2], 30)
|
||||
|
|
@ -37,13 +37,13 @@ check(13, o.byval1cpr(x));
|
|||
// check(15, o.byval2cpr(null));
|
||||
check(16, o.byval2cpr(x));
|
||||
|
||||
// forward class declaration
|
||||
check(17, o.byval1forwardptr(x));
|
||||
// check(18, o.byval1forwardptr(null));
|
||||
// fwd class declaration
|
||||
check(17, o.byval1fwdptr(x));
|
||||
// check(18, o.byval1fwdptr(null));
|
||||
|
||||
// check(19, o.byval2forwardptr(null));
|
||||
check(20, o.byval2forwardptr(x));
|
||||
// check(19, o.byval2fwdptr(null));
|
||||
check(20, o.byval2fwdptr(x));
|
||||
|
||||
check(21, o.byval1forwardref(x));
|
||||
check(21, o.byval1fwdref(x));
|
||||
|
||||
check(22, o.byval2forwardref(x));
|
||||
check(22, o.byval2fwdref(x));
|
||||
|
|
|
|||
14
Examples/test-suite/javascript/types_directive_runme.js
Normal file
14
Examples/test-suite/javascript/types_directive_runme.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
var types_directive = require("types_directive");
|
||||
|
||||
d1 = new types_directive.Time1(2001, 2, 3, 60)
|
||||
// check that a Time1 instance is accepted where Date is expected
|
||||
newDate = types_directive.add(d1, 7)
|
||||
if (newDate.day != 10)
|
||||
throw new Error("newDate mismatch")
|
||||
|
||||
d2 = new types_directive.Time2(1999, 8, 7, 60)
|
||||
// check that a Time2 instance is accepted where Date is expected
|
||||
newDate = types_directive.add(d2, 7)
|
||||
if (newDate.day != 14)
|
||||
throw new Error("newDate mismatch")
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
var virtual_derivation = require("virtual_derivation");
|
||||
//
|
||||
// very innocent example
|
||||
//
|
||||
b = new virtual_derivation.B(3)
|
||||
if (b.get_a() != b.get_b())
|
||||
throw new Error("something is really wrong")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue