From: <wsf...@us...> - 2011-02-19 19:20:43
|
Revision: 12486 http://swig.svn.sourceforge.net/swig/?rev=12486&view=rev Author: wsfulton Date: 2011-02-19 19:20:37 +0000 (Sat, 19 Feb 2011) Log Message: ----------- Additional %varargs and overloading testing Modified Paths: -------------- trunk/Examples/test-suite/python/varargs_overload_runme.py trunk/Examples/test-suite/varargs_overload.i Modified: trunk/Examples/test-suite/python/varargs_overload_runme.py =================================================================== --- trunk/Examples/test-suite/python/varargs_overload_runme.py 2011-02-19 17:20:08 UTC (rev 12485) +++ trunk/Examples/test-suite/python/varargs_overload_runme.py 2011-02-19 19:20:37 UTC (rev 12486) @@ -20,3 +20,12 @@ if varargs_overload.vararg_over3(2, 2.2, "hey") != "2 2.2 hey": raise RuntimeError, "Failed" +if varargs_overload.vararg_over4("Hello") != "Hello": + raise RuntimeError, "Failed" + +if varargs_overload.vararg_over4(123) != "123": + raise RuntimeError, "Failed" + +if varargs_overload.vararg_over4("Hello", 123) != "Hello": + raise RuntimeError, "Failed" + Modified: trunk/Examples/test-suite/varargs_overload.i =================================================================== --- trunk/Examples/test-suite/varargs_overload.i 2011-02-19 17:20:08 UTC (rev 12485) +++ trunk/Examples/test-suite/varargs_overload.i 2011-02-19 19:20:37 UTC (rev 12486) @@ -30,3 +30,15 @@ return buffer; } %} + +%varargs(int mode = 0) vararg_over4; +%inline %{ +const char *vararg_over4(const char *fmt, ...) { + return fmt; +} +const char *vararg_over4(int i) { + static char buffer[256]; + sprintf(buffer, "%d", i); + return buffer; +} +%} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2011-02-20 19:29:56
|
Revision: 12505 http://swig.svn.sourceforge.net/swig/?rev=12505&view=rev Author: wsfulton Date: 2011-02-20 19:29:50 +0000 (Sun, 20 Feb 2011) Log Message: ----------- Solaris warnings/errors testcase fixes Modified Paths: -------------- trunk/Examples/test-suite/member_funcptr_galore.i trunk/Examples/test-suite/member_pointer.i trunk/Examples/test-suite/nested_class.i Modified: trunk/Examples/test-suite/member_funcptr_galore.i =================================================================== --- trunk/Examples/test-suite/member_funcptr_galore.i 2011-02-20 18:37:46 UTC (rev 12504) +++ trunk/Examples/test-suite/member_funcptr_galore.i 2011-02-20 19:29:50 UTC (rev 12505) @@ -3,6 +3,8 @@ %{ #if defined(__SUNPRO_CC) #pragma error_messages (off, badargtype2w) /* Formal argument ... is being passed extern "C" ... */ +#pragma error_messages (off, wbadinit) /* Using extern "C" ... to initialize ... */ +#pragma error_messages (off, wbadasg) /* Assigning extern "C" ... */ #endif %} Modified: trunk/Examples/test-suite/member_pointer.i =================================================================== --- trunk/Examples/test-suite/member_pointer.i 2011-02-20 18:37:46 UTC (rev 12504) +++ trunk/Examples/test-suite/member_pointer.i 2011-02-20 19:29:50 UTC (rev 12505) @@ -3,6 +3,8 @@ %{ #if defined(__SUNPRO_CC) #pragma error_messages (off, badargtype2w) /* Formal argument ... is being passed extern "C" ... */ +#pragma error_messages (off, wbadinit) /* Using extern "C" ... to initialize ... */ +#pragma error_messages (off, wbadasg) /* Assigning extern "C" ... */ #endif %} Modified: trunk/Examples/test-suite/nested_class.i =================================================================== --- trunk/Examples/test-suite/nested_class.i 2011-02-20 18:37:46 UTC (rev 12504) +++ trunk/Examples/test-suite/nested_class.i 2011-02-20 19:29:50 UTC (rev 12505) @@ -39,6 +39,8 @@ }; /////////////////////////////////////////// +#ifdef SWIG +/* some compilers do not accept these */ class { public: Integer a; @@ -47,6 +49,7 @@ struct { Integer b; }; +#endif union { Integer c; @@ -151,6 +154,8 @@ Integer xx; } MultipleInstanceAnonDerived1, MultipleInstanceAnonDerived2, *MultipleInstanceAnonDerived3, MultipleInstanceAnonDerived4[2]; +#ifdef SWIG +/* some compilers do not accept these */ struct : public InnerMultiple { Integer xx; }; @@ -159,6 +164,7 @@ public: Integer yy; }; +#endif /////////////////////////////////////////// typedef struct { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ol...@us...> - 2011-03-14 11:59:09
|
Revision: 12538 http://swig.svn.sourceforge.net/swig/?rev=12538&view=rev Author: olly Date: 2011-03-14 11:58:58 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Simplify test-suite/overload_return_type.i (checked that it still fails before the fix it's a regression test for) and added _runme.php for it. Modified Paths: -------------- trunk/Examples/test-suite/overload_return_type.i Added Paths: ----------- trunk/Examples/test-suite/php/overload_return_type_runme.php Modified: trunk/Examples/test-suite/overload_return_type.i =================================================================== --- trunk/Examples/test-suite/overload_return_type.i 2011-03-14 09:49:27 UTC (rev 12537) +++ trunk/Examples/test-suite/overload_return_type.i 2011-03-14 11:58:58 UTC (rev 12538) @@ -4,17 +4,10 @@ %inline %{ -#include <string> -using namespace std; class A { }; class B { public: - int foo(int x); - A foo(string y); + int foo(int x) { return 0; } + A foo(const char * y) { return A(); } }; %} - -%{ -int B::foo(int x) { return 0; } -A B::foo(string y) { return A(); } -%} Added: trunk/Examples/test-suite/php/overload_return_type_runme.php =================================================================== --- trunk/Examples/test-suite/php/overload_return_type_runme.php (rev 0) +++ trunk/Examples/test-suite/php/overload_return_type_runme.php 2011-03-14 11:58:58 UTC (rev 12538) @@ -0,0 +1,10 @@ +<?php + +require "tests.php"; +require "overload_return_type.php"; + +$b = new B; +check::equal($b->foo(1), 0, ""); +check::classname("A", $b->foo("test")); + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2011-05-02 21:11:22
|
Revision: 12650 http://swig.svn.sourceforge.net/swig/?rev=12650&view=rev Author: ianlancetaylor Date: 2011-05-02 21:11:15 +0000 (Mon, 02 May 2011) Log Message: ----------- Rename varargs_typemap test case to python_varargs_typemap, and move to Python Makefile. Modified Paths: -------------- trunk/Examples/test-suite/common.mk trunk/Examples/test-suite/python/Makefile.in Added Paths: ----------- trunk/Examples/test-suite/python_varargs_typemap.i Removed Paths: ------------- trunk/Examples/test-suite/varargs_typemap.i Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2011-05-02 21:08:17 UTC (rev 12649) +++ trunk/Examples/test-suite/common.mk 2011-05-02 21:11:15 UTC (rev 12650) @@ -511,8 +511,7 @@ typedef_struct \ typemap_subst \ union_parameter \ - unions \ - varargs_typemap + unions # Multi-module C++ test cases . (Can be run individually using make testcase.multicpptest) Modified: trunk/Examples/test-suite/python/Makefile.in =================================================================== --- trunk/Examples/test-suite/python/Makefile.in 2011-05-02 21:08:17 UTC (rev 12649) +++ trunk/Examples/test-suite/python/Makefile.in 2011-05-02 21:11:15 UTC (rev 12650) @@ -76,7 +76,8 @@ file_test \ li_cstring \ li_cwstring \ - python_nondynamic + python_nondynamic \ + python_varargs_typemap # # This test only works with modern C compilers Copied: trunk/Examples/test-suite/python_varargs_typemap.i (from rev 12648, trunk/Examples/test-suite/varargs_typemap.i) =================================================================== --- trunk/Examples/test-suite/python_varargs_typemap.i (rev 0) +++ trunk/Examples/test-suite/python_varargs_typemap.i 2011-05-02 21:11:15 UTC (rev 12650) @@ -0,0 +1,43 @@ +%module python_varargs_typemap + + /* The typemap and action are taken from the "Variable length arguments" + * chapter of the SWIG manual. + */ + +%typemap(in) (...)(char *args[10]) { + int i; + int argc; + for (i = 0; i < 10; i++) args[i] = 0; + argc = PyTuple_Size(varargs); + if (argc > 10) { + PyErr_SetString(PyExc_ValueError,"Too many arguments"); + return NULL; + } + for (i = 0; i < argc; i++) { + PyObject *o = PyTuple_GetItem(varargs,i); + if (!PyString_Check(o)) { + PyErr_SetString(PyExc_ValueError,"Expected a string"); + return NULL; + } + args[i] = PyString_AsString(o); + } + $1 = (void *) args; +} + +%feature("action") testfunc { + char **args = (char **) arg3; + result = testfunc(arg1, arg2, args[0], args[1], args[2], args[3], args[4], + args[5],args[6],args[7],args[8],args[9], NULL); +} + +%inline { +char* testfunc (int arg1, double arg2, ...) +{ + va_list ap; + char *c; + va_start(ap, arg2); + c = va_arg(ap, char*); + va_end(ap); + return c; +} +} Deleted: trunk/Examples/test-suite/varargs_typemap.i =================================================================== --- trunk/Examples/test-suite/varargs_typemap.i 2011-05-02 21:08:17 UTC (rev 12649) +++ trunk/Examples/test-suite/varargs_typemap.i 2011-05-02 21:11:15 UTC (rev 12650) @@ -1,43 +0,0 @@ -%module varargs_typemap - - /* The typemap and action are taken from the "Variable length arguments" - * chapter of the SWIG manual. - */ - -%typemap(in) (...)(char *args[10]) { - int i; - int argc; - for (i = 0; i < 10; i++) args[i] = 0; - argc = PyTuple_Size(varargs); - if (argc > 10) { - PyErr_SetString(PyExc_ValueError,"Too many arguments"); - return NULL; - } - for (i = 0; i < argc; i++) { - PyObject *o = PyTuple_GetItem(varargs,i); - if (!PyString_Check(o)) { - PyErr_SetString(PyExc_ValueError,"Expected a string"); - return NULL; - } - args[i] = PyString_AsString(o); - } - $1 = (void *) args; -} - -%feature("action") testfunc { - char **args = (char **) arg3; - result = testfunc(arg1, arg2, args[0], args[1], args[2], args[3], args[4], - args[5],args[6],args[7],args[8],args[9], NULL); -} - -%inline { -char* testfunc (int arg1, double arg2, ...) -{ - va_list ap; - char *c; - va_start(ap, arg2); - c = va_arg(ap, char*); - va_end(ap); - return c; -} -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ol...@us...> - 2011-05-25 05:19:54
|
Revision: 12715 http://swig.svn.sourceforge.net/swig/?rev=12715&view=rev Author: olly Date: 2011-05-25 05:19:48 +0000 (Wed, 25 May 2011) Log Message: ----------- Add testcase virtual_vs_nonvirtual_base as a regression test for SF#3124665. Modified Paths: -------------- trunk/Examples/test-suite/common.mk Added Paths: ----------- trunk/Examples/test-suite/php/virtual_vs_nonvirtual_base_runme.php trunk/Examples/test-suite/virtual_vs_nonvirtual_base.i Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2011-05-24 23:55:35 UTC (rev 12714) +++ trunk/Examples/test-suite/common.mk 2011-05-25 05:19:48 UTC (rev 12715) @@ -437,6 +437,7 @@ varargs_overload \ virtual_destructor \ virtual_poly \ + virtual_vs_nonvirtual_base \ voidtest \ wallkw \ wrapmacro Added: trunk/Examples/test-suite/php/virtual_vs_nonvirtual_base_runme.php =================================================================== --- trunk/Examples/test-suite/php/virtual_vs_nonvirtual_base_runme.php (rev 0) +++ trunk/Examples/test-suite/php/virtual_vs_nonvirtual_base_runme.php 2011-05-25 05:19:48 UTC (rev 12715) @@ -0,0 +1,11 @@ +<? + +require "tests.php"; +require "virtual_vs_nonvirtual_base.php"; + +$fail = new SimpleClassFail(); +$work = new SimpleClassWork(); + +check::equal($work->getInner()->get(), $fail->getInner()->get(), "should both be 10"); + +?> Added: trunk/Examples/test-suite/virtual_vs_nonvirtual_base.i =================================================================== --- trunk/Examples/test-suite/virtual_vs_nonvirtual_base.i (rev 0) +++ trunk/Examples/test-suite/virtual_vs_nonvirtual_base.i 2011-05-25 05:19:48 UTC (rev 12715) @@ -0,0 +1,48 @@ +%module virtual_vs_nonvirtual_base; +// Regression test for SF#3124665. +%inline { + +class SimpleVirtual +{ + public: + virtual int implementMe() = 0; +}; + +class SimpleNonVirtual +{ + public: + int dummy() { return 0; } +}; + +class SimpleReturnClass +{ + public: + SimpleReturnClass(int i) : value(i) {}; + int get() const { return value; } + private: + int value; +}; + +class SimpleClassFail : public SimpleVirtual +{ + public: + SimpleClassFail() : inner(10) {} + SimpleReturnClass getInner() { return inner; } + + virtual int implementMe() { return 0; } + private: + SimpleReturnClass inner; +}; + +class SimpleClassWork : public SimpleNonVirtual +{ + public: + SimpleClassWork() : inner(10) {} + SimpleReturnClass getInner() { return inner; } + + virtual int implementMe() { return 0; } + private: + SimpleReturnClass inner; +}; + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2011-06-03 06:07:53
|
Revision: 12728 http://swig.svn.sourceforge.net/swig/?rev=12728&view=rev Author: wsfulton Date: 2011-06-03 06:07:46 +0000 (Fri, 03 Jun 2011) Log Message: ----------- rename python_autodoc testcase to autodoc for use with all languages (note it was once called autodoc.i in the python subdirectory) Modified Paths: -------------- trunk/Examples/test-suite/common.mk trunk/Examples/test-suite/python/Makefile.in Added Paths: ----------- trunk/Examples/test-suite/autodoc.i Removed Paths: ------------- trunk/Examples/test-suite/python_autodoc.i Copied: trunk/Examples/test-suite/autodoc.i (from rev 12719, trunk/Examples/test-suite/python_autodoc.i) =================================================================== --- trunk/Examples/test-suite/autodoc.i (rev 0) +++ trunk/Examples/test-suite/autodoc.i 2011-06-03 06:07:46 UTC (rev 12728) @@ -0,0 +1,95 @@ +%module(docstring="hello") python_autodoc + +%feature("autodoc"); + +// especial typemap and its docs +%typemap(in) (int c, int d) "$1 =0; $2 = 0;"; +%typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"; + +// testing for different documentation levels +%feature("autodoc","0") A::func0; // names +%feature("autodoc","1") A::func1; // names + types +%feature("autodoc","2") A::func2; // extended +%feature("autodoc","3") A::func3; // extended + types + +%feature("autodoc","just a string") A::func; // names + +%inline { + + enum Hola { + hi, hello + }; + + struct A + { + A(int a, short b, Hola h) + { + } + + int func(int a) + { + return a; + } + + int func0(int c, int d) + { + return c; + } + + int func1(int c, int d) + { + return c; + } + + int func2(A* c, double d = 2) + { + return 2; + } + + int func3(A* c, double d = 2) + { + return 2; + } + }; +} + + +// deleting typemaps and docs +%typemap(in) (int c, int d) ; +%typemap(doc) (int c, int d); + +// docs for some parameters +%typemap(doc) int a "a: special comment for parameter a"; +%typemap(doc) int b "b: another special comment for parameter b"; + +%callback(1) func_cb; + +%inline { + + struct B + { + B(int a, int b, Hola h) + { + } + + + int func(int c, int d) + { + return c; + } + + }; + + int func(int c, int d) { + return c; + } + + int funcio(int *INOUT) { + return 1; + } + + int func_cb(int c, int d) { + return c; + } + +} Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2011-05-30 14:01:58 UTC (rev 12727) +++ trunk/Examples/test-suite/common.mk 2011-06-03 06:07:46 UTC (rev 12728) @@ -118,6 +118,7 @@ arrays_global \ arrays_global_twodim \ arrays_scope \ + autodoc \ bloody_hell \ bools \ catches \ Modified: trunk/Examples/test-suite/python/Makefile.in =================================================================== --- trunk/Examples/test-suite/python/Makefile.in 2011-05-30 14:01:58 UTC (rev 12727) +++ trunk/Examples/test-suite/python/Makefile.in 2011-06-03 06:07:46 UTC (rev 12728) @@ -58,7 +58,6 @@ primitive_types \ python_abstractbase \ python_append \ - python_autodoc \ python_kwargs \ python_nondynamic \ python_overload_simple_cast \ Deleted: trunk/Examples/test-suite/python_autodoc.i =================================================================== --- trunk/Examples/test-suite/python_autodoc.i 2011-05-30 14:01:58 UTC (rev 12727) +++ trunk/Examples/test-suite/python_autodoc.i 2011-06-03 06:07:46 UTC (rev 12728) @@ -1,95 +0,0 @@ -%module(docstring="hello") python_autodoc - -%feature("autodoc"); - -// especial typemap and its docs -%typemap(in) (int c, int d) "$1 =0; $2 = 0;"; -%typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"; - -// testing for different documentation levels -%feature("autodoc","0") A::func0; // names -%feature("autodoc","1") A::func1; // names + types -%feature("autodoc","2") A::func2; // extended -%feature("autodoc","3") A::func3; // extended + types - -%feature("autodoc","just a string") A::func; // names - -%inline { - - enum Hola { - hi, hello - }; - - struct A - { - A(int a, short b, Hola h) - { - } - - int func(int a) - { - return a; - } - - int func0(int c, int d) - { - return c; - } - - int func1(int c, int d) - { - return c; - } - - int func2(A* c, double d = 2) - { - return 2; - } - - int func3(A* c, double d = 2) - { - return 2; - } - }; -} - - -// deleting typemaps and docs -%typemap(in) (int c, int d) ; -%typemap(doc) (int c, int d); - -// docs for some parameters -%typemap(doc) int a "a: special comment for parameter a"; -%typemap(doc) int b "b: another special comment for parameter b"; - -%callback(1) func_cb; - -%inline { - - struct B - { - B(int a, int b, Hola h) - { - } - - - int func(int c, int d) - { - return c; - } - - }; - - int func(int c, int d) { - return c; - } - - int funcio(int *INOUT) { - return 1; - } - - int func_cb(int c, int d) { - return c; - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2011-12-21 07:18:51
|
Revision: 12880 http://swig.svn.sourceforge.net/swig/?rev=12880&view=rev Author: wsfulton Date: 2011-12-21 07:18:45 +0000 (Wed, 21 Dec 2011) Log Message: ----------- keyword variable workaround in testcase Modified Paths: -------------- trunk/Examples/test-suite/extend_constructor_destructor.i trunk/Examples/test-suite/java/extend_constructor_destructor_runme.java Modified: trunk/Examples/test-suite/extend_constructor_destructor.i =================================================================== --- trunk/Examples/test-suite/extend_constructor_destructor.i 2011-12-21 07:16:44 UTC (rev 12879) +++ trunk/Examples/test-suite/extend_constructor_destructor.i 2011-12-21 07:18:45 UTC (rev 12880) @@ -1,7 +1,7 @@ %module extend_constructor_destructor %inline %{ -int global = 0; +int globalVar = 0; namespace Space { typedef struct tagAStruct { @@ -41,11 +41,11 @@ tagAStruct(int ivar0) { Space::AStruct *s = new Space::AStruct(); s->ivar = ivar0; - global = ivar0; + globalVar = ivar0; return s; } ~tagAStruct() { - global = -$self->ivar; + globalVar = -$self->ivar; delete $self; } } @@ -54,11 +54,11 @@ BStruct(int ivar0) { Space::BStruct *s = new Space::BStruct(); s->ivar = ivar0; - global = ivar0; + globalVar = ivar0; return s; } ~BStruct() { - global = -$self->ivar; + globalVar = -$self->ivar; delete $self; } } @@ -67,11 +67,11 @@ CStruct(int ivar0) { Space::CStruct *s = new Space::CStruct(); s->ivar = ivar0; - global = ivar0; + globalVar = ivar0; return s; } ~CStruct() { - global = -$self->ivar; + globalVar = -$self->ivar; delete $self; } } @@ -80,11 +80,11 @@ DStruct(int ivar0) { Space::DStruct *s = new Space::DStruct(); s->ivar = ivar0; - global = ivar0; + globalVar = ivar0; return s; } ~DStruct() { - global = -$self->ivar; + globalVar = -$self->ivar; delete $self; } } @@ -95,11 +95,11 @@ EStruct(int ivar0) { EStruct *s = new EStruct(); s->ivar = ivar0; - global = ivar0; + globalVar = ivar0; return s; } ~EStruct() { - global = -$self->ivar; + globalVar = -$self->ivar; delete $self; } } @@ -109,11 +109,11 @@ FFStruct(int ivar0) { Space::FFStruct<T> *s = new Space::FFStruct<T>(); s->ivar = ivar0; - global = ivar0; + globalVar = ivar0; return s; } ~FFStruct() { - global = -$self->ivar; + globalVar = -$self->ivar; delete $self; } } Modified: trunk/Examples/test-suite/java/extend_constructor_destructor_runme.java =================================================================== --- trunk/Examples/test-suite/java/extend_constructor_destructor_runme.java 2011-12-21 07:16:44 UTC (rev 12879) +++ trunk/Examples/test-suite/java/extend_constructor_destructor_runme.java 2011-12-21 07:18:45 UTC (rev 12880) @@ -44,7 +44,7 @@ } public static void checkGlobal(int val) { - int global = extend_constructor_destructor.getGlobal(); + int global = extend_constructor_destructor.getGlobalVar(); if (global != val) throw new RuntimeException("global value incorrect. Expected: " + val + " got: " + global); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2012-03-14 19:25:20
|
Revision: 12921 http://swig.svn.sourceforge.net/swig/?rev=12921&view=rev Author: ianlancetaylor Date: 2012-03-14 19:25:14 +0000 (Wed, 14 Mar 2012) Log Message: ----------- Correct test cases to be valid C++ by doing a typedef to the specialized type rather than to the not-visible general template type parameter. Modified Paths: -------------- trunk/Examples/test-suite/template_typemaps_typedef.i trunk/Examples/test-suite/template_typemaps_typedef2.i Modified: trunk/Examples/test-suite/template_typemaps_typedef.i =================================================================== --- trunk/Examples/test-suite/template_typemaps_typedef.i 2012-03-14 19:23:18 UTC (rev 12920) +++ trunk/Examples/test-suite/template_typemaps_typedef.i 2012-03-14 19:25:14 UTC (rev 12921) @@ -48,8 +48,8 @@ namespace Standard { template<> class Multimap<A, int> { public: - typedef Key key_type; - typedef T mapped_type; + typedef A key_type; + typedef int mapped_type; class iterator; Modified: trunk/Examples/test-suite/template_typemaps_typedef2.i =================================================================== --- trunk/Examples/test-suite/template_typemaps_typedef2.i 2012-03-14 19:23:18 UTC (rev 12920) +++ trunk/Examples/test-suite/template_typemaps_typedef2.i 2012-03-14 19:25:14 UTC (rev 12921) @@ -50,8 +50,8 @@ namespace Standard { template<> class Multimap<A, int> { public: - typedef Key key_type; - typedef T mapped_type; + typedef A key_type; + typedef int mapped_type; class iterator; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-03-17 18:37:57
|
Revision: 12927 http://swig.svn.sourceforge.net/swig/?rev=12927&view=rev Author: drjoe Date: 2012-03-17 18:37:51 +0000 (Sat, 17 Mar 2012) Log Message: ----------- add new test case for r to test scalar/vector conflicts Modified Paths: -------------- trunk/Examples/test-suite/r/Makefile.in Added Paths: ----------- trunk/Examples/test-suite/r_overload_array.i Modified: trunk/Examples/test-suite/r/Makefile.in =================================================================== --- trunk/Examples/test-suite/r/Makefile.in 2012-03-16 07:30:14 UTC (rev 12926) +++ trunk/Examples/test-suite/r/Makefile.in 2012-03-17 18:37:51 UTC (rev 12927) @@ -11,7 +11,7 @@ top_builddir = @top_builddir@ C_TEST_CASES = r_copy_struct r_legacy -CPP_TEST_CASES = r_double_delete +CPP_TEST_CASES = r_double_delete r_overload_array include $(srcdir)/../common.mk Added: trunk/Examples/test-suite/r_overload_array.i =================================================================== --- trunk/Examples/test-suite/r_overload_array.i (rev 0) +++ trunk/Examples/test-suite/r_overload_array.i 2012-03-17 18:37:51 UTC (rev 12927) @@ -0,0 +1,16 @@ +%module r_overload_array +%include "stl.i" +# this tests the situation in which there is a scalar function +# corresponding with a vector one + +%inline %{ +class Foo { +public: + double bar(double w) {return w;}; + double bar(double *w) {return w[0];} + double bar(std::vector<double> w) {return w[0];} +}; +%} + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-04-14 21:11:25
|
Revision: 12986 http://swig.svn.sourceforge.net/swig/?rev=12986&view=rev Author: wsfulton Date: 2012-04-14 21:11:19 +0000 (Sat, 14 Apr 2012) Log Message: ----------- As std_list.i is not available in many language, put this python specific test just in Python makefile Modified Paths: -------------- trunk/Examples/test-suite/common.mk trunk/Examples/test-suite/python/Makefile.in Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2012-04-14 20:37:39 UTC (rev 12985) +++ trunk/Examples/test-suite/common.mk 2012-04-14 21:11:19 UTC (rev 12986) @@ -466,7 +466,6 @@ director_string \ ignore_template_constructor \ li_std_combinations \ - li_std_containers_int \ li_std_deque \ li_std_except \ li_std_map \ Modified: trunk/Examples/test-suite/python/Makefile.in =================================================================== --- trunk/Examples/test-suite/python/Makefile.in 2012-04-14 20:37:39 UTC (rev 12985) +++ trunk/Examples/test-suite/python/Makefile.in 2012-04-14 21:11:19 UTC (rev 12986) @@ -46,6 +46,7 @@ li_cwstring \ li_factory \ li_implicit \ + li_std_containers_int \ li_std_map_member \ li_std_multimap \ li_std_pair_extra \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr...@us...> - 2012-04-15 12:54:48
|
Revision: 12990 http://swig.svn.sourceforge.net/swig/?rev=12990&view=rev Author: drjoe Date: 2012-04-15 12:54:42 +0000 (Sun, 15 Apr 2012) Log Message: ----------- add test to confirm fix to sourceforge 3478922 Modified Paths: -------------- trunk/Examples/test-suite/r/Makefile.in Added Paths: ----------- trunk/Examples/test-suite/r/r_base_test_runme.R trunk/Examples/test-suite/r_base_test.i Modified: trunk/Examples/test-suite/r/Makefile.in =================================================================== --- trunk/Examples/test-suite/r/Makefile.in 2012-04-15 12:25:50 UTC (rev 12989) +++ trunk/Examples/test-suite/r/Makefile.in 2012-04-15 12:54:42 UTC (rev 12990) @@ -11,7 +11,7 @@ top_builddir = @top_builddir@ C_TEST_CASES = r_copy_struct r_legacy -CPP_TEST_CASES = r_double_delete r_overload_array +CPP_TEST_CASES = r_double_delete r_overload_array r_base_test include $(srcdir)/../common.mk Added: trunk/Examples/test-suite/r/r_base_test_runme.R =================================================================== --- trunk/Examples/test-suite/r/r_base_test_runme.R (rev 0) +++ trunk/Examples/test-suite/r/r_base_test_runme.R 2012-04-15 12:54:42 UTC (rev 12990) @@ -0,0 +1,13 @@ +source("unittest.R") +dyn.load(paste("r_base_test", .Platform$dynlib.ext, sep="")) +source("r_base_test.R") +cacheMetaData(1) + +b <- Base() +Base_method(b) +Base_overloaded_method(b) +Base_overloaded_method(b, 43) +Base_overloaded_method(b) +b$method() + +b$overloaded_method() Added: trunk/Examples/test-suite/r_base_test.i =================================================================== --- trunk/Examples/test-suite/r_base_test.i (rev 0) +++ trunk/Examples/test-suite/r_base_test.i 2012-04-15 12:54:42 UTC (rev 12990) @@ -0,0 +1,20 @@ +/* This test confirms the fix to sourceforge bug #3478922 */ + +%module r_base_test +%inline %{ +class Base + { + public: + + Base() : x(42) {} + + int method() const { return x; } + + void overloaded_method(int aArg) { x = aArg; } + int overloaded_method() const { return x; } + + private: + + int x; + }; +%} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-04-15 18:11:04
|
Revision: 12992 http://swig.svn.sourceforge.net/swig/?rev=12992&view=rev Author: wsfulton Date: 2012-04-15 18:10:58 +0000 (Sun, 15 Apr 2012) Log Message: ----------- Rename r_base_test to overload_method as it is a useful test for all languages Modified Paths: -------------- trunk/Examples/test-suite/common.mk trunk/Examples/test-suite/r/Makefile.in Added Paths: ----------- trunk/Examples/test-suite/overload_method.i trunk/Examples/test-suite/r/overload_method_runme.R Removed Paths: ------------- trunk/Examples/test-suite/r/r_base_test_runme.R trunk/Examples/test-suite/r_base_test.i Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2012-04-15 17:44:09 UTC (rev 12991) +++ trunk/Examples/test-suite/common.mk 2012-04-15 18:10:58 UTC (rev 12992) @@ -277,6 +277,7 @@ operbool \ ordering \ overload_copy \ + overload_method \ overload_extend \ overload_rename \ overload_return_type \ Copied: trunk/Examples/test-suite/overload_method.i (from rev 12990, trunk/Examples/test-suite/r_base_test.i) =================================================================== --- trunk/Examples/test-suite/overload_method.i (rev 0) +++ trunk/Examples/test-suite/overload_method.i 2012-04-15 18:10:58 UTC (rev 12992) @@ -0,0 +1,20 @@ +/* This test confirms the fix to sourceforge bug #3478922 for R */ + +%module overload_method +%inline %{ +class Base + { + public: + + Base() : x(42) {} + + int method() const { return x; } + + void overloaded_method(int aArg) { x = aArg; } + int overloaded_method() const { return x; } + + private: + + int x; + }; +%} Modified: trunk/Examples/test-suite/r/Makefile.in =================================================================== --- trunk/Examples/test-suite/r/Makefile.in 2012-04-15 17:44:09 UTC (rev 12991) +++ trunk/Examples/test-suite/r/Makefile.in 2012-04-15 18:10:58 UTC (rev 12992) @@ -16,8 +16,7 @@ CPP_TEST_CASES += \ r_double_delete \ - r_overload_array \ - r_base_test + r_overload_array include $(srcdir)/../common.mk Copied: trunk/Examples/test-suite/r/overload_method_runme.R (from rev 12990, trunk/Examples/test-suite/r/r_base_test_runme.R) =================================================================== --- trunk/Examples/test-suite/r/overload_method_runme.R (rev 0) +++ trunk/Examples/test-suite/r/overload_method_runme.R 2012-04-15 18:10:58 UTC (rev 12992) @@ -0,0 +1,13 @@ +source("unittest.R") +dyn.load(paste("overload_method", .Platform$dynlib.ext, sep="")) +source("overload_method.R") +cacheMetaData(1) + +b <- Base() +Base_method(b) +Base_overloaded_method(b) +Base_overloaded_method(b, 43) +Base_overloaded_method(b) +b$method() + +b$overloaded_method() Deleted: trunk/Examples/test-suite/r/r_base_test_runme.R =================================================================== --- trunk/Examples/test-suite/r/r_base_test_runme.R 2012-04-15 17:44:09 UTC (rev 12991) +++ trunk/Examples/test-suite/r/r_base_test_runme.R 2012-04-15 18:10:58 UTC (rev 12992) @@ -1,13 +0,0 @@ -source("unittest.R") -dyn.load(paste("r_base_test", .Platform$dynlib.ext, sep="")) -source("r_base_test.R") -cacheMetaData(1) - -b <- Base() -Base_method(b) -Base_overloaded_method(b) -Base_overloaded_method(b, 43) -Base_overloaded_method(b) -b$method() - -b$overloaded_method() Deleted: trunk/Examples/test-suite/r_base_test.i =================================================================== --- trunk/Examples/test-suite/r_base_test.i 2012-04-15 17:44:09 UTC (rev 12991) +++ trunk/Examples/test-suite/r_base_test.i 2012-04-15 18:10:58 UTC (rev 12992) @@ -1,20 +0,0 @@ -/* This test confirms the fix to sourceforge bug #3478922 */ - -%module r_base_test -%inline %{ -class Base - { - public: - - Base() : x(42) {} - - int method() const { return x; } - - void overloaded_method(int aArg) { x = aArg; } - int overloaded_method() const { return x; } - - private: - - int x; - }; -%} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-04-15 21:56:44
|
Revision: 12993 http://swig.svn.sourceforge.net/swig/?rev=12993&view=rev Author: wsfulton Date: 2012-04-15 21:56:38 +0000 (Sun, 15 Apr 2012) Log Message: ----------- Fix a few warnings/errors in the test-suite using Solaris compiler Modified Paths: -------------- trunk/Examples/test-suite/python/autodoc_runme.py trunk/Examples/test-suite/template_typedef_class_template.i trunk/Examples/test-suite/template_typemaps.i trunk/Examples/test-suite/typedef_struct.i trunk/Examples/test-suite/typemap_various.i Modified: trunk/Examples/test-suite/python/autodoc_runme.py =================================================================== --- trunk/Examples/test-suite/python/autodoc_runme.py 2012-04-15 18:10:58 UTC (rev 12992) +++ trunk/Examples/test-suite/python/autodoc_runme.py 2012-04-15 21:56:38 UTC (rev 12993) @@ -2,7 +2,7 @@ def check(got, expected): if expected != got: - raise RuntimeError("\n" + "Expected: [" + expected + "]\n" + "Got : [" + got + "]") + raise RuntimeError("\n" + "Expected: [" + str(expected) + "]\n" + "Got : [" + str(got) + "]") check(A.__doc__, "Proxy of C++ A class") check(A.funk.__doc__, "just a string") Modified: trunk/Examples/test-suite/template_typedef_class_template.i =================================================================== --- trunk/Examples/test-suite/template_typedef_class_template.i 2012-04-15 18:10:58 UTC (rev 12992) +++ trunk/Examples/test-suite/template_typedef_class_template.i 2012-04-15 21:56:38 UTC (rev 12993) @@ -24,8 +24,8 @@ class const_iterator {}; // test usage of a typedef of a nested class in a template - Standard::Pair<iterator,iterator> equal_range_1(const key_type& kt1) {} - Standard::Pair<const_iterator,const_iterator> equal_range_2(const key_type& kt2) const {} + Standard::Pair<iterator,iterator> equal_range_1(const key_type& kt1) { return Standard::Pair<iterator,iterator>(); } + Standard::Pair<const_iterator,const_iterator> equal_range_2(const key_type& kt2) const { return Standard::Pair<const_iterator,const_iterator>(); } }; } %} Modified: trunk/Examples/test-suite/template_typemaps.i =================================================================== --- trunk/Examples/test-suite/template_typemaps.i 2012-04-15 18:10:58 UTC (rev 12992) +++ trunk/Examples/test-suite/template_typemaps.i 2012-04-15 21:56:38 UTC (rev 12993) @@ -3,6 +3,7 @@ %typemap(in) Integer1 { + $1 = 0; /* do nothing */ } @@ -13,6 +14,7 @@ %typemap(in) Integer2 { + $1 = 0; /* do nothing */ } Modified: trunk/Examples/test-suite/typedef_struct.i =================================================================== --- trunk/Examples/test-suite/typedef_struct.i 2012-04-15 18:10:58 UTC (rev 12992) +++ trunk/Examples/test-suite/typedef_struct.i 2012-04-15 21:56:38 UTC (rev 12993) @@ -45,10 +45,18 @@ %inline %{ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _Foo { enum { NONAME1, NONAME2 } enumvar; int foovar; void (*fptr)(int); } Foo; +#ifdef __cplusplus +} +#endif + %} Modified: trunk/Examples/test-suite/typemap_various.i =================================================================== --- trunk/Examples/test-suite/typemap_various.i 2012-04-15 18:10:58 UTC (rev 12992) +++ trunk/Examples/test-suite/typemap_various.i 2012-04-15 21:56:38 UTC (rev 12993) @@ -65,10 +65,10 @@ %typemap(out) double ABC::_3 "$1 = 0.0;" %inline %{ struct ABC { - double meth() {} - double m1() {} - double _x2() {} - double y_() {} - double _3() {} + double meth() { return 0.0; } + double m1() { return 0.0; } + double _x2() { return 0.0; } + double y_() { return 0.0; } + double _3() { return 0.0; } }; %} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-04-16 18:45:40
|
Revision: 12996 http://swig.svn.sourceforge.net/swig/?rev=12996&view=rev Author: wsfulton Date: 2012-04-16 18:45:33 +0000 (Mon, 16 Apr 2012) Log Message: ----------- Some test-suite fixes for visual studio Modified Paths: -------------- trunk/Examples/test-suite/director_binary_string.i trunk/Examples/test-suite/operator_pointer_ref.i trunk/Examples/test-suite/refcount.i trunk/Examples/test-suite/special_variable_macros.i Modified: trunk/Examples/test-suite/director_binary_string.i =================================================================== --- trunk/Examples/test-suite/director_binary_string.i 2012-04-15 22:47:38 UTC (rev 12995) +++ trunk/Examples/test-suite/director_binary_string.i 2012-04-16 18:45:33 UTC (rev 12996) @@ -29,12 +29,12 @@ void delCallback() { delete _callback; _callback = 0; } void setCallback(Callback *cb) { delCallback(); _callback = cb; } int call() { + int sum = 0; if (_callback) { char* aa = (char*)malloc(BUFFER_SIZE_AA); memset(aa, 9, BUFFER_SIZE_AA); char* bb = (char*)malloc(BUFFER_SIZE_BB); memset(bb, 13, BUFFER_SIZE_BB); - int sum = 0; _callback->run(aa, BUFFER_SIZE_AA, bb, BUFFER_SIZE_BB); for (int i = 0; i < BUFFER_SIZE_AA; i++) sum += aa[i]; @@ -42,8 +42,8 @@ sum += bb[i]; free(aa); free(bb); - return sum; } + return sum; } }; Modified: trunk/Examples/test-suite/operator_pointer_ref.i =================================================================== --- trunk/Examples/test-suite/operator_pointer_ref.i 2012-04-15 22:47:38 UTC (rev 12995) +++ trunk/Examples/test-suite/operator_pointer_ref.i 2012-04-16 18:45:33 UTC (rev 12996) @@ -1,5 +1,11 @@ %module operator_pointer_ref +%{ +#if defined(_MSC_VER) + #pragma warning(disable: 4996) // 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. +#endif +%} + %rename(AsCharStarRef) operator char*&; %inline %{ Modified: trunk/Examples/test-suite/refcount.i =================================================================== --- trunk/Examples/test-suite/refcount.i 2012-04-15 22:47:38 UTC (rev 12995) +++ trunk/Examples/test-suite/refcount.i 2012-04-16 18:45:33 UTC (rev 12996) @@ -97,7 +97,7 @@ RCPtr<A> _a; }; -class B* global_create(A* a) +struct B* global_create(A* a) { return new B(a); } Modified: trunk/Examples/test-suite/special_variable_macros.i =================================================================== --- trunk/Examples/test-suite/special_variable_macros.i 2012-04-15 22:47:38 UTC (rev 12995) +++ trunk/Examples/test-suite/special_variable_macros.i 2012-04-16 18:45:33 UTC (rev 12996) @@ -5,6 +5,12 @@ %warnfilter(SWIGWARN_GO_NAME_CONFLICT); /* Ignoring 'NewName' due to Go name ('NewName') conflict with 'Name' */ +%{ +#if defined(_MSC_VER) + #pragma warning(disable: 4996) // 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. +#endif +%} + %ignore Name::operator=; %inline %{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-08-13 21:59:22
|
Revision: 13607 http://swig.svn.sourceforge.net/swig/?rev=13607&view=rev Author: wsfulton Date: 2012-08-13 21:59:14 +0000 (Mon, 13 Aug 2012) Log Message: ----------- Fix additio of assumeoverride testcase Modified Paths: -------------- trunk/Examples/test-suite/common.mk trunk/Examples/test-suite/java/Makefile.in Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2012-08-13 21:41:08 UTC (rev 13606) +++ trunk/Examples/test-suite/common.mk 2012-08-13 21:59:14 UTC (rev 13607) @@ -161,7 +161,6 @@ destructor_reprotected \ director_abstract \ director_alternating \ - director_assumeoverride \ director_basic \ director_binary_string \ director_classes \ Modified: trunk/Examples/test-suite/java/Makefile.in =================================================================== --- trunk/Examples/test-suite/java/Makefile.in 2012-08-13 21:41:08 UTC (rev 13606) +++ trunk/Examples/test-suite/java/Makefile.in 2012-08-13 21:59:14 UTC (rev 13607) @@ -23,6 +23,7 @@ intermediary_classname \ java_constants \ java_director \ + java_director_assumeoverride \ java_enums \ java_lib_arrays_dimensionless \ java_lib_various \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-09-13 20:15:09
|
Revision: 13839 http://swig.svn.sourceforge.net/swig/?rev=13839&view=rev Author: wsfulton Date: 2012-09-13 20:15:03 +0000 (Thu, 13 Sep 2012) Log Message: ----------- Add a testcase for the Curiously Recurring Template Pattern - CRTP Modified Paths: -------------- trunk/Examples/test-suite/common.mk Added Paths: ----------- trunk/Examples/test-suite/curiously_recurring_template_pattern.i trunk/Examples/test-suite/java/curiously_recurring_template_pattern_runme.java Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2012-09-13 19:18:25 UTC (rev 13838) +++ trunk/Examples/test-suite/common.mk 2012-09-13 20:15:03 UTC (rev 13839) @@ -152,6 +152,7 @@ cpp_nodefault \ cpp_static \ cpp_typedef \ + curiously_recurring_template_pattern \ default_args \ default_arg_values \ default_constructor \ Added: trunk/Examples/test-suite/curiously_recurring_template_pattern.i =================================================================== --- trunk/Examples/test-suite/curiously_recurring_template_pattern.i (rev 0) +++ trunk/Examples/test-suite/curiously_recurring_template_pattern.i 2012-09-13 20:15:03 UTC (rev 13839) @@ -0,0 +1,55 @@ +%module curiously_recurring_template_pattern + +// Test Curiously Recurring Template Pattern - CRTP + +%inline %{ +template <typename T> class Base { + int base1Param; + int base2Param; +public: + Base() : base1Param(0) {} + int getBase1Param() { + return base1Param; + } + T& setBase1Param(int value) { + base1Param = value; + return *static_cast<T*>(this); + } + int getBase2Param() { + return base2Param; + } + T& setBase2Param(int value) { + base2Param = value; + return *static_cast<T*>(this); + } + virtual ~Base() {} +}; +%} + +%template(basederived) Base<Derived>; + +%inline %{ +class Derived : public Base<Derived> { + int derived1Param; + int derived2Param; +public: + Derived() : derived1Param(0), derived2Param(0) {} + int getDerived1Param() { + return derived1Param; + } + Derived& setDerived1Param(int value) { + derived1Param = value; + return *this; + } + int getDerived2Param() { + return derived2Param; + } + Derived& setDerived2Param(int value) { + derived2Param = value; + return *this; + } +}; +%} + + + Added: trunk/Examples/test-suite/java/curiously_recurring_template_pattern_runme.java =================================================================== --- trunk/Examples/test-suite/java/curiously_recurring_template_pattern_runme.java (rev 0) +++ trunk/Examples/test-suite/java/curiously_recurring_template_pattern_runme.java 2012-09-13 20:15:03 UTC (rev 13839) @@ -0,0 +1,29 @@ + +import curiously_recurring_template_pattern.*; + +public class curiously_recurring_template_pattern_runme { + + static { + try { + System.loadLibrary("curiously_recurring_template_pattern"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); + System.exit(1); + } + } + + public static void main(String argv[]) { + Derived d = new Derived(); + d.setBase1Param(1).setDerived1Param(10).setDerived2Param(20).setBase2Param(2); + + if (d.getBase1Param() != 1) + throw new RuntimeException("fail"); + if (d.getDerived1Param() != 10) + throw new RuntimeException("fail"); + if (d.getBase2Param() != 2) + throw new RuntimeException("fail"); + if (d.getDerived2Param() != 20) + throw new RuntimeException("fail"); + } +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-10-26 19:32:26
|
Revision: 13872 http://swig.svn.sourceforge.net/swig/?rev=13872&view=rev Author: wsfulton Date: 2012-10-26 19:32:19 +0000 (Fri, 26 Oct 2012) Log Message: ----------- New director test highlighting a proble in Go Modified Paths: -------------- trunk/Examples/test-suite/common.mk Added Paths: ----------- trunk/Examples/test-suite/director_overload2.i Modified: trunk/Examples/test-suite/common.mk =================================================================== --- trunk/Examples/test-suite/common.mk 2012-10-11 19:28:02 UTC (rev 13871) +++ trunk/Examples/test-suite/common.mk 2012-10-26 19:32:19 UTC (rev 13872) @@ -180,6 +180,7 @@ director_nspace \ director_nested \ director_overload \ + director_overload2 \ director_primitives \ director_protected \ director_protected_overloaded \ Added: trunk/Examples/test-suite/director_overload2.i =================================================================== --- trunk/Examples/test-suite/director_overload2.i (rev 0) +++ trunk/Examples/test-suite/director_overload2.i 2012-10-26 19:32:19 UTC (rev 13872) @@ -0,0 +1,22 @@ +%module(directors="1") director_overload2 + +%feature("director"); + + +%inline %{ +struct OverloadBase { + virtual ~OverloadBase() {} + virtual void mmm() {} + virtual void nnn(int vvv) {} + virtual void nnn() {} +}; +struct OverloadDerived1 : OverloadBase { + virtual void nnn(int vvv) {} +// virtual void nnn() {} +}; +struct OverloadDerived2 : OverloadBase { +// virtual void nnn(int vvv) {} + virtual void nnn() {} +}; +%} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-11-13 22:18:02
|
Revision: 13880 http://swig.svn.sourceforge.net/swig/?rev=13880&view=rev Author: wsfulton Date: 2012-11-13 22:17:55 +0000 (Tue, 13 Nov 2012) Log Message: ----------- Tweak test so it works if test-suite is run using -copyctor Modified Paths: -------------- trunk/Examples/test-suite/java/java_prepost_runme.java trunk/Examples/test-suite/java_prepost.i Modified: trunk/Examples/test-suite/java/java_prepost_runme.java =================================================================== --- trunk/Examples/test-suite/java/java_prepost_runme.java 2012-11-13 22:17:10 UTC (rev 13879) +++ trunk/Examples/test-suite/java/java_prepost_runme.java 2012-11-13 22:17:55 UTC (rev 13880) @@ -16,7 +16,7 @@ { // ensure checked exception is generated try { - PrePostThrows ppt = new PrePostThrows(null); + PrePostThrows ppt = new PrePostThrows(null, true); } catch (InstantiationException e) { } } Modified: trunk/Examples/test-suite/java_prepost.i =================================================================== --- trunk/Examples/test-suite/java_prepost.i 2012-11-13 22:17:10 UTC (rev 13879) +++ trunk/Examples/test-suite/java_prepost.i 2012-11-13 22:17:55 UTC (rev 13880) @@ -83,7 +83,7 @@ %inline %{ struct PrePostThrows { - PrePostThrows(PrePostTest *ppt) { + PrePostThrows(PrePostTest *ppt, bool) { } }; %} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wsf...@us...> - 2012-12-08 10:37:11
|
Revision: 13950 http://swig.svn.sourceforge.net/swig/?rev=13950&view=rev Author: wsfulton Date: 2012-12-08 10:37:04 +0000 (Sat, 08 Dec 2012) Log Message: ----------- Add runtime test for %implicitconv Modified Paths: -------------- trunk/Examples/test-suite/implicittest.i Added Paths: ----------- trunk/Examples/test-suite/python/implicittest_runme.py Modified: trunk/Examples/test-suite/implicittest.i =================================================================== --- trunk/Examples/test-suite/implicittest.i 2012-12-07 07:38:24 UTC (rev 13949) +++ trunk/Examples/test-suite/implicittest.i 2012-12-08 10:37:04 UTC (rev 13950) @@ -18,7 +18,6 @@ explicit A(char *s) { ii = 4; } int get() const { return ii; } - }; int get(const A& a) { return a.ii; } @@ -33,7 +32,7 @@ explicit A_T(char *s) { ii = 4; } int get() const { return ii; } - + static int sget(const A_T& a) { return a.ii; } }; } Added: trunk/Examples/test-suite/python/implicittest_runme.py =================================================================== --- trunk/Examples/test-suite/python/implicittest_runme.py (rev 0) +++ trunk/Examples/test-suite/python/implicittest_runme.py 2012-12-08 10:37:04 UTC (rev 13950) @@ -0,0 +1,73 @@ +from implicittest import * + +def check(a, b): + if a != b: + raise RuntimeError(str(a) + " does not equal " + str(b)) + +#### Class #### + +# No implicit conversion +check(1, A(1).get()) +check(2, A(1.0).get()) +check(3, A(B()).get()) +check(4, A("hello").get()) + +check(1, get(1)) +check(2, get(1.0)) +check(3, get(B())) + +# Explicit constructor: +try: + check(4, get("hello")) + raise RuntimeError +except TypeError: + pass + +#### Template Class #### + +# No implicit conversion +check(1, A_int(1).get()) +check(2, A_int(1.0).get()) +check(3, A_int(B()).get()) +check(4, A_int("hello").get()) + +check(1, A_int.sget(1)) +check(2, A_int.sget(1.0)) +check(3, A_int.sget(B())) + +# explicit constructor: +try: + check(4, A_int.sget("hello")) + raise RuntimeError +except TypeError: + pass + +#### Global variable assignment #### + +cvar.foo = Foo(1); check(cvar.foo.ii, 1) +cvar.foo = 1; check(cvar.foo.ii, 1) +cvar.foo = 1.0; check(cvar.foo.ii, 2) +cvar.foo = Foo("hello"); check(cvar.foo.ii, 3) + +# explicit constructor: +try: + cvar.foo = "hello" + raise RuntimeError +except TypeError: + pass + +#### Member variable assignment #### +# Note: also needs naturalvar + +b = Bar(); check(b.f.ii, 0) +b.f = Foo("hello"); check(b.f.ii, 3) +b.f = 1; check(b.f.ii, 1) +b.f = 1.0; check(b.f.ii, 2) + +# explicit constructor: +try: + b.f = "hello" + raise RuntimeError +except TypeError: + pass + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |