diff options
author | Erez Geva <ErezGeva2@gmail.com> | 2023-05-03 12:09:15 +0200 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2023-05-04 13:18:10 +1200 |
commit | 63b1293e1a760e0ce1a27208a5231e705c8f0f3b (patch) | |
tree | 49ae567d51c5b72ace63a15b54612308274ee56a /Examples/test-suite/d/nspace_runme.1.d | |
parent | dada37e1d1a860100c23f7971b0aac58154441fa (diff) | |
download | swig-63b1293e1a760e0ce1a27208a5231e705c8f0f3b.tar.gz |
Drop D version 1
See #2538
Diffstat (limited to 'Examples/test-suite/d/nspace_runme.1.d')
-rw-r--r-- | Examples/test-suite/d/nspace_runme.1.d | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/Examples/test-suite/d/nspace_runme.1.d b/Examples/test-suite/d/nspace_runme.1.d deleted file mode 100644 index 8d3b81f76..000000000 --- a/Examples/test-suite/d/nspace_runme.1.d +++ /dev/null @@ -1,87 +0,0 @@ -module nspace_runme; - -import nspace.nspace; -static import nspace.NoNSpacePlease; -static import nspace.Outer.namespce; -static import nspace.Outer.Inner1.Channel; -static import oi1c = nspace.Outer.Inner1.Color; -static import nspace.Outer.Inner2.Channel; -static import nspace.Outer.Inner2.Color; -static import nspace.Outer.Inner3.Blue; -static import nspace.Outer.Inner4.Blue; -static import nspace.Outer.SomeClass; - -void main() { - // constructors and destructors - auto color1 = new oi1c.Color(); - auto color = new oi1c.Color(color1); - - // class methods - color.colorInstanceMethod(20.0); - oi1c.Color.colorStaticMethod(20.0); - auto created = oi1c.Color.create(); - - // class enums - auto someClass = new nspace.Outer.SomeClass.SomeClass(); - auto channel = someClass.GetInner1ColorChannel(); - if (channel != oi1c.Color.Channel.Transmission) { - throw new Exception("Transmission wrong"); - } - - // class anonymous enums - int val1 = oi1c.Color.ColorEnumVal1; - int val2 = oi1c.Color.ColorEnumVal2; - if (val1 != 0 || val2 != 0x22) { - throw new Exception("ColorEnumVal wrong"); - } - - // instance member variables - color.instanceMemberVariable = 123; - if (color.instanceMemberVariable != 123) { - throw new Exception("instance member variable failed"); - } - - // static member variables - oi1c.Color.staticMemberVariable = 789; - if (oi1c.Color.staticMemberVariable != 789) { - throw new Exception("static member variable failed"); - } - if (oi1c.Color.staticConstMemberVariable != 222) { - throw new Exception("static const member variable failed"); - } - if (oi1c.Color.staticConstEnumMemberVariable != oi1c.Color.Channel.Transmission) { - throw new Exception("static const enum member variable failed"); - } - - // check globals in a namespace don't get mangled with the nspace option - nspace.nspace.namespaceFunction(color); - nspace.nspace.namespaceVar = 111; - if (nspace.nspace.namespaceVar != 111) { - throw new Exception("global var failed"); - } - - // Same class different namespaces - auto col1 = new oi1c.Color(); - auto col2 = nspace.Outer.Inner2.Color.Color.create(); - col2.colors(col1, col1, col2, col2, col2); - - // global enums - auto outerChannel1 = someClass.GetInner1Channel(); - if (outerChannel1 != nspace.Outer.Inner1.Channel.Channel.Transmission1) { - throw new Exception("Transmission1 wrong"); - } - auto outerChannel2 = someClass.GetInner2Channel(); - if (outerChannel2 != nspace.Outer.Inner2.Channel.Channel.Transmission2) { - throw new Exception("Transmission2 wrong"); - } - - // turn feature off / ignoring - auto ns = new nspace.Outer.namespce.namespce(); - auto nons = new nspace.NoNSpacePlease.NoNSpacePlease(); - - // Derived class - auto blue3 = new nspace.Outer.Inner3.Blue.Blue(); - blue3.blueInstanceMethod(); - auto blue4 = new nspace.Outer.Inner4.Blue.Blue(); - blue4.blueInstanceMethod(); -} |