From e7bd6be39ea1b16d9530cd78982d5c704e110f21 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Sun, 27 Nov 2005 02:15:26 +0000 Subject: [PATCH] fix bug #1174705 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7879 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../python/static_const_member_2_runme.py | 5 ++-- Examples/test-suite/static_const_member_2.i | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/python/static_const_member_2_runme.py b/Examples/test-suite/python/static_const_member_2_runme.py index 738daf465..081726361 100644 --- a/Examples/test-suite/python/static_const_member_2_runme.py +++ b/Examples/test-suite/python/static_const_member_2_runme.py @@ -9,7 +9,8 @@ try: a = Test_int.LeftIndex a = Test_int.cavity_flags except: - print "Failed!!" - + raise RuntimeError +if Foo.BAZ.val != 2*Foo.BAR.val: + raise RuntimeError diff --git a/Examples/test-suite/static_const_member_2.i b/Examples/test-suite/static_const_member_2.i index 3bd08b820..39d005ae0 100644 --- a/Examples/test-suite/static_const_member_2.i +++ b/Examples/test-suite/static_const_member_2.i @@ -51,3 +51,26 @@ const int &oss::modules::CavityPackFlags::reftest = refvalue; %template(Test_int) oss::modules::Test; + + + +%inline %{ + +class Foo +{ +public: + int val; + + Foo(int v) : val(v) + { + } + + static const Foo BAR; + static const Foo BAZ; +}; + +%} +%{ + const Foo Foo::BAR = Foo(1); + const Foo Foo::BAZ = Foo(2); +%}