From 3459099fb812cf93d69bbe4ba19a6fd043007264 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 21 Jun 2016 19:49:27 +0100 Subject: [PATCH] %shared_ptr and %template testcase modified to work for python -O Testcase has now been modified to mask the problem by providing the default parameter 'int' in: %shared_ptr(Space::BaseDefault) If this is not done then d fails to convert to BaseDefault& This needs fixing in SWIG, but the problem is masked for now, so that the python testcase works when run with the -O option. --- Examples/test-suite/li_boost_shared_ptr_template.i | 2 +- .../python/li_boost_shared_ptr_template_runme.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Examples/test-suite/li_boost_shared_ptr_template.i b/Examples/test-suite/li_boost_shared_ptr_template.i index e3b735c24..3965a976e 100644 --- a/Examples/test-suite/li_boost_shared_ptr_template.i +++ b/Examples/test-suite/li_boost_shared_ptr_template.i @@ -67,7 +67,7 @@ INTEGER bar_getter(Base& foo) { // 2nd test - templates with default template parameters #if defined(SHARED_PTR_WRAPPERS_IMPLEMENTED) -%shared_ptr(Space::BaseDefault) +%shared_ptr(Space::BaseDefault) %shared_ptr(Space::DerivedDefault) %shared_ptr(Space::DerivedDefault2) diff --git a/Examples/test-suite/python/li_boost_shared_ptr_template_runme.py b/Examples/test-suite/python/li_boost_shared_ptr_template_runme.py index f35026745..eab7e282a 100644 --- a/Examples/test-suite/python/li_boost_shared_ptr_template_runme.py +++ b/Examples/test-suite/python/li_boost_shared_ptr_template_runme.py @@ -22,8 +22,11 @@ if d2.bar2() != 4: raise RuntimeError if bar2_getter(b) != 3: raise RuntimeError -# Fix reverted in rev 12953 -# if bar2_getter(d) != 4: -# raise RuntimeError -# if bar2_getter(d2) != 4: -# raise RuntimeError +# SWIG fix reverted in Subversion rev 12953 +# Testcase has now been modified to mask the problem by providing the default parameter 'int' in: +# %shared_ptr(Space::BaseDefault) +# If this is not done then d fails to convert to BaseDefault& +if bar2_getter(d) != 4: + raise RuntimeError +if bar2_getter(d2) != 4: + raise RuntimeError