Skip to content

Commit

Permalink
%shared_ptr and %template testcase modified to work for python -O
Browse files Browse the repository at this point in the history
Testcase has now been modified to mask the problem by providing the default parameter 'int' in:
%shared_ptr(Space::BaseDefault<short, int>)
If this is not done then d fails to convert to BaseDefault<short>&

This needs fixing in SWIG, but the problem is masked for now, so that the python
testcase works when run with the -O option.
  • Loading branch information
wsfulton committed Jun 21, 2016
1 parent 38cda92 commit 3459099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Examples/test-suite/li_boost_shared_ptr_template.i
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ INTEGER bar_getter(Base<INTEGER>& foo) {
// 2nd test - templates with default template parameters
#if defined(SHARED_PTR_WRAPPERS_IMPLEMENTED)

%shared_ptr(Space::BaseDefault<short>)
%shared_ptr(Space::BaseDefault<short, int>)
%shared_ptr(Space::DerivedDefault<short>)
%shared_ptr(Space::DerivedDefault2<short>)

Expand Down
13 changes: 8 additions & 5 deletions Examples/test-suite/python/li_boost_shared_ptr_template_runme.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
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<short, int>)
# If this is not done then d fails to convert to BaseDefault<short>&
if bar2_getter(d) != 4:
raise RuntimeError
if bar2_getter(d2) != 4:
raise RuntimeError

0 comments on commit 3459099

Please sign in to comment.