From: Marcelo M. <mar...@us...> - 2004-12-21 07:11:07
|
Update of /cvsroot/swig/SWIG/Examples/test-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17491 Modified Files: global_vars.i smart_pointer_member.i template_default.i Log Message: adding more cases Index: template_default.i =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/test-suite/template_default.i,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** template_default.i 20 Dec 2004 21:23:10 -0000 1.4 --- template_default.i 21 Dec 2004 07:10:54 -0000 1.5 *************** *** 179,187 **** typedef CTemplate<CFoo> TBla; // OK typedef void (*TFunc1)(CFoo arg); // OK ! typedef void (*TFunc2)(CTemplate<CFoo> arg); // crashes SWIG ! typedef void (*TFunc3)(CTemplate<CFoo>* arg); // crashes SWIG ! int foo(TFunc1 a, TFunc2 b, TFunc3 c); } %} --- 179,204 ---- typedef CTemplate<CFoo> TBla; // OK typedef void (*TFunc1)(CFoo arg); // OK ! typedef void (*TFunc2)(CTemplate<CFoo> arg); // OK ! typedef void (*TFunc3)(CTemplate<CFoo>* arg); // OK int foo(TFunc1 a, TFunc2 b, TFunc3 c); } %} + + + %include std_vector.i + + %{ + #include <vector> + %} + + %inline %{ + void g(std::vector<double>* s = 0) {} + void q(double = 0) {} + %} + + + %constant void (*Bf)(std::vector<double> *p = 0) = g; + %constant void (*Cf)(double = 0) = q; + + Index: global_vars.i =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/test-suite/global_vars.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** global_vars.i 19 Dec 2004 04:34:42 -0000 1.1 --- global_vars.i 21 Dec 2004 07:10:53 -0000 1.2 *************** *** 3,12 **** %inline %{ - struct A { int x; ! }; ! A a; --- 3,10 ---- %inline %{ struct A { int x; ! }; A a; *************** *** 17,22 **** int x; int *xp; void *vp; - %} --- 15,26 ---- int x; int *xp; + int& c = x; + void *vp; + enum Hello { Hi, Hola }; + + Hello h; + Hello *hp; + Hello &hr = h; %} Index: smart_pointer_member.i =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/test-suite/smart_pointer_member.i,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** smart_pointer_member.i 16 Dec 2004 02:11:59 -0000 1.5 --- smart_pointer_member.i 21 Dec 2004 07:10:54 -0000 1.6 *************** *** 10,16 **** int y; static const int z; static int boo() { return 0;} - }; --- 10,17 ---- int y; static const int z; + static const int zz = 3; + static int zx; static int boo() { return 0;} }; *************** *** 50,52 **** --- 51,55 ---- %{ const int Foo::z = 3; + const int Foo::zz; + int Foo::zx; %} |