change stream test name, plus more tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6791 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6c5b430226
commit
2da2e15a53
9 changed files with 32 additions and 12 deletions
|
|
@ -405,3 +405,4 @@ voidtest.py
|
||||||
voidtest_runme.py
|
voidtest_runme.py
|
||||||
wrapmacro.py
|
wrapmacro.py
|
||||||
wrapmacro_runme.py
|
wrapmacro_runme.py
|
||||||
|
li_std_stream.py
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ CPP_TEST_CASES += \
|
||||||
li_std_except \
|
li_std_except \
|
||||||
li_std_vectora \
|
li_std_vectora \
|
||||||
li_std_map \
|
li_std_map \
|
||||||
|
li_std_stream \
|
||||||
li_std_wstring \
|
li_std_wstring \
|
||||||
nondynamic \
|
nondynamic \
|
||||||
primitive_types \
|
primitive_types \
|
||||||
|
|
|
||||||
|
|
@ -97,5 +97,4 @@ del_gg = dc.delete_GG
|
||||||
|
|
||||||
import default_constructor
|
import default_constructor
|
||||||
hh = default_constructor.HH(1,1)
|
hh = default_constructor.HH(1,1)
|
||||||
print hh
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ struct A{
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
%template(pairii) pair<int, int>;
|
%template(pairii) pair<int, int>;
|
||||||
|
%template(pairAA) pair<int, A>;
|
||||||
%template(pairA) pair<int, A*>;
|
%template(pairA) pair<int, A*>;
|
||||||
%template(mapA) map<int, A*>;
|
%template(mapA) map<int, A*>;
|
||||||
%template(mmapA) multimap<int, A*>;
|
%template(mmapA) multimap<int, A*>;
|
||||||
|
|
|
||||||
|
|
@ -191,3 +191,11 @@ std::pair<int, int>
|
||||||
#endif
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
%template(paircA1) pair<const int, A*>;
|
||||||
|
%template(paircA2) pair<const int, const A*>;
|
||||||
|
%template(pairiiA) pair<int,pair<int, A*> >;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,3 +47,13 @@ p3 = li_std_pair.pairP3(a,a)
|
||||||
if a.val != li_std_pair.p_identa(p1.this)[1].val:
|
if a.val != li_std_pair.p_identa(p1.this)[1].val:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
p = li_std_pair.IntPair(1,10)
|
||||||
|
p.first = 1
|
||||||
|
|
||||||
|
p = li_std_pair.paircA1(1,a)
|
||||||
|
print 'f', p.first
|
||||||
|
print 's', p.second
|
||||||
|
|
||||||
|
p = li_std_pair.paircA2(1,a)
|
||||||
|
pp = li_std_pair.pairiiA(1,p)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%module lib_std_stream
|
%module li_std_stream
|
||||||
|
|
||||||
%include <std_iostream.i>
|
%include <std_iostream.i>
|
||||||
|
|
||||||
10
SWIG/Examples/test-suite/python/li_std_stream_runme.py
Normal file
10
SWIG/Examples/test-suite/python/li_std_stream_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import li_std_stream as std
|
||||||
|
|
||||||
|
std.cout << 2345 << " " << 1.435 << std.endl
|
||||||
|
std.endl(std.cout)
|
||||||
|
|
||||||
|
|
||||||
|
a = std.A()
|
||||||
|
|
||||||
|
a.bar(2)
|
||||||
|
a.foo(4, a.bar)
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import lib_std_stream as std
|
|
||||||
|
|
||||||
std.cout << 2345 << " " << 1.435 << std.endl
|
|
||||||
std.endl(std.cout)
|
|
||||||
print "hello"
|
|
||||||
|
|
||||||
a = std.A()
|
|
||||||
|
|
||||||
print a.bar(2)
|
|
||||||
print a.foo(4, a.bar)
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue