[ruby] add tests for upcasting std::shared_ptr within std containers.
This commit is contained in:
parent
50e495c453
commit
a84ea749b3
3 changed files with 110 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ CPP_TEST_CASES = \
|
|||
|
||||
CPP11_TEST_CASES = \
|
||||
cpp11_hash_tables \
|
||||
cpp11_shared_ptr_upcast
|
||||
|
||||
C_TEST_CASES += \
|
||||
li_cstring \
|
||||
|
|
|
|||
12
Examples/test-suite/ruby/cpp11_shared_ptr_upcast_runme.rb
Normal file
12
Examples/test-suite/ruby/cpp11_shared_ptr_upcast_runme.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
require 'swig_assert'
|
||||
require 'cpp11_shared_ptr_upcast'
|
||||
|
||||
|
||||
include Cpp11_shared_ptr_upcast
|
||||
|
||||
simple_assert_equal( 7, derived_num(Derived.new(7)) )
|
||||
simple_assert_equal( 7, derived_num([Derived.new(7)]) )
|
||||
simple_assert_equal( 7, derived_num({0 => Derived.new(7)}) )
|
||||
simple_assert_equal(-1, base_num(Derived.new(7)) )
|
||||
simple_assert_equal(-1, base_num([Derived.new(7)]) )
|
||||
simple_assert_equal(-1, base_num({0 => Derived.new(7)}) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue