Python STL container method overloading fix
Fix method overloading of methods that take STL containers of different types. Due to some error handling that was not cleared during typehecking.
This commit is contained in:
parent
87bf8ae7aa
commit
86cb3a9532
9 changed files with 200 additions and 24 deletions
44
Examples/test-suite/ruby/li_std_containers_overload_runme.rb
Normal file
44
Examples/test-suite/ruby/li_std_containers_overload_runme.rb
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Put description here
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
require 'swig_assert'
|
||||
|
||||
require 'li_std_containers_overload'
|
||||
|
||||
include Li_std_containers_overload
|
||||
|
||||
def check(got, expected)
|
||||
if (got != expected)
|
||||
raise RuntimeError, "Failed check. '#{got}' != '#{expected}'"
|
||||
end
|
||||
end
|
||||
|
||||
v = VectorX.new()
|
||||
check(VectorOverload(v), "vector<X>")
|
||||
|
||||
v = VectorY.new()
|
||||
check(VectorOverload(v), "vector<Y>")
|
||||
|
||||
v = VectorInt.new()
|
||||
check(VectorOverload(v), "vector<int>")
|
||||
|
||||
v = VectorString.new()
|
||||
check(VectorOverload(v), "vector<string>")
|
||||
|
||||
v = [X.new()]
|
||||
check(VectorOverload(v), "vector<X>")
|
||||
|
||||
v = [Y.new()]
|
||||
check(VectorOverload(v), "vector<Y>")
|
||||
|
||||
v = [1, 2, 3]
|
||||
check(VectorOverload(v), "vector<int>")
|
||||
|
||||
v = ["aaa", "bbb", "ccc"]
|
||||
check(VectorOverload(v), "vector<string>")
|
||||
Loading…
Add table
Add a link
Reference in a new issue