Updated std::vector, std::pair tests.

Improved swig_gc.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9720 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-04-30 06:37:41 +00:00
commit b2a45de097
3 changed files with 102 additions and 25 deletions

View file

@ -10,17 +10,20 @@
require 'swig_assert'
require 'li_std_pair'
include Li_std_pair
#
# Because of template specializations for pair<int, int>, this should return
# Because of template specializations for pair<int, int>, these should return
# an Array of size 2, where both elements are Fixnums.
#
intPair = makeIntPair(7, 6)
raise RuntimeError unless intPair.instance_of?(Array)
raise RuntimeError unless intPair.size == 2
raise RuntimeError unless (intPair[0] == 7 && intPair[1] == 6)
raise RuntimeError unless intPair[0] == 7 && intPair[1] == 6
intPairConstRef = makeIntPairConstRef(7, 6)
raise RuntimeError unless intPairConstRef.instance_of?(Array)
raise RuntimeError unless intPairConstRef[0] == 7 && intPairConstRef[1] == 6
#
# Each of these should return a reference to a wrapped
@ -28,16 +31,11 @@ raise RuntimeError unless (intPair[0] == 7 && intPair[1] == 6)
#
intPairPtr = makeIntPairPtr(7, 6)
raise RuntimeError unless intPairPtr.instance_of?(IntPair)
raise RuntimeError unless (intPairPtr.first == 7 && intPairPtr.second == 6)
raise RuntimeError unless intPairPtr[0] == 7 && intPairPtr[1] == 6
intPairRef = makeIntPairRef(7, 6)
raise RuntimeError unless intPairRef.instance_of?(IntPair)
raise RuntimeError unless (intPairRef.first == 7 && intPairRef.second == 6)
intPairConstRef = makeIntPairConstRef(7, 6)
raise RuntimeError unless intPairConstRef.instance_of?(IntPair)
raise RuntimeError unless (intPairConstRef.first == 7 && intPairConstRef.second == 6)
raise RuntimeError unless intPairRef[0] == 7 && intPairRef[1] == 6
#
# Now test various input typemaps. Each of the wrapped C++ functions
# (product1, product2 and product3) is expecting an argument of a