diff --git a/Examples/test-suite/import_nomodule.i b/Examples/test-suite/import_nomodule.i index 37407ce33..a2bc4b9bd 100644 --- a/Examples/test-suite/import_nomodule.i +++ b/Examples/test-suite/import_nomodule.i @@ -23,6 +23,10 @@ Foo *create_Foo() { return new Foo(); } +void delete_Foo(Foo *f) { + delete f; +} + void test1(Foo *f, Integer x) { } class Bar : public Foo { }; diff --git a/Examples/test-suite/inherit_missing.i b/Examples/test-suite/inherit_missing.i index 2a9ec7b67..e38a6c8dd 100644 --- a/Examples/test-suite/inherit_missing.i +++ b/Examples/test-suite/inherit_missing.i @@ -40,6 +40,10 @@ Foo *new_Foo() { return new Foo(); } +void delete_Foo(Foo *f) { + return delete f; +} + char *do_blah(Foo *f) { return f->blah(); } diff --git a/Examples/test-suite/overload_simple.i b/Examples/test-suite/overload_simple.i index 6bd13c023..23e9caf36 100644 --- a/Examples/test-suite/overload_simple.i +++ b/Examples/test-suite/overload_simple.i @@ -117,6 +117,7 @@ void ll(long long ull) {} %include cmalloc.i %malloc(void); +%free(void); #endif diff --git a/Examples/test-suite/python/import_nomodule_runme.py b/Examples/test-suite/python/import_nomodule_runme.py index 41fc9d5ba..ba0abfd9a 100644 --- a/Examples/test-suite/python/import_nomodule_runme.py +++ b/Examples/test-suite/python/import_nomodule_runme.py @@ -2,6 +2,7 @@ from import_nomodule import * f = create_Foo() test1(f,42) +delete_Foo(f) b = Bar() test1(b,37) diff --git a/Examples/test-suite/python/inherit_missing_runme.py b/Examples/test-suite/python/inherit_missing_runme.py index 60e606401..044c166fb 100644 --- a/Examples/test-suite/python/inherit_missing_runme.py +++ b/Examples/test-suite/python/inherit_missing_runme.py @@ -15,3 +15,5 @@ if x != "Bar::blah": x = inherit_missing.do_blah(c) if x != "Spam::blah": print "Whoa! Bad return", x + +inherit_missing.delete_Foo(a) diff --git a/Examples/test-suite/python/kwargs.i b/Examples/test-suite/python/kwargs.i index 37230348a..c4168a03e 100644 --- a/Examples/test-suite/python/kwargs.i +++ b/Examples/test-suite/python/kwargs.i @@ -84,6 +84,10 @@ } %} +%{ + const int Hello::hello; +%} + // Functions with keywords %warnfilter(-314); diff --git a/Examples/test-suite/python/overload_simple_runme.py b/Examples/test-suite/python/overload_simple_runme.py index 737ed23eb..8e2f8c4ed 100644 --- a/Examples/test-suite/python/overload_simple_runme.py +++ b/Examples/test-suite/python/overload_simple_runme.py @@ -95,3 +95,4 @@ if s.type != "void *": +free_void(v) diff --git a/Examples/test-suite/return_const_value.i b/Examples/test-suite/return_const_value.i index d44860fd0..fee653a47 100644 --- a/Examples/test-suite/return_const_value.i +++ b/Examples/test-suite/return_const_value.i @@ -3,6 +3,7 @@ It was reported in bug 899332 by Jermey Brown (jhbrown94) */ %module return_const_value + %inline %{ class Foo { @@ -16,17 +17,29 @@ public: class Foo_ptr { Foo *_ptr; + mutable bool _own; + public: - Foo_ptr(Foo *p): _ptr(p) {} - static Foo_ptr getPtr() { - return Foo_ptr(new Foo(17)); - } - static const Foo_ptr getConstPtr() { - return Foo_ptr(new Foo(17)); - } - const Foo *operator->() { - return _ptr; - } + Foo_ptr(Foo *p, int own = false): _ptr(p), _own(own) {} + static Foo_ptr getPtr() { + return Foo_ptr(new Foo(17), true); + } + static const Foo_ptr getConstPtr() { + return Foo_ptr(new Foo(17), true); + } + const Foo *operator->() { + return _ptr; + } + + Foo_ptr(const Foo_ptr& f) : _ptr(f._ptr), _own(f._own) + { + f._own = 0; + } + + + ~Foo_ptr() { + if(_own) delete _ptr; + } }; %}