diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2014-03-14 09:01:15 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2014-03-14 09:01:15 +0000 |
commit | bf8eb05dbbcca6f749d5a234f5c53ef4d84f004e (patch) | |
tree | cffd8561d078ca340bbe53550223b4b6db98ae56 /Examples/test-suite | |
parent | 90a9ac99a8d45522c86ccc5f46efcf0c2155c605 (diff) | |
parent | ddbf439db9e65ec4243fa71f1c036bd7d56f1624 (diff) | |
download | swig-bf8eb05dbbcca6f749d5a234f5c53ef4d84f004e.tar.gz |
Merge pull request #146 from v-for-vandal/class_p1_fixes2
Class p1 fixes2 - Lua enums and NSpace
Disable old-names generation for enums in class in namespace
Getattribute->GetFlag
Partially disabling old names generation for classes with nspace
Working around some of the SWIG internal issues with enums
Diffstat (limited to 'Examples/test-suite')
-rw-r--r-- | Examples/test-suite/lua/nspace_runme.lua | 16 | ||||
-rw-r--r-- | Examples/test-suite/nspace.i | 8 |
2 files changed, 21 insertions, 3 deletions
diff --git a/Examples/test-suite/lua/nspace_runme.lua b/Examples/test-suite/lua/nspace_runme.lua index 5d55357c0..21f88e2af 100644 --- a/Examples/test-suite/lua/nspace_runme.lua +++ b/Examples/test-suite/lua/nspace_runme.lua @@ -62,6 +62,18 @@ sc = ns.Outer.SomeClass() assert( sc:GetInner1ColorChannel() ~= sc:GetInner2Channel() ) assert( sc:GetInner1Channel() ~= sc:GetInner2Channel() ) - - +-- Backward compatibility +assert(ns.Outer.Inner1.Diffuse ~= nil) +-- Enums within class within namespace shouldn't have backward compatible name. Same for static methods +assert(ns.Outer.Inner1.Color_Diffuse == nil) +assert(ns.Outer.Inner1.Color_colorStaticMethod == nil) + +-- Enums and static methods of class marked as %nonspace should have backward compatible name +assert(ns.NoNSpacePlease_noNspaceStaticFunc() == 10) +assert(ns.Outer.Inner2.NoNSpacePlease_NoNspace == nil) +-- ReallyNoNSpaceEnum is wrapped into %nonspace and thus handled correctly. +-- NoNSpaceEnum is not (although both of them are in %nonspace-wrapped class) and thus +-- handled rather unexpectedly +assert(ns.NoNSpacePlease_ReallyNoNspace1 == 1) +assert(ns.NoNSpacePlease.ReallyNoNspace2 == 10) diff --git a/Examples/test-suite/nspace.i b/Examples/test-suite/nspace.i index 58c560412..1520b3652 100644 --- a/Examples/test-suite/nspace.i +++ b/Examples/test-suite/nspace.i @@ -10,6 +10,7 @@ SWIG_JAVABODY_PROXY(public, public, SWIGTYPE) %nspace; %nonspace Outer::Inner2::NoNSpacePlease; +%nonspace Outer::Inner2::NoNSpacePlease::ReallyNoNSpaceEnum; %copyctor; %ignore Outer::Inner2::Color::Color(); @@ -67,7 +68,12 @@ namespace Outer { const Outer::Inner2::Color& col2c) {} }; // Color int Color::staticMemberVariable = 0; - class NoNSpacePlease {}; + class NoNSpacePlease { + public: + enum NoNSpaceEnum { NoNspace1 = 1, NoNspace2 = 10 }; + enum ReallyNoNSpaceEnum { ReallyNoNspace1 = 1, ReallyNoNspace2 = 10 }; + static int noNspaceStaticFunc() { return 10; } + }; } // Inner2 // Derived class |