new %import test for vector

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12633 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-04-11 21:28:06 +00:00
commit fd666c1440
6 changed files with 32 additions and 2 deletions

View file

@ -516,6 +516,7 @@ C_TEST_CASES += \
MULTI_CPP_TEST_CASES += \
clientdata_prop \
imports \
import_stl \
packageoption \
mod \
template_typedef_import \

View file

@ -0,0 +1,2 @@
import_stl_a
import_stl_b

View file

@ -0,0 +1,5 @@
%module import_stl_a
%include <std_vector.i>
%template(VectorInt) std::vector<int>;

View file

@ -0,0 +1,13 @@
%module import_stl_b
%import "import_stl_a.i"
%inline %{
#include <vector>
std::vector<int> process_vector(const std::vector<int>& v) {
std::vector<int> v_new = v;
v_new.push_back(4);
return v_new;
}
%}

View file

@ -0,0 +1,7 @@
import import_stl_b
import import_stl_a
v_new = import_stl_b.process_vector([1,2,3])
if v_new != (1,2,3,4):
raise RuntimeError, v_new