Use different capsule names with and without -builtin
Types generated with and without -builtin are not compatible. Mixing them in a common type list leads to crashes. Avoid this by using different capsule names: "type_pointer_capsule" without -builtin and "type_pointer_capsule_builtin" with. See #1684
This commit is contained in:
parent
b819363117
commit
f733efd3c0
9 changed files with 51 additions and 4 deletions
|
|
@ -93,6 +93,9 @@ C_TEST_CASES += \
|
|||
python_nondynamic \
|
||||
python_varargs_typemap \
|
||||
|
||||
MULTI_CPP_TEST_CASES += \
|
||||
python_runtime_data \
|
||||
|
||||
include $(srcdir)/../common.mk
|
||||
|
||||
# Overridden variables here
|
||||
|
|
@ -102,6 +105,10 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
|
|||
# Custom tests - tests with additional commandline options
|
||||
#python_flatstaticmethod.cpptest: SWIGOPT += -flatstaticmethod
|
||||
|
||||
python_runtime_data.multicpptest: override SWIG_FEATURES := $(filter-out -builtin,$(SWIG_FEATURES))
|
||||
python_runtime_data.multicpptest: override SWIGOPT := $(filter-out -builtin,$(SWIGOPT))
|
||||
python_runtime_data.multicpptest: export SWIGOPT_python_runtime_data_builtin = $(SWIGOPT) -builtin
|
||||
|
||||
# Rules for the different types of tests
|
||||
%.cpptest:
|
||||
$(setup)
|
||||
|
|
@ -149,7 +156,7 @@ clean:
|
|||
rm -f hugemod.h hugemod_a.i hugemod_b.i hugemod_a.py hugemod_b.py hugemod_runme.py
|
||||
rm -f imports_a.py imports_b.py mod_a.py mod_b.py multi_import_a.py
|
||||
rm -f multi_import_b.py multi_import_d.py packageoption_a.py packageoption_b.py packageoption_c.py
|
||||
rm -f template_typedef_cplx2.py
|
||||
rm -f template_typedef_cplx2.py python_runtime_data_builtin.py python_runtime_data_nobuiltin.py
|
||||
|
||||
hugemod_runme = hugemod$(SCRIPTPREFIX)
|
||||
|
||||
|
|
|
|||
11
Examples/test-suite/python/python_runtime_data_runme.py
Normal file
11
Examples/test-suite/python/python_runtime_data_runme.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import python_runtime_data_builtin as builtin
|
||||
import python_runtime_data_nobuiltin as nobuiltin
|
||||
|
||||
assert builtin.is_python_builtin()
|
||||
assert not nobuiltin.is_python_builtin()
|
||||
|
||||
for i in range(1, 5):
|
||||
v1 = builtin.vectord([1.] * i)
|
||||
assert len(v1) == i
|
||||
v2 = nobuiltin.vectord([1.] * i)
|
||||
assert len(v2) == i
|
||||
Loading…
Add table
Add a link
Reference in a new issue