diff --git a/SWIG/Examples/test-suite/java/Makefile.in b/SWIG/Examples/test-suite/java/Makefile.in index 6c451a370..57b032fd6 100644 --- a/SWIG/Examples/test-suite/java/Makefile.in +++ b/SWIG/Examples/test-suite/java/Makefile.in @@ -14,6 +14,8 @@ C_TEST_CASES = \ java_lib_various CPP_TEST_CASES = \ + enum_thorough_simple \ + enum_thorough_typeunsafe \ java_constants \ java_enums \ java_lib_various \ @@ -23,6 +25,9 @@ CPP_TEST_CASES = \ java_typemaps_proxy \ java_typemaps_typewrapper +# This testcase requires Java 1.5 +# enum_thorough_proper \ + include $(srcdir)/../common.mk # Overridden variables here diff --git a/SWIG/Examples/test-suite/java/enum_thorough_runme.java b/SWIG/Examples/test-suite/java/enum_thorough_runme.java new file mode 100644 index 000000000..e0f48c696 --- /dev/null +++ b/SWIG/Examples/test-suite/java/enum_thorough_runme.java @@ -0,0 +1,361 @@ + +import enum_thorough.*; + +public class enum_thorough_runme { + + static { + try { + System.loadLibrary("enum_thorough"); + } 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[]) + { + { + // Anonymous enums + int i = enum_thorough.AnonEnum1; + if (enum_thorough.ReallyAnInteger != 200) throw new RuntimeException("Test Anon 1 failed"); + int j = enum_thorough.AnonSpaceEnum1; + int k = AnonStruct.AnonStructEnum1; + } + { + colour red = colour.red; + enum_thorough.colourTest1(red); + enum_thorough.colourTest2(red); + enum_thorough.colourTest3(red); + enum_thorough.colourTest4(red); + enum_thorough.setMyColour(red); + } + { + SpeedClass s = new SpeedClass(); + SpeedClass.speed speed = SpeedClass.speed.slow; + if (s.speedTest1(speed) != speed) throw new RuntimeException("speedTest 1 failed"); + if (s.speedTest2(speed) != speed) throw new RuntimeException("speedTest 2 failed"); + if (s.speedTest3(speed) != speed) throw new RuntimeException("speedTest 3 failed"); + if (s.speedTest4(speed) != speed) throw new RuntimeException("speedTest 4 failed"); + if (s.speedTest5(speed) != speed) throw new RuntimeException("speedTest 5 failed"); + if (s.speedTest6(speed) != speed) throw new RuntimeException("speedTest 6 failed"); + + if (enum_thorough.speedTest1(speed) != speed) throw new RuntimeException("speedTest Global 1 failed"); + if (enum_thorough.speedTest2(speed) != speed) throw new RuntimeException("speedTest Global 2 failed"); + if (enum_thorough.speedTest3(speed) != speed) throw new RuntimeException("speedTest Global 3 failed"); + if (enum_thorough.speedTest4(speed) != speed) throw new RuntimeException("speedTest Global 4 failed"); + } + { + SpeedClass s = new SpeedClass(); + SpeedClass.speed slow = SpeedClass.speed.slow; + SpeedClass.speed lightning = SpeedClass.speed.lightning; + + if (s.getMySpeedtd1() != slow) throw new RuntimeException("mySpeedtd1 1 failed"); + if (s.getMySpeedtd1().swigValue() != 10) throw new RuntimeException("mySpeedtd1 2 failed"); + + s.setMySpeedtd1(lightning); + if (s.getMySpeedtd1() != lightning) throw new RuntimeException("mySpeedtd1 3 failed"); + if (s.getMySpeedtd1().swigValue() != 31) throw new RuntimeException("mySpeedtd1 4 failed"); + } + { + if (enum_thorough.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new RuntimeException("namedanonTest 1 failed"); + } + { + twonames val = twonames.TwoNames2; + if (enum_thorough.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed"); + if (enum_thorough.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed"); + if (enum_thorough.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed"); + } + { + TwoNamesStruct t = new TwoNamesStruct(); + TwoNamesStruct.twonames val = TwoNamesStruct.twonames.TwoNamesStruct1; + if (t.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed"); + if (t.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed"); + if (t.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed"); + } + { + namedanonspace val = namedanonspace.NamedAnonSpace2; + if (enum_thorough.namedanonspaceTest1(val) != val) throw new RuntimeException("namedanonspaceTest 1 failed"); + if (enum_thorough.namedanonspaceTest2(val) != val) throw new RuntimeException("namedanonspaceTest 2 failed"); + if (enum_thorough.namedanonspaceTest3(val) != val) throw new RuntimeException("namedanonspaceTest 3 failed"); + if (enum_thorough.namedanonspaceTest4(val) != val) throw new RuntimeException("namedanonspaceTest 4 failed"); + } + { + TemplateClassInt t = new TemplateClassInt(); + TemplateClassInt.scientists galileo = TemplateClassInt.scientists.galileo; + + if (t.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest 1 failed"); + if (t.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest 2 failed"); + if (t.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest 3 failed"); + if (t.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest 4 failed"); + if (t.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest 5 failed"); + if (t.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest 6 failed"); + if (t.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest 7 failed"); + if (t.scientistsTest8(galileo) != galileo) throw new RuntimeException("scientistsTest 8 failed"); + if (t.scientistsTest9(galileo) != galileo) throw new RuntimeException("scientistsTest 9 failed"); +// if (t.scientistsTestA(galileo) != galileo) throw new RuntimeException("scientistsTest A failed"); + if (t.scientistsTestB(galileo) != galileo) throw new RuntimeException("scientistsTest B failed"); +// if (t.scientistsTestC(galileo) != galileo) throw new RuntimeException("scientistsTest C failed"); + if (t.scientistsTestD(galileo) != galileo) throw new RuntimeException("scientistsTest D failed"); + if (t.scientistsTestE(galileo) != galileo) throw new RuntimeException("scientistsTest E failed"); + if (t.scientistsTestF(galileo) != galileo) throw new RuntimeException("scientistsTest F failed"); + if (t.scientistsTestG(galileo) != galileo) throw new RuntimeException("scientistsTest G failed"); + if (t.scientistsTestH(galileo) != galileo) throw new RuntimeException("scientistsTest H failed"); + if (t.scientistsTestI(galileo) != galileo) throw new RuntimeException("scientistsTest I failed"); + + if (enum_thorough.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest Global 1 failed"); + if (enum_thorough.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest Global 2 failed"); + if (enum_thorough.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest Global 3 failed"); + if (enum_thorough.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest Global 4 failed"); + if (enum_thorough.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest Global 5 failed"); + if (enum_thorough.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest Global 6 failed"); + if (enum_thorough.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest Global 7 failed"); + } + { + TClassInt t = new TClassInt(); + TClassInt.scientists bell = TClassInt.scientists.bell; + TemplateClassInt.scientists galileo = TemplateClassInt.scientists.galileo; + if (t.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest 1 failed"); + if (t.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest 2 failed"); + if (t.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest 3 failed"); + if (t.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest 4 failed"); + if (t.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest 5 failed"); + if (t.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest 6 failed"); + if (t.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest 7 failed"); + if (t.scientistsNameTest8(bell) != bell) throw new RuntimeException("scientistsNameTest 8 failed"); + if (t.scientistsNameTest9(bell) != bell) throw new RuntimeException("scientistsNameTest 9 failed"); +// if (t.scientistsNameTestA(bell) != bell) throw new RuntimeException("scientistsNameTest A failed"); + if (t.scientistsNameTestB(bell) != bell) throw new RuntimeException("scientistsNameTest B failed"); +// if (t.scientistsNameTestC(bell) != bell) throw new RuntimeException("scientistsNameTest C failed"); + if (t.scientistsNameTestD(bell) != bell) throw new RuntimeException("scientistsNameTest D failed"); + if (t.scientistsNameTestE(bell) != bell) throw new RuntimeException("scientistsNameTest E failed"); + if (t.scientistsNameTestF(bell) != bell) throw new RuntimeException("scientistsNameTest F failed"); + if (t.scientistsNameTestG(bell) != bell) throw new RuntimeException("scientistsNameTest G failed"); + if (t.scientistsNameTestH(bell) != bell) throw new RuntimeException("scientistsNameTest H failed"); + if (t.scientistsNameTestI(bell) != bell) throw new RuntimeException("scientistsNameTest I failed"); + + if (t.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 1 failed"); + if (t.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 2 failed"); + if (t.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 3 failed"); + if (t.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 4 failed"); + if (t.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 5 failed"); + if (t.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 6 failed"); + if (t.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 7 failed"); + + if (t.scientistsOtherTest1(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 1 failed"); + if (t.scientistsOtherTest2(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 2 failed"); + if (t.scientistsOtherTest3(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 3 failed"); + if (t.scientistsOtherTest4(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 4 failed"); + if (t.scientistsOtherTest5(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 5 failed"); + if (t.scientistsOtherTest6(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 6 failed"); + if (t.scientistsOtherTest7(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 7 failed"); + + if (enum_thorough.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest Global 1 failed"); + if (enum_thorough.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest Global 2 failed"); + if (enum_thorough.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest Global 3 failed"); + if (enum_thorough.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest Global 4 failed"); + if (enum_thorough.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest Global 5 failed"); + if (enum_thorough.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest Global 6 failed"); + if (enum_thorough.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest Global 7 failed"); + + if (enum_thorough.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 1 failed"); + if (enum_thorough.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 2 failed"); + if (enum_thorough.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 3 failed"); + if (enum_thorough.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 4 failed"); + if (enum_thorough.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 5 failed"); + if (enum_thorough.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 6 failed"); + if (enum_thorough.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 7 failed"); + + if (enum_thorough.scientistsNameSpaceTest8(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 8 failed"); + if (enum_thorough.scientistsNameSpaceTest9(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 9 failed"); + if (enum_thorough.scientistsNameSpaceTestA(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global A failed"); + if (enum_thorough.scientistsNameSpaceTestB(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global B failed"); + if (enum_thorough.scientistsNameSpaceTestC(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global C failed"); + if (enum_thorough.scientistsNameSpaceTestD(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global D failed"); + if (enum_thorough.scientistsNameSpaceTestE(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global E failed"); + + if (enum_thorough.scientistsNameSpaceTestF(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global F failed"); + if (enum_thorough.scientistsNameSpaceTestG(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global G failed"); + if (enum_thorough.scientistsNameSpaceTestH(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global H failed"); + if (enum_thorough.scientistsNameSpaceTestI(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global I failed"); + if (enum_thorough.scientistsNameSpaceTestJ(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global J failed"); + if (enum_thorough.scientistsNameSpaceTestK(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global K failed"); + if (enum_thorough.scientistsNameSpaceTestL(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global L failed"); + } + { + newname val = newname.argh; + if (enum_thorough.renameTest1(val) != val) throw new RuntimeException("renameTest Global 1 failed"); + if (enum_thorough.renameTest2(val) != val) throw new RuntimeException("renameTest Global 2 failed"); + } + { + NewNameStruct n = new NewNameStruct(); + if (n.renameTest1(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest 1 failed"); + if (n.renameTest2(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest 2 failed"); + if (n.renameTest3(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new RuntimeException("renameTest 3 failed"); + if (n.renameTest4(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest 4 failed"); + if (n.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest 5 failed"); + if (n.renameTest6(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new RuntimeException("renameTest 6 failed"); + } + { + if (enum_thorough.renameTest3(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest Global 3 failed"); + if (enum_thorough.renameTest4(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new RuntimeException("renameTest Global 4 failed"); + if (enum_thorough.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest Global 5 failed"); + if (enum_thorough.renameTest6(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest Global 6 failed"); + if (enum_thorough.renameTest7(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new RuntimeException("renameTest Global 7 failed"); + } + { + TreesClass t = new TreesClass(); + TreesClass.trees pine = TreesClass.trees.pine; + + if (t.treesTest1(pine) != pine) throw new RuntimeException("treesTest 1 failed"); + if (t.treesTest2(pine) != pine) throw new RuntimeException("treesTest 2 failed"); + if (t.treesTest3(pine) != pine) throw new RuntimeException("treesTest 3 failed"); + if (t.treesTest4(pine) != pine) throw new RuntimeException("treesTest 4 failed"); + if (t.treesTest5(pine) != pine) throw new RuntimeException("treesTest 5 failed"); + if (t.treesTest6(pine) != pine) throw new RuntimeException("treesTest 6 failed"); + if (t.treesTest7(pine) != pine) throw new RuntimeException("treesTest 7 failed"); + if (t.treesTest8(pine) != pine) throw new RuntimeException("treesTest 8 failed"); + if (t.treesTest9(pine) != pine) throw new RuntimeException("treesTest 9 failed"); + if (t.treesTestA(pine) != pine) throw new RuntimeException("treesTest A failed"); + if (t.treesTestB(pine) != pine) throw new RuntimeException("treesTest B failed"); + if (t.treesTestC(pine) != pine) throw new RuntimeException("treesTest C failed"); + if (t.treesTestD(pine) != pine) throw new RuntimeException("treesTest D failed"); + if (t.treesTestE(pine) != pine) throw new RuntimeException("treesTest E failed"); + if (t.treesTestF(pine) != pine) throw new RuntimeException("treesTest F failed"); + if (t.treesTestG(pine) != pine) throw new RuntimeException("treesTest G failed"); + if (t.treesTestH(pine) != pine) throw new RuntimeException("treesTest H failed"); + if (t.treesTestI(pine) != pine) throw new RuntimeException("treesTest I failed"); + if (t.treesTestJ(pine) != pine) throw new RuntimeException("treesTest J failed"); + if (t.treesTestK(pine) != pine) throw new RuntimeException("treesTest K failed"); + if (t.treesTestL(pine) != pine) throw new RuntimeException("treesTest L failed"); + if (t.treesTestM(pine) != pine) throw new RuntimeException("treesTest M failed"); + if (t.treesTestN(pine) != pine) throw new RuntimeException("treesTest N failed"); + if (t.treesTestO(pine) != pine) throw new RuntimeException("treesTest O failed"); + + if (enum_thorough.treesTest1(pine) != pine) throw new RuntimeException("treesTest Global 1 failed"); + if (enum_thorough.treesTest2(pine) != pine) throw new RuntimeException("treesTest Global 2 failed"); + if (enum_thorough.treesTest3(pine) != pine) throw new RuntimeException("treesTest Global 3 failed"); + if (enum_thorough.treesTest4(pine) != pine) throw new RuntimeException("treesTest Global 4 failed"); + if (enum_thorough.treesTest5(pine) != pine) throw new RuntimeException("treesTest Global 5 failed"); + if (enum_thorough.treesTest6(pine) != pine) throw new RuntimeException("treesTest Global 6 failed"); + if (enum_thorough.treesTest7(pine) != pine) throw new RuntimeException("treesTest Global 7 failed"); + if (enum_thorough.treesTest8(pine) != pine) throw new RuntimeException("treesTest Global 8 failed"); + if (enum_thorough.treesTest9(pine) != pine) throw new RuntimeException("treesTest Global 9 failed"); + if (enum_thorough.treesTestA(pine) != pine) throw new RuntimeException("treesTest Global A failed"); + if (enum_thorough.treesTestB(pine) != pine) throw new RuntimeException("treesTest Global B failed"); + if (enum_thorough.treesTestC(pine) != pine) throw new RuntimeException("treesTest Global C failed"); + if (enum_thorough.treesTestD(pine) != pine) throw new RuntimeException("treesTest Global D failed"); + if (enum_thorough.treesTestE(pine) != pine) throw new RuntimeException("treesTest Global E failed"); + if (enum_thorough.treesTestF(pine) != pine) throw new RuntimeException("treesTest Global F failed"); + if (enum_thorough.treesTestG(pine) != pine) throw new RuntimeException("treesTest Global G failed"); + if (enum_thorough.treesTestH(pine) != pine) throw new RuntimeException("treesTest Global H failed"); + if (enum_thorough.treesTestI(pine) != pine) throw new RuntimeException("treesTest Global I failed"); + if (enum_thorough.treesTestJ(pine) != pine) throw new RuntimeException("treesTest Global J failed"); + if (enum_thorough.treesTestK(pine) != pine) throw new RuntimeException("treesTest Global K failed"); + if (enum_thorough.treesTestL(pine) != pine) throw new RuntimeException("treesTest Global L failed"); + if (enum_thorough.treesTestM(pine) != pine) throw new RuntimeException("treesTest Global M failed"); +// if (enum_thorough.treesTestN(pine) != pine) throw new RuntimeException("treesTest Global N failed"); + if (enum_thorough.treesTestO(pine) != pine) throw new RuntimeException("treesTest Global O failed"); + if (enum_thorough.treesTestP(pine) != pine) throw new RuntimeException("treesTest Global P failed"); + if (enum_thorough.treesTestQ(pine) != pine) throw new RuntimeException("treesTest Global Q failed"); + if (enum_thorough.treesTestR(pine) != pine) throw new RuntimeException("treesTest Global R failed"); + } + { + HairStruct h = new HairStruct(); + HairStruct.hair ginger = HairStruct.hair.ginger; + + if (h.hairTest1(ginger) != ginger) throw new RuntimeException("hairTest 1 failed"); + if (h.hairTest2(ginger) != ginger) throw new RuntimeException("hairTest 2 failed"); + if (h.hairTest3(ginger) != ginger) throw new RuntimeException("hairTest 3 failed"); + if (h.hairTest4(ginger) != ginger) throw new RuntimeException("hairTest 4 failed"); + if (h.hairTest5(ginger) != ginger) throw new RuntimeException("hairTest 5 failed"); + if (h.hairTest6(ginger) != ginger) throw new RuntimeException("hairTest 6 failed"); + if (h.hairTest7(ginger) != ginger) throw new RuntimeException("hairTest 7 failed"); + if (h.hairTest8(ginger) != ginger) throw new RuntimeException("hairTest 8 failed"); + if (h.hairTest9(ginger) != ginger) throw new RuntimeException("hairTest 9 failed"); + if (h.hairTestA(ginger) != ginger) throw new RuntimeException("hairTest A failed"); + if (h.hairTestB(ginger) != ginger) throw new RuntimeException("hairTest B failed"); + + colour red = colour.red; + if (h.colourTest1(red) != red) throw new RuntimeException("colourTest HairStruct 1 failed"); + if (h.colourTest2(red) != red) throw new RuntimeException("colourTest HairStruct 2 failed"); + if (h.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new RuntimeException("namedanonTest HairStruct 1 failed"); + if (h.namedanonspaceTest1(namedanonspace.NamedAnonSpace2) != namedanonspace.NamedAnonSpace2) throw new RuntimeException("namedanonspaceTest HairStruct 1 failed"); + + TreesClass.trees fir = TreesClass.trees.fir; + if (h.treesGlobalTest1(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 1 failed"); + if (h.treesGlobalTest2(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 2 failed"); + if (h.treesGlobalTest3(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 3 failed"); + if (h.treesGlobalTest4(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 4 failed"); + } + { + HairStruct.hair blonde = HairStruct.hair.blonde; + if (enum_thorough.hairTest1(blonde) != blonde) throw new RuntimeException("hairTest Global 1 failed"); + if (enum_thorough.hairTest2(blonde) != blonde) throw new RuntimeException("hairTest Global 2 failed"); + if (enum_thorough.hairTest3(blonde) != blonde) throw new RuntimeException("hairTest Global 3 failed"); + if (enum_thorough.hairTest4(blonde) != blonde) throw new RuntimeException("hairTest Global 4 failed"); + if (enum_thorough.hairTest5(blonde) != blonde) throw new RuntimeException("hairTest Global 5 failed"); + if (enum_thorough.hairTest6(blonde) != blonde) throw new RuntimeException("hairTest Global 6 failed"); + if (enum_thorough.hairTest7(blonde) != blonde) throw new RuntimeException("hairTest Global 7 failed"); + if (enum_thorough.hairTest8(blonde) != blonde) throw new RuntimeException("hairTest Global 8 failed"); + if (enum_thorough.hairTest9(blonde) != blonde) throw new RuntimeException("hairTest Global 9 failed"); + if (enum_thorough.hairTestA(blonde) != blonde) throw new RuntimeException("hairTest Global A failed"); + + if (enum_thorough.hairTestA1(blonde) != blonde) throw new RuntimeException("hairTest Global A1 failed"); + if (enum_thorough.hairTestA2(blonde) != blonde) throw new RuntimeException("hairTest Global A2 failed"); + if (enum_thorough.hairTestA3(blonde) != blonde) throw new RuntimeException("hairTest Global A3 failed"); + if (enum_thorough.hairTestA4(blonde) != blonde) throw new RuntimeException("hairTest Global A4 failed"); + if (enum_thorough.hairTestA5(blonde) != blonde) throw new RuntimeException("hairTest Global A5 failed"); + if (enum_thorough.hairTestA6(blonde) != blonde) throw new RuntimeException("hairTest Global A6 failed"); + if (enum_thorough.hairTestA7(blonde) != blonde) throw new RuntimeException("hairTest Global A7 failed"); + if (enum_thorough.hairTestA8(blonde) != blonde) throw new RuntimeException("hairTest Global A8 failed"); + if (enum_thorough.hairTestA9(blonde) != blonde) throw new RuntimeException("hairTest Global A9 failed"); + if (enum_thorough.hairTestAA(blonde) != blonde) throw new RuntimeException("hairTest Global AA failed"); + + if (enum_thorough.hairTestB1(blonde) != blonde) throw new RuntimeException("hairTest Global B1 failed"); + if (enum_thorough.hairTestB2(blonde) != blonde) throw new RuntimeException("hairTest Global B2 failed"); + if (enum_thorough.hairTestB3(blonde) != blonde) throw new RuntimeException("hairTest Global B3 failed"); + if (enum_thorough.hairTestB4(blonde) != blonde) throw new RuntimeException("hairTest Global B4 failed"); + if (enum_thorough.hairTestB5(blonde) != blonde) throw new RuntimeException("hairTest Global B5 failed"); + if (enum_thorough.hairTestB6(blonde) != blonde) throw new RuntimeException("hairTest Global B6 failed"); + if (enum_thorough.hairTestB7(blonde) != blonde) throw new RuntimeException("hairTest Global B7 failed"); + if (enum_thorough.hairTestB8(blonde) != blonde) throw new RuntimeException("hairTest Global B8 failed"); + if (enum_thorough.hairTestB9(blonde) != blonde) throw new RuntimeException("hairTest Global B9 failed"); + if (enum_thorough.hairTestBA(blonde) != blonde) throw new RuntimeException("hairTest Global BA failed"); + + if (enum_thorough.hairTestC1(blonde) != blonde) throw new RuntimeException("hairTest Global C1 failed"); + if (enum_thorough.hairTestC2(blonde) != blonde) throw new RuntimeException("hairTest Global C2 failed"); + if (enum_thorough.hairTestC3(blonde) != blonde) throw new RuntimeException("hairTest Global C3 failed"); + if (enum_thorough.hairTestC4(blonde) != blonde) throw new RuntimeException("hairTest Global C4 failed"); + if (enum_thorough.hairTestC5(blonde) != blonde) throw new RuntimeException("hairTest Global C5 failed"); + if (enum_thorough.hairTestC6(blonde) != blonde) throw new RuntimeException("hairTest Global C6 failed"); + if (enum_thorough.hairTestC7(blonde) != blonde) throw new RuntimeException("hairTest Global C7 failed"); + if (enum_thorough.hairTestC8(blonde) != blonde) throw new RuntimeException("hairTest Global C8 failed"); + if (enum_thorough.hairTestC9(blonde) != blonde) throw new RuntimeException("hairTest Global C9 failed"); + if (enum_thorough.hairTestCA(blonde) != blonde) throw new RuntimeException("hairTest Global CA failed"); + } + { + FirStruct f = new FirStruct(); + HairStruct.hair blonde = HairStruct.hair.blonde; + + if (f.hairTestFir1(blonde) != blonde) throw new RuntimeException("hairTestFir 1 failed"); + if (f.hairTestFir2(blonde) != blonde) throw new RuntimeException("hairTestFir 2 failed"); + if (f.hairTestFir3(blonde) != blonde) throw new RuntimeException("hairTestFir 3 failed"); + if (f.hairTestFir4(blonde) != blonde) throw new RuntimeException("hairTestFir 4 failed"); + if (f.hairTestFir5(blonde) != blonde) throw new RuntimeException("hairTestFir 5 failed"); + if (f.hairTestFir6(blonde) != blonde) throw new RuntimeException("hairTestFir 6 failed"); + if (f.hairTestFir7(blonde) != blonde) throw new RuntimeException("hairTestFir 7 failed"); + if (f.hairTestFir8(blonde) != blonde) throw new RuntimeException("hairTestFir 8 failed"); + if (f.hairTestFir9(blonde) != blonde) throw new RuntimeException("hairTestFir 9 failed"); + if (f.hairTestFirA(blonde) != blonde) throw new RuntimeException("hairTestFir A failed"); + } + { + enum_thorough.setGlobalInstance(enum_thorough.globalinstance2); + if (enum_thorough.getGlobalInstance() != enum_thorough.globalinstance2) throw new RuntimeException("GlobalInstance 1 failed"); + + Instances i = new Instances(); + i.setMemberInstance(Instances.memberinstance3); + if (i.getMemberInstance() != Instances.memberinstance3) throw new RuntimeException("MemberInstance 1 failed"); + } + } +} + diff --git a/SWIG/Examples/test-suite/java/enum_thorough_simple_runme.java b/SWIG/Examples/test-suite/java/enum_thorough_simple_runme.java new file mode 100644 index 000000000..2cee5bfe7 --- /dev/null +++ b/SWIG/Examples/test-suite/java/enum_thorough_simple_runme.java @@ -0,0 +1,361 @@ + +import enum_thorough_simple.*; + +public class enum_thorough_simple_runme { + + static { + try { + System.loadLibrary("enum_thorough_simple"); + } 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[]) + { + { + // Anonymous enums + int i = enum_thorough_simple.AnonEnum1; + if (enum_thorough_simple.ReallyAnInteger != 200) throw new RuntimeException("Test Anon 1 failed"); + int j = enum_thorough_simple.AnonSpaceEnum1; + int k = AnonStruct.AnonStructEnum1; + } + { + int red = enum_thorough_simple.red; + enum_thorough_simple.colourTest1(red); + enum_thorough_simple.colourTest2(red); + enum_thorough_simple.colourTest3(red); + enum_thorough_simple.colourTest4(red); + enum_thorough_simple.setMyColour(red); + } + { + SpeedClass s = new SpeedClass(); + int speed = SpeedClass.slow; + if (s.speedTest1(speed) != speed) throw new RuntimeException("speedTest 1 failed"); + if (s.speedTest2(speed) != speed) throw new RuntimeException("speedTest 2 failed"); + if (s.speedTest3(speed) != speed) throw new RuntimeException("speedTest 3 failed"); + if (s.speedTest4(speed) != speed) throw new RuntimeException("speedTest 4 failed"); + if (s.speedTest5(speed) != speed) throw new RuntimeException("speedTest 5 failed"); + if (s.speedTest6(speed) != speed) throw new RuntimeException("speedTest 6 failed"); + + if (enum_thorough_simple.speedTest1(speed) != speed) throw new RuntimeException("speedTest Global 1 failed"); + if (enum_thorough_simple.speedTest2(speed) != speed) throw new RuntimeException("speedTest Global 2 failed"); + if (enum_thorough_simple.speedTest3(speed) != speed) throw new RuntimeException("speedTest Global 3 failed"); + if (enum_thorough_simple.speedTest4(speed) != speed) throw new RuntimeException("speedTest Global 4 failed"); + } + { + SpeedClass s = new SpeedClass(); + int slow = SpeedClass.slow; + int lightning = SpeedClass.lightning; + + if (s.getMySpeedtd1() != slow) throw new RuntimeException("mySpeedtd1 1 failed"); + if (s.getMySpeedtd1() != 10) throw new RuntimeException("mySpeedtd1 2 failed"); + + s.setMySpeedtd1(lightning); + if (s.getMySpeedtd1() != lightning) throw new RuntimeException("mySpeedtd1 3 failed"); + if (s.getMySpeedtd1() != 31) throw new RuntimeException("mySpeedtd1 4 failed"); + } + { + if (enum_thorough_simple.namedanonTest1(enum_thorough_simple.NamedAnon2) != enum_thorough_simple.NamedAnon2) throw new RuntimeException("namedanonTest 1 failed"); + } + { + int val = enum_thorough_simple.TwoNames2; + if (enum_thorough_simple.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed"); + if (enum_thorough_simple.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed"); + if (enum_thorough_simple.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed"); + } + { + TwoNamesStruct t = new TwoNamesStruct(); + int val = TwoNamesStruct.TwoNamesStruct1; + if (t.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed"); + if (t.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed"); + if (t.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed"); + } + { + int val = enum_thorough_simple.NamedAnonSpace2; + if (enum_thorough_simple.namedanonspaceTest1(val) != val) throw new RuntimeException("namedanonspaceTest 1 failed"); + if (enum_thorough_simple.namedanonspaceTest2(val) != val) throw new RuntimeException("namedanonspaceTest 2 failed"); + if (enum_thorough_simple.namedanonspaceTest3(val) != val) throw new RuntimeException("namedanonspaceTest 3 failed"); + if (enum_thorough_simple.namedanonspaceTest4(val) != val) throw new RuntimeException("namedanonspaceTest 4 failed"); + } + { + TemplateClassInt t = new TemplateClassInt(); + int galileo = TemplateClassInt.galileo; + + if (t.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest 1 failed"); + if (t.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest 2 failed"); + if (t.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest 3 failed"); + if (t.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest 4 failed"); + if (t.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest 5 failed"); + if (t.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest 6 failed"); + if (t.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest 7 failed"); + if (t.scientistsTest8(galileo) != galileo) throw new RuntimeException("scientistsTest 8 failed"); + if (t.scientistsTest9(galileo) != galileo) throw new RuntimeException("scientistsTest 9 failed"); +// if (t.scientistsTestA(galileo) != galileo) throw new RuntimeException("scientistsTest A failed"); + if (t.scientistsTestB(galileo) != galileo) throw new RuntimeException("scientistsTest B failed"); +// if (t.scientistsTestC(galileo) != galileo) throw new RuntimeException("scientistsTest C failed"); + if (t.scientistsTestD(galileo) != galileo) throw new RuntimeException("scientistsTest D failed"); + if (t.scientistsTestE(galileo) != galileo) throw new RuntimeException("scientistsTest E failed"); + if (t.scientistsTestF(galileo) != galileo) throw new RuntimeException("scientistsTest F failed"); + if (t.scientistsTestG(galileo) != galileo) throw new RuntimeException("scientistsTest G failed"); + if (t.scientistsTestH(galileo) != galileo) throw new RuntimeException("scientistsTest H failed"); + if (t.scientistsTestI(galileo) != galileo) throw new RuntimeException("scientistsTest I failed"); + + if (enum_thorough_simple.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest Global 1 failed"); + if (enum_thorough_simple.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest Global 2 failed"); + if (enum_thorough_simple.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest Global 3 failed"); + if (enum_thorough_simple.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest Global 4 failed"); + if (enum_thorough_simple.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest Global 5 failed"); + if (enum_thorough_simple.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest Global 6 failed"); + if (enum_thorough_simple.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest Global 7 failed"); + } + { + TClassInt t = new TClassInt(); + int bell = TClassInt.bell; + int galileo = TemplateClassInt.galileo; + if (t.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest 1 failed"); + if (t.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest 2 failed"); + if (t.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest 3 failed"); + if (t.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest 4 failed"); + if (t.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest 5 failed"); + if (t.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest 6 failed"); + if (t.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest 7 failed"); + if (t.scientistsNameTest8(bell) != bell) throw new RuntimeException("scientistsNameTest 8 failed"); + if (t.scientistsNameTest9(bell) != bell) throw new RuntimeException("scientistsNameTest 9 failed"); +// if (t.scientistsNameTestA(bell) != bell) throw new RuntimeException("scientistsNameTest A failed"); + if (t.scientistsNameTestB(bell) != bell) throw new RuntimeException("scientistsNameTest B failed"); +// if (t.scientistsNameTestC(bell) != bell) throw new RuntimeException("scientistsNameTest C failed"); + if (t.scientistsNameTestD(bell) != bell) throw new RuntimeException("scientistsNameTest D failed"); + if (t.scientistsNameTestE(bell) != bell) throw new RuntimeException("scientistsNameTest E failed"); + if (t.scientistsNameTestF(bell) != bell) throw new RuntimeException("scientistsNameTest F failed"); + if (t.scientistsNameTestG(bell) != bell) throw new RuntimeException("scientistsNameTest G failed"); + if (t.scientistsNameTestH(bell) != bell) throw new RuntimeException("scientistsNameTest H failed"); + if (t.scientistsNameTestI(bell) != bell) throw new RuntimeException("scientistsNameTest I failed"); + + if (t.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 1 failed"); + if (t.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 2 failed"); + if (t.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 3 failed"); + if (t.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 4 failed"); + if (t.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 5 failed"); + if (t.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 6 failed"); + if (t.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 7 failed"); + + if (t.scientistsOtherTest1(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 1 failed"); + if (t.scientistsOtherTest2(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 2 failed"); + if (t.scientistsOtherTest3(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 3 failed"); + if (t.scientistsOtherTest4(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 4 failed"); + if (t.scientistsOtherTest5(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 5 failed"); + if (t.scientistsOtherTest6(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 6 failed"); + if (t.scientistsOtherTest7(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 7 failed"); + + if (enum_thorough_simple.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest Global 1 failed"); + if (enum_thorough_simple.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest Global 2 failed"); + if (enum_thorough_simple.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest Global 3 failed"); + if (enum_thorough_simple.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest Global 4 failed"); + if (enum_thorough_simple.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest Global 5 failed"); + if (enum_thorough_simple.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest Global 6 failed"); + if (enum_thorough_simple.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest Global 7 failed"); + + if (enum_thorough_simple.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 1 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 2 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 3 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 4 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 5 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 6 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 7 failed"); + + if (enum_thorough_simple.scientistsNameSpaceTest8(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 8 failed"); + if (enum_thorough_simple.scientistsNameSpaceTest9(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 9 failed"); + if (enum_thorough_simple.scientistsNameSpaceTestA(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global A failed"); + if (enum_thorough_simple.scientistsNameSpaceTestB(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global B failed"); + if (enum_thorough_simple.scientistsNameSpaceTestC(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global C failed"); + if (enum_thorough_simple.scientistsNameSpaceTestD(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global D failed"); + if (enum_thorough_simple.scientistsNameSpaceTestE(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global E failed"); + + if (enum_thorough_simple.scientistsNameSpaceTestF(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global F failed"); + if (enum_thorough_simple.scientistsNameSpaceTestG(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global G failed"); + if (enum_thorough_simple.scientistsNameSpaceTestH(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global H failed"); + if (enum_thorough_simple.scientistsNameSpaceTestI(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global I failed"); + if (enum_thorough_simple.scientistsNameSpaceTestJ(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global J failed"); + if (enum_thorough_simple.scientistsNameSpaceTestK(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global K failed"); + if (enum_thorough_simple.scientistsNameSpaceTestL(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global L failed"); + } + { + int val = enum_thorough_simple.argh; + if (enum_thorough_simple.renameTest1(val) != val) throw new RuntimeException("renameTest Global 1 failed"); + if (enum_thorough_simple.renameTest2(val) != val) throw new RuntimeException("renameTest Global 2 failed"); + } + { + NewNameStruct n = new NewNameStruct(); + if (n.renameTest1(NewNameStruct.bang) != NewNameStruct.bang) throw new RuntimeException("renameTest 1 failed"); + if (n.renameTest2(NewNameStruct.bang) != NewNameStruct.bang) throw new RuntimeException("renameTest 2 failed"); + if (n.renameTest3(NewNameStruct.simple1) != NewNameStruct.simple1) throw new RuntimeException("renameTest 3 failed"); + if (n.renameTest4(NewNameStruct.doublename1) != NewNameStruct.doublename1) throw new RuntimeException("renameTest 4 failed"); + if (n.renameTest5(NewNameStruct.doublename1) != NewNameStruct.doublename1) throw new RuntimeException("renameTest 5 failed"); + if (n.renameTest6(NewNameStruct.singlename1) != NewNameStruct.singlename1) throw new RuntimeException("renameTest 6 failed"); + } + { + if (enum_thorough_simple.renameTest3(NewNameStruct.bang) != NewNameStruct.bang) throw new RuntimeException("renameTest Global 3 failed"); + if (enum_thorough_simple.renameTest4(NewNameStruct.simple1) != NewNameStruct.simple1) throw new RuntimeException("renameTest Global 4 failed"); + if (enum_thorough_simple.renameTest5(NewNameStruct.doublename1) != NewNameStruct.doublename1) throw new RuntimeException("renameTest Global 5 failed"); + if (enum_thorough_simple.renameTest6(NewNameStruct.doublename1) != NewNameStruct.doublename1) throw new RuntimeException("renameTest Global 6 failed"); + if (enum_thorough_simple.renameTest7(NewNameStruct.singlename1) != NewNameStruct.singlename1) throw new RuntimeException("renameTest Global 7 failed"); + } + { + TreesClass t = new TreesClass(); + int pine = TreesClass.pine; + + if (t.treesTest1(pine) != pine) throw new RuntimeException("treesTest 1 failed"); + if (t.treesTest2(pine) != pine) throw new RuntimeException("treesTest 2 failed"); + if (t.treesTest3(pine) != pine) throw new RuntimeException("treesTest 3 failed"); + if (t.treesTest4(pine) != pine) throw new RuntimeException("treesTest 4 failed"); + if (t.treesTest5(pine) != pine) throw new RuntimeException("treesTest 5 failed"); + if (t.treesTest6(pine) != pine) throw new RuntimeException("treesTest 6 failed"); + if (t.treesTest7(pine) != pine) throw new RuntimeException("treesTest 7 failed"); + if (t.treesTest8(pine) != pine) throw new RuntimeException("treesTest 8 failed"); + if (t.treesTest9(pine) != pine) throw new RuntimeException("treesTest 9 failed"); + if (t.treesTestA(pine) != pine) throw new RuntimeException("treesTest A failed"); + if (t.treesTestB(pine) != pine) throw new RuntimeException("treesTest B failed"); + if (t.treesTestC(pine) != pine) throw new RuntimeException("treesTest C failed"); + if (t.treesTestD(pine) != pine) throw new RuntimeException("treesTest D failed"); + if (t.treesTestE(pine) != pine) throw new RuntimeException("treesTest E failed"); + if (t.treesTestF(pine) != pine) throw new RuntimeException("treesTest F failed"); + if (t.treesTestG(pine) != pine) throw new RuntimeException("treesTest G failed"); + if (t.treesTestH(pine) != pine) throw new RuntimeException("treesTest H failed"); + if (t.treesTestI(pine) != pine) throw new RuntimeException("treesTest I failed"); + if (t.treesTestJ(pine) != pine) throw new RuntimeException("treesTest J failed"); + if (t.treesTestK(pine) != pine) throw new RuntimeException("treesTest K failed"); + if (t.treesTestL(pine) != pine) throw new RuntimeException("treesTest L failed"); + if (t.treesTestM(pine) != pine) throw new RuntimeException("treesTest M failed"); + if (t.treesTestN(pine) != pine) throw new RuntimeException("treesTest N failed"); + if (t.treesTestO(pine) != pine) throw new RuntimeException("treesTest O failed"); + + if (enum_thorough_simple.treesTest1(pine) != pine) throw new RuntimeException("treesTest Global 1 failed"); + if (enum_thorough_simple.treesTest2(pine) != pine) throw new RuntimeException("treesTest Global 2 failed"); + if (enum_thorough_simple.treesTest3(pine) != pine) throw new RuntimeException("treesTest Global 3 failed"); + if (enum_thorough_simple.treesTest4(pine) != pine) throw new RuntimeException("treesTest Global 4 failed"); + if (enum_thorough_simple.treesTest5(pine) != pine) throw new RuntimeException("treesTest Global 5 failed"); + if (enum_thorough_simple.treesTest6(pine) != pine) throw new RuntimeException("treesTest Global 6 failed"); + if (enum_thorough_simple.treesTest7(pine) != pine) throw new RuntimeException("treesTest Global 7 failed"); + if (enum_thorough_simple.treesTest8(pine) != pine) throw new RuntimeException("treesTest Global 8 failed"); + if (enum_thorough_simple.treesTest9(pine) != pine) throw new RuntimeException("treesTest Global 9 failed"); + if (enum_thorough_simple.treesTestA(pine) != pine) throw new RuntimeException("treesTest Global A failed"); + if (enum_thorough_simple.treesTestB(pine) != pine) throw new RuntimeException("treesTest Global B failed"); + if (enum_thorough_simple.treesTestC(pine) != pine) throw new RuntimeException("treesTest Global C failed"); + if (enum_thorough_simple.treesTestD(pine) != pine) throw new RuntimeException("treesTest Global D failed"); + if (enum_thorough_simple.treesTestE(pine) != pine) throw new RuntimeException("treesTest Global E failed"); + if (enum_thorough_simple.treesTestF(pine) != pine) throw new RuntimeException("treesTest Global F failed"); + if (enum_thorough_simple.treesTestG(pine) != pine) throw new RuntimeException("treesTest Global G failed"); + if (enum_thorough_simple.treesTestH(pine) != pine) throw new RuntimeException("treesTest Global H failed"); + if (enum_thorough_simple.treesTestI(pine) != pine) throw new RuntimeException("treesTest Global I failed"); + if (enum_thorough_simple.treesTestJ(pine) != pine) throw new RuntimeException("treesTest Global J failed"); + if (enum_thorough_simple.treesTestK(pine) != pine) throw new RuntimeException("treesTest Global K failed"); + if (enum_thorough_simple.treesTestL(pine) != pine) throw new RuntimeException("treesTest Global L failed"); + if (enum_thorough_simple.treesTestM(pine) != pine) throw new RuntimeException("treesTest Global M failed"); +// if (enum_thorough_simple.treesTestN(pine) != pine) throw new RuntimeException("treesTest Global N failed"); + if (enum_thorough_simple.treesTestO(pine) != pine) throw new RuntimeException("treesTest Global O failed"); + if (enum_thorough_simple.treesTestP(pine) != pine) throw new RuntimeException("treesTest Global P failed"); + if (enum_thorough_simple.treesTestQ(pine) != pine) throw new RuntimeException("treesTest Global Q failed"); + if (enum_thorough_simple.treesTestR(pine) != pine) throw new RuntimeException("treesTest Global R failed"); + } + { + HairStruct h = new HairStruct(); + int ginger = HairStruct.ginger; + + if (h.hairTest1(ginger) != ginger) throw new RuntimeException("hairTest 1 failed"); + if (h.hairTest2(ginger) != ginger) throw new RuntimeException("hairTest 2 failed"); + if (h.hairTest3(ginger) != ginger) throw new RuntimeException("hairTest 3 failed"); + if (h.hairTest4(ginger) != ginger) throw new RuntimeException("hairTest 4 failed"); + if (h.hairTest5(ginger) != ginger) throw new RuntimeException("hairTest 5 failed"); + if (h.hairTest6(ginger) != ginger) throw new RuntimeException("hairTest 6 failed"); + if (h.hairTest7(ginger) != ginger) throw new RuntimeException("hairTest 7 failed"); + if (h.hairTest8(ginger) != ginger) throw new RuntimeException("hairTest 8 failed"); + if (h.hairTest9(ginger) != ginger) throw new RuntimeException("hairTest 9 failed"); + if (h.hairTestA(ginger) != ginger) throw new RuntimeException("hairTest A failed"); + if (h.hairTestB(ginger) != ginger) throw new RuntimeException("hairTest B failed"); + + int red = enum_thorough_simple.red; + if (h.colourTest1(red) != red) throw new RuntimeException("colourTest HairStruct 1 failed"); + if (h.colourTest2(red) != red) throw new RuntimeException("colourTest HairStruct 2 failed"); + if (h.namedanonTest1(enum_thorough_simple.NamedAnon2) != enum_thorough_simple.NamedAnon2) throw new RuntimeException("namedanonTest HairStruct 1 failed"); + if (h.namedanonspaceTest1(enum_thorough_simple.NamedAnonSpace2) != enum_thorough_simple.NamedAnonSpace2) throw new RuntimeException("namedanonspaceTest HairStruct 1 failed"); + + int fir = TreesClass.fir; + if (h.treesGlobalTest1(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 1 failed"); + if (h.treesGlobalTest2(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 2 failed"); + if (h.treesGlobalTest3(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 3 failed"); + if (h.treesGlobalTest4(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 4 failed"); + } + { + int blonde = HairStruct.blonde; + if (enum_thorough_simple.hairTest1(blonde) != blonde) throw new RuntimeException("hairTest Global 1 failed"); + if (enum_thorough_simple.hairTest2(blonde) != blonde) throw new RuntimeException("hairTest Global 2 failed"); + if (enum_thorough_simple.hairTest3(blonde) != blonde) throw new RuntimeException("hairTest Global 3 failed"); + if (enum_thorough_simple.hairTest4(blonde) != blonde) throw new RuntimeException("hairTest Global 4 failed"); + if (enum_thorough_simple.hairTest5(blonde) != blonde) throw new RuntimeException("hairTest Global 5 failed"); + if (enum_thorough_simple.hairTest6(blonde) != blonde) throw new RuntimeException("hairTest Global 6 failed"); + if (enum_thorough_simple.hairTest7(blonde) != blonde) throw new RuntimeException("hairTest Global 7 failed"); + if (enum_thorough_simple.hairTest8(blonde) != blonde) throw new RuntimeException("hairTest Global 8 failed"); + if (enum_thorough_simple.hairTest9(blonde) != blonde) throw new RuntimeException("hairTest Global 9 failed"); + if (enum_thorough_simple.hairTestA(blonde) != blonde) throw new RuntimeException("hairTest Global A failed"); + + if (enum_thorough_simple.hairTestA1(blonde) != blonde) throw new RuntimeException("hairTest Global A1 failed"); + if (enum_thorough_simple.hairTestA2(blonde) != blonde) throw new RuntimeException("hairTest Global A2 failed"); + if (enum_thorough_simple.hairTestA3(blonde) != blonde) throw new RuntimeException("hairTest Global A3 failed"); + if (enum_thorough_simple.hairTestA4(blonde) != blonde) throw new RuntimeException("hairTest Global A4 failed"); + if (enum_thorough_simple.hairTestA5(blonde) != blonde) throw new RuntimeException("hairTest Global A5 failed"); + if (enum_thorough_simple.hairTestA6(blonde) != blonde) throw new RuntimeException("hairTest Global A6 failed"); + if (enum_thorough_simple.hairTestA7(blonde) != blonde) throw new RuntimeException("hairTest Global A7 failed"); + if (enum_thorough_simple.hairTestA8(blonde) != blonde) throw new RuntimeException("hairTest Global A8 failed"); + if (enum_thorough_simple.hairTestA9(blonde) != blonde) throw new RuntimeException("hairTest Global A9 failed"); + if (enum_thorough_simple.hairTestAA(blonde) != blonde) throw new RuntimeException("hairTest Global AA failed"); + + if (enum_thorough_simple.hairTestB1(blonde) != blonde) throw new RuntimeException("hairTest Global B1 failed"); + if (enum_thorough_simple.hairTestB2(blonde) != blonde) throw new RuntimeException("hairTest Global B2 failed"); + if (enum_thorough_simple.hairTestB3(blonde) != blonde) throw new RuntimeException("hairTest Global B3 failed"); + if (enum_thorough_simple.hairTestB4(blonde) != blonde) throw new RuntimeException("hairTest Global B4 failed"); + if (enum_thorough_simple.hairTestB5(blonde) != blonde) throw new RuntimeException("hairTest Global B5 failed"); + if (enum_thorough_simple.hairTestB6(blonde) != blonde) throw new RuntimeException("hairTest Global B6 failed"); + if (enum_thorough_simple.hairTestB7(blonde) != blonde) throw new RuntimeException("hairTest Global B7 failed"); + if (enum_thorough_simple.hairTestB8(blonde) != blonde) throw new RuntimeException("hairTest Global B8 failed"); + if (enum_thorough_simple.hairTestB9(blonde) != blonde) throw new RuntimeException("hairTest Global B9 failed"); + if (enum_thorough_simple.hairTestBA(blonde) != blonde) throw new RuntimeException("hairTest Global BA failed"); + + if (enum_thorough_simple.hairTestC1(blonde) != blonde) throw new RuntimeException("hairTest Global C1 failed"); + if (enum_thorough_simple.hairTestC2(blonde) != blonde) throw new RuntimeException("hairTest Global C2 failed"); + if (enum_thorough_simple.hairTestC3(blonde) != blonde) throw new RuntimeException("hairTest Global C3 failed"); + if (enum_thorough_simple.hairTestC4(blonde) != blonde) throw new RuntimeException("hairTest Global C4 failed"); + if (enum_thorough_simple.hairTestC5(blonde) != blonde) throw new RuntimeException("hairTest Global C5 failed"); + if (enum_thorough_simple.hairTestC6(blonde) != blonde) throw new RuntimeException("hairTest Global C6 failed"); + if (enum_thorough_simple.hairTestC7(blonde) != blonde) throw new RuntimeException("hairTest Global C7 failed"); + if (enum_thorough_simple.hairTestC8(blonde) != blonde) throw new RuntimeException("hairTest Global C8 failed"); + if (enum_thorough_simple.hairTestC9(blonde) != blonde) throw new RuntimeException("hairTest Global C9 failed"); + if (enum_thorough_simple.hairTestCA(blonde) != blonde) throw new RuntimeException("hairTest Global CA failed"); + } + { + FirStruct f = new FirStruct(); + int blonde = HairStruct.blonde; + + if (f.hairTestFir1(blonde) != blonde) throw new RuntimeException("hairTestFir 1 failed"); + if (f.hairTestFir2(blonde) != blonde) throw new RuntimeException("hairTestFir 2 failed"); + if (f.hairTestFir3(blonde) != blonde) throw new RuntimeException("hairTestFir 3 failed"); + if (f.hairTestFir4(blonde) != blonde) throw new RuntimeException("hairTestFir 4 failed"); + if (f.hairTestFir5(blonde) != blonde) throw new RuntimeException("hairTestFir 5 failed"); + if (f.hairTestFir6(blonde) != blonde) throw new RuntimeException("hairTestFir 6 failed"); + if (f.hairTestFir7(blonde) != blonde) throw new RuntimeException("hairTestFir 7 failed"); + if (f.hairTestFir8(blonde) != blonde) throw new RuntimeException("hairTestFir 8 failed"); + if (f.hairTestFir9(blonde) != blonde) throw new RuntimeException("hairTestFir 9 failed"); + if (f.hairTestFirA(blonde) != blonde) throw new RuntimeException("hairTestFir A failed"); + } + { + enum_thorough_simple.setGlobalInstance(enum_thorough_simple.globalinstance2); + if (enum_thorough_simple.getGlobalInstance() != enum_thorough_simple.globalinstance2) throw new RuntimeException("GlobalInstance 1 failed"); + + Instances i = new Instances(); + i.setMemberInstance(Instances.memberinstance3); + if (i.getMemberInstance() != Instances.memberinstance3) throw new RuntimeException("MemberInstance 1 failed"); + } + } +} + diff --git a/SWIG/Examples/test-suite/java/enum_thorough_typeunsafe_runme.java b/SWIG/Examples/test-suite/java/enum_thorough_typeunsafe_runme.java new file mode 100644 index 000000000..6c7c8dd8d --- /dev/null +++ b/SWIG/Examples/test-suite/java/enum_thorough_typeunsafe_runme.java @@ -0,0 +1,361 @@ + +import enum_thorough_typeunsafe.*; + +public class enum_thorough_typeunsafe_runme { + + static { + try { + System.loadLibrary("enum_thorough_typeunsafe"); + } 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[]) + { + { + // Anonymous enums + int i = enum_thorough_typeunsafe.AnonEnum1; + if (enum_thorough_typeunsafe.ReallyAnInteger != 200) throw new RuntimeException("Test Anon 1 failed"); + int j = enum_thorough_typeunsafe.AnonSpaceEnum1; + int k = AnonStruct.AnonStructEnum1; + } + { + int red = colour.red; + enum_thorough_typeunsafe.colourTest1(red); + enum_thorough_typeunsafe.colourTest2(red); + enum_thorough_typeunsafe.colourTest3(red); + enum_thorough_typeunsafe.colourTest4(red); + enum_thorough_typeunsafe.setMyColour(red); + } + { + SpeedClass s = new SpeedClass(); + int speed = SpeedClass.speed.slow; + if (s.speedTest1(speed) != speed) throw new RuntimeException("speedTest 1 failed"); + if (s.speedTest2(speed) != speed) throw new RuntimeException("speedTest 2 failed"); + if (s.speedTest3(speed) != speed) throw new RuntimeException("speedTest 3 failed"); + if (s.speedTest4(speed) != speed) throw new RuntimeException("speedTest 4 failed"); + if (s.speedTest5(speed) != speed) throw new RuntimeException("speedTest 5 failed"); + if (s.speedTest6(speed) != speed) throw new RuntimeException("speedTest 6 failed"); + + if (enum_thorough_typeunsafe.speedTest1(speed) != speed) throw new RuntimeException("speedTest Global 1 failed"); + if (enum_thorough_typeunsafe.speedTest2(speed) != speed) throw new RuntimeException("speedTest Global 2 failed"); + if (enum_thorough_typeunsafe.speedTest3(speed) != speed) throw new RuntimeException("speedTest Global 3 failed"); + if (enum_thorough_typeunsafe.speedTest4(speed) != speed) throw new RuntimeException("speedTest Global 4 failed"); + } + { + SpeedClass s = new SpeedClass(); + int slow = SpeedClass.speed.slow; + int lightning = SpeedClass.speed.lightning; + + if (s.getMySpeedtd1() != slow) throw new RuntimeException("mySpeedtd1 1 failed"); + if (s.getMySpeedtd1() != 10) throw new RuntimeException("mySpeedtd1 2 failed"); + + s.setMySpeedtd1(lightning); + if (s.getMySpeedtd1() != lightning) throw new RuntimeException("mySpeedtd1 3 failed"); + if (s.getMySpeedtd1() != 31) throw new RuntimeException("mySpeedtd1 4 failed"); + } + { + if (enum_thorough_typeunsafe.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new RuntimeException("namedanonTest 1 failed"); + } + { + int val = twonames.TwoNames2; + if (enum_thorough_typeunsafe.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed"); + if (enum_thorough_typeunsafe.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed"); + if (enum_thorough_typeunsafe.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed"); + } + { + TwoNamesStruct t = new TwoNamesStruct(); + int val = TwoNamesStruct.twonames.TwoNamesStruct1; + if (t.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed"); + if (t.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed"); + if (t.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed"); + } + { + int val = namedanonspace.NamedAnonSpace2; + if (enum_thorough_typeunsafe.namedanonspaceTest1(val) != val) throw new RuntimeException("namedanonspaceTest 1 failed"); + if (enum_thorough_typeunsafe.namedanonspaceTest2(val) != val) throw new RuntimeException("namedanonspaceTest 2 failed"); + if (enum_thorough_typeunsafe.namedanonspaceTest3(val) != val) throw new RuntimeException("namedanonspaceTest 3 failed"); + if (enum_thorough_typeunsafe.namedanonspaceTest4(val) != val) throw new RuntimeException("namedanonspaceTest 4 failed"); + } + { + TemplateClassInt t = new TemplateClassInt(); + int galileo = TemplateClassInt.scientists.galileo; + + if (t.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest 1 failed"); + if (t.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest 2 failed"); + if (t.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest 3 failed"); + if (t.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest 4 failed"); + if (t.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest 5 failed"); + if (t.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest 6 failed"); + if (t.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest 7 failed"); + if (t.scientistsTest8(galileo) != galileo) throw new RuntimeException("scientistsTest 8 failed"); + if (t.scientistsTest9(galileo) != galileo) throw new RuntimeException("scientistsTest 9 failed"); +// if (t.scientistsTestA(galileo) != galileo) throw new RuntimeException("scientistsTest A failed"); + if (t.scientistsTestB(galileo) != galileo) throw new RuntimeException("scientistsTest B failed"); +// if (t.scientistsTestC(galileo) != galileo) throw new RuntimeException("scientistsTest C failed"); + if (t.scientistsTestD(galileo) != galileo) throw new RuntimeException("scientistsTest D failed"); + if (t.scientistsTestE(galileo) != galileo) throw new RuntimeException("scientistsTest E failed"); + if (t.scientistsTestF(galileo) != galileo) throw new RuntimeException("scientistsTest F failed"); + if (t.scientistsTestG(galileo) != galileo) throw new RuntimeException("scientistsTest G failed"); + if (t.scientistsTestH(galileo) != galileo) throw new RuntimeException("scientistsTest H failed"); + if (t.scientistsTestI(galileo) != galileo) throw new RuntimeException("scientistsTest I failed"); + + if (enum_thorough_typeunsafe.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest Global 1 failed"); + if (enum_thorough_typeunsafe.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest Global 2 failed"); + if (enum_thorough_typeunsafe.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest Global 3 failed"); + if (enum_thorough_typeunsafe.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest Global 4 failed"); + if (enum_thorough_typeunsafe.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest Global 5 failed"); + if (enum_thorough_typeunsafe.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest Global 6 failed"); + if (enum_thorough_typeunsafe.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest Global 7 failed"); + } + { + TClassInt t = new TClassInt(); + int bell = TClassInt.scientists.bell; + int galileo = TemplateClassInt.scientists.galileo; + if (t.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest 1 failed"); + if (t.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest 2 failed"); + if (t.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest 3 failed"); + if (t.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest 4 failed"); + if (t.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest 5 failed"); + if (t.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest 6 failed"); + if (t.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest 7 failed"); + if (t.scientistsNameTest8(bell) != bell) throw new RuntimeException("scientistsNameTest 8 failed"); + if (t.scientistsNameTest9(bell) != bell) throw new RuntimeException("scientistsNameTest 9 failed"); +// if (t.scientistsNameTestA(bell) != bell) throw new RuntimeException("scientistsNameTest A failed"); + if (t.scientistsNameTestB(bell) != bell) throw new RuntimeException("scientistsNameTest B failed"); +// if (t.scientistsNameTestC(bell) != bell) throw new RuntimeException("scientistsNameTest C failed"); + if (t.scientistsNameTestD(bell) != bell) throw new RuntimeException("scientistsNameTest D failed"); + if (t.scientistsNameTestE(bell) != bell) throw new RuntimeException("scientistsNameTest E failed"); + if (t.scientistsNameTestF(bell) != bell) throw new RuntimeException("scientistsNameTest F failed"); + if (t.scientistsNameTestG(bell) != bell) throw new RuntimeException("scientistsNameTest G failed"); + if (t.scientistsNameTestH(bell) != bell) throw new RuntimeException("scientistsNameTest H failed"); + if (t.scientistsNameTestI(bell) != bell) throw new RuntimeException("scientistsNameTest I failed"); + + if (t.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 1 failed"); + if (t.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 2 failed"); + if (t.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 3 failed"); + if (t.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 4 failed"); + if (t.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 5 failed"); + if (t.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 6 failed"); + if (t.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 7 failed"); + + if (t.scientistsOtherTest1(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 1 failed"); + if (t.scientistsOtherTest2(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 2 failed"); + if (t.scientistsOtherTest3(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 3 failed"); + if (t.scientistsOtherTest4(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 4 failed"); + if (t.scientistsOtherTest5(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 5 failed"); + if (t.scientistsOtherTest6(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 6 failed"); + if (t.scientistsOtherTest7(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 7 failed"); + + if (enum_thorough_typeunsafe.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest Global 1 failed"); + if (enum_thorough_typeunsafe.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest Global 2 failed"); + if (enum_thorough_typeunsafe.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest Global 3 failed"); + if (enum_thorough_typeunsafe.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest Global 4 failed"); + if (enum_thorough_typeunsafe.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest Global 5 failed"); + if (enum_thorough_typeunsafe.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest Global 6 failed"); + if (enum_thorough_typeunsafe.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest Global 7 failed"); + + if (enum_thorough_typeunsafe.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 1 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 2 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 3 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 4 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 5 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 6 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 7 failed"); + + if (enum_thorough_typeunsafe.scientistsNameSpaceTest8(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 8 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTest9(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 9 failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestA(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global A failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestB(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global B failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestC(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global C failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestD(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global D failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestE(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global E failed"); + + if (enum_thorough_typeunsafe.scientistsNameSpaceTestF(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global F failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestG(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global G failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestH(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global H failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestI(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global I failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestJ(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global J failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestK(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global K failed"); + if (enum_thorough_typeunsafe.scientistsNameSpaceTestL(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global L failed"); + } + { + int val = newname.argh; + if (enum_thorough_typeunsafe.renameTest1(val) != val) throw new RuntimeException("renameTest Global 1 failed"); + if (enum_thorough_typeunsafe.renameTest2(val) != val) throw new RuntimeException("renameTest Global 2 failed"); + } + { + NewNameStruct n = new NewNameStruct(); + if (n.renameTest1(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest 1 failed"); + if (n.renameTest2(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest 2 failed"); + if (n.renameTest3(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new RuntimeException("renameTest 3 failed"); + if (n.renameTest4(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest 4 failed"); + if (n.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest 5 failed"); + if (n.renameTest6(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new RuntimeException("renameTest 6 failed"); + } + { + if (enum_thorough_typeunsafe.renameTest3(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest Global 3 failed"); + if (enum_thorough_typeunsafe.renameTest4(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new RuntimeException("renameTest Global 4 failed"); + if (enum_thorough_typeunsafe.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest Global 5 failed"); + if (enum_thorough_typeunsafe.renameTest6(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest Global 6 failed"); + if (enum_thorough_typeunsafe.renameTest7(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new RuntimeException("renameTest Global 7 failed"); + } + { + TreesClass t = new TreesClass(); + int pine = TreesClass.trees.pine; + + if (t.treesTest1(pine) != pine) throw new RuntimeException("treesTest 1 failed"); + if (t.treesTest2(pine) != pine) throw new RuntimeException("treesTest 2 failed"); + if (t.treesTest3(pine) != pine) throw new RuntimeException("treesTest 3 failed"); + if (t.treesTest4(pine) != pine) throw new RuntimeException("treesTest 4 failed"); + if (t.treesTest5(pine) != pine) throw new RuntimeException("treesTest 5 failed"); + if (t.treesTest6(pine) != pine) throw new RuntimeException("treesTest 6 failed"); + if (t.treesTest7(pine) != pine) throw new RuntimeException("treesTest 7 failed"); + if (t.treesTest8(pine) != pine) throw new RuntimeException("treesTest 8 failed"); + if (t.treesTest9(pine) != pine) throw new RuntimeException("treesTest 9 failed"); + if (t.treesTestA(pine) != pine) throw new RuntimeException("treesTest A failed"); + if (t.treesTestB(pine) != pine) throw new RuntimeException("treesTest B failed"); + if (t.treesTestC(pine) != pine) throw new RuntimeException("treesTest C failed"); + if (t.treesTestD(pine) != pine) throw new RuntimeException("treesTest D failed"); + if (t.treesTestE(pine) != pine) throw new RuntimeException("treesTest E failed"); + if (t.treesTestF(pine) != pine) throw new RuntimeException("treesTest F failed"); + if (t.treesTestG(pine) != pine) throw new RuntimeException("treesTest G failed"); + if (t.treesTestH(pine) != pine) throw new RuntimeException("treesTest H failed"); + if (t.treesTestI(pine) != pine) throw new RuntimeException("treesTest I failed"); + if (t.treesTestJ(pine) != pine) throw new RuntimeException("treesTest J failed"); + if (t.treesTestK(pine) != pine) throw new RuntimeException("treesTest K failed"); + if (t.treesTestL(pine) != pine) throw new RuntimeException("treesTest L failed"); + if (t.treesTestM(pine) != pine) throw new RuntimeException("treesTest M failed"); + if (t.treesTestN(pine) != pine) throw new RuntimeException("treesTest N failed"); + if (t.treesTestO(pine) != pine) throw new RuntimeException("treesTest O failed"); + + if (enum_thorough_typeunsafe.treesTest1(pine) != pine) throw new RuntimeException("treesTest Global 1 failed"); + if (enum_thorough_typeunsafe.treesTest2(pine) != pine) throw new RuntimeException("treesTest Global 2 failed"); + if (enum_thorough_typeunsafe.treesTest3(pine) != pine) throw new RuntimeException("treesTest Global 3 failed"); + if (enum_thorough_typeunsafe.treesTest4(pine) != pine) throw new RuntimeException("treesTest Global 4 failed"); + if (enum_thorough_typeunsafe.treesTest5(pine) != pine) throw new RuntimeException("treesTest Global 5 failed"); + if (enum_thorough_typeunsafe.treesTest6(pine) != pine) throw new RuntimeException("treesTest Global 6 failed"); + if (enum_thorough_typeunsafe.treesTest7(pine) != pine) throw new RuntimeException("treesTest Global 7 failed"); + if (enum_thorough_typeunsafe.treesTest8(pine) != pine) throw new RuntimeException("treesTest Global 8 failed"); + if (enum_thorough_typeunsafe.treesTest9(pine) != pine) throw new RuntimeException("treesTest Global 9 failed"); + if (enum_thorough_typeunsafe.treesTestA(pine) != pine) throw new RuntimeException("treesTest Global A failed"); + if (enum_thorough_typeunsafe.treesTestB(pine) != pine) throw new RuntimeException("treesTest Global B failed"); + if (enum_thorough_typeunsafe.treesTestC(pine) != pine) throw new RuntimeException("treesTest Global C failed"); + if (enum_thorough_typeunsafe.treesTestD(pine) != pine) throw new RuntimeException("treesTest Global D failed"); + if (enum_thorough_typeunsafe.treesTestE(pine) != pine) throw new RuntimeException("treesTest Global E failed"); + if (enum_thorough_typeunsafe.treesTestF(pine) != pine) throw new RuntimeException("treesTest Global F failed"); + if (enum_thorough_typeunsafe.treesTestG(pine) != pine) throw new RuntimeException("treesTest Global G failed"); + if (enum_thorough_typeunsafe.treesTestH(pine) != pine) throw new RuntimeException("treesTest Global H failed"); + if (enum_thorough_typeunsafe.treesTestI(pine) != pine) throw new RuntimeException("treesTest Global I failed"); + if (enum_thorough_typeunsafe.treesTestJ(pine) != pine) throw new RuntimeException("treesTest Global J failed"); + if (enum_thorough_typeunsafe.treesTestK(pine) != pine) throw new RuntimeException("treesTest Global K failed"); + if (enum_thorough_typeunsafe.treesTestL(pine) != pine) throw new RuntimeException("treesTest Global L failed"); + if (enum_thorough_typeunsafe.treesTestM(pine) != pine) throw new RuntimeException("treesTest Global M failed"); +// if (enum_thorough_typeunsafe.treesTestN(pine) != pine) throw new RuntimeException("treesTest Global N failed"); + if (enum_thorough_typeunsafe.treesTestO(pine) != pine) throw new RuntimeException("treesTest Global O failed"); + if (enum_thorough_typeunsafe.treesTestP(pine) != pine) throw new RuntimeException("treesTest Global P failed"); + if (enum_thorough_typeunsafe.treesTestQ(pine) != pine) throw new RuntimeException("treesTest Global Q failed"); + if (enum_thorough_typeunsafe.treesTestR(pine) != pine) throw new RuntimeException("treesTest Global R failed"); + } + { + HairStruct h = new HairStruct(); + int ginger = HairStruct.hair.ginger; + + if (h.hairTest1(ginger) != ginger) throw new RuntimeException("hairTest 1 failed"); + if (h.hairTest2(ginger) != ginger) throw new RuntimeException("hairTest 2 failed"); + if (h.hairTest3(ginger) != ginger) throw new RuntimeException("hairTest 3 failed"); + if (h.hairTest4(ginger) != ginger) throw new RuntimeException("hairTest 4 failed"); + if (h.hairTest5(ginger) != ginger) throw new RuntimeException("hairTest 5 failed"); + if (h.hairTest6(ginger) != ginger) throw new RuntimeException("hairTest 6 failed"); + if (h.hairTest7(ginger) != ginger) throw new RuntimeException("hairTest 7 failed"); + if (h.hairTest8(ginger) != ginger) throw new RuntimeException("hairTest 8 failed"); + if (h.hairTest9(ginger) != ginger) throw new RuntimeException("hairTest 9 failed"); + if (h.hairTestA(ginger) != ginger) throw new RuntimeException("hairTest A failed"); + if (h.hairTestB(ginger) != ginger) throw new RuntimeException("hairTest B failed"); + + int red = colour.red; + if (h.colourTest1(red) != red) throw new RuntimeException("colourTest HairStruct 1 failed"); + if (h.colourTest2(red) != red) throw new RuntimeException("colourTest HairStruct 2 failed"); + if (h.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new RuntimeException("namedanonTest HairStruct 1 failed"); + if (h.namedanonspaceTest1(namedanonspace.NamedAnonSpace2) != namedanonspace.NamedAnonSpace2) throw new RuntimeException("namedanonspaceTest HairStruct 1 failed"); + + int fir = TreesClass.trees.fir; + if (h.treesGlobalTest1(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 1 failed"); + if (h.treesGlobalTest2(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 2 failed"); + if (h.treesGlobalTest3(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 3 failed"); + if (h.treesGlobalTest4(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 4 failed"); + } + { + int blonde = HairStruct.hair.blonde; + if (enum_thorough_typeunsafe.hairTest1(blonde) != blonde) throw new RuntimeException("hairTest Global 1 failed"); + if (enum_thorough_typeunsafe.hairTest2(blonde) != blonde) throw new RuntimeException("hairTest Global 2 failed"); + if (enum_thorough_typeunsafe.hairTest3(blonde) != blonde) throw new RuntimeException("hairTest Global 3 failed"); + if (enum_thorough_typeunsafe.hairTest4(blonde) != blonde) throw new RuntimeException("hairTest Global 4 failed"); + if (enum_thorough_typeunsafe.hairTest5(blonde) != blonde) throw new RuntimeException("hairTest Global 5 failed"); + if (enum_thorough_typeunsafe.hairTest6(blonde) != blonde) throw new RuntimeException("hairTest Global 6 failed"); + if (enum_thorough_typeunsafe.hairTest7(blonde) != blonde) throw new RuntimeException("hairTest Global 7 failed"); + if (enum_thorough_typeunsafe.hairTest8(blonde) != blonde) throw new RuntimeException("hairTest Global 8 failed"); + if (enum_thorough_typeunsafe.hairTest9(blonde) != blonde) throw new RuntimeException("hairTest Global 9 failed"); + if (enum_thorough_typeunsafe.hairTestA(blonde) != blonde) throw new RuntimeException("hairTest Global A failed"); + + if (enum_thorough_typeunsafe.hairTestA1(blonde) != blonde) throw new RuntimeException("hairTest Global A1 failed"); + if (enum_thorough_typeunsafe.hairTestA2(blonde) != blonde) throw new RuntimeException("hairTest Global A2 failed"); + if (enum_thorough_typeunsafe.hairTestA3(blonde) != blonde) throw new RuntimeException("hairTest Global A3 failed"); + if (enum_thorough_typeunsafe.hairTestA4(blonde) != blonde) throw new RuntimeException("hairTest Global A4 failed"); + if (enum_thorough_typeunsafe.hairTestA5(blonde) != blonde) throw new RuntimeException("hairTest Global A5 failed"); + if (enum_thorough_typeunsafe.hairTestA6(blonde) != blonde) throw new RuntimeException("hairTest Global A6 failed"); + if (enum_thorough_typeunsafe.hairTestA7(blonde) != blonde) throw new RuntimeException("hairTest Global A7 failed"); + if (enum_thorough_typeunsafe.hairTestA8(blonde) != blonde) throw new RuntimeException("hairTest Global A8 failed"); + if (enum_thorough_typeunsafe.hairTestA9(blonde) != blonde) throw new RuntimeException("hairTest Global A9 failed"); + if (enum_thorough_typeunsafe.hairTestAA(blonde) != blonde) throw new RuntimeException("hairTest Global AA failed"); + + if (enum_thorough_typeunsafe.hairTestB1(blonde) != blonde) throw new RuntimeException("hairTest Global B1 failed"); + if (enum_thorough_typeunsafe.hairTestB2(blonde) != blonde) throw new RuntimeException("hairTest Global B2 failed"); + if (enum_thorough_typeunsafe.hairTestB3(blonde) != blonde) throw new RuntimeException("hairTest Global B3 failed"); + if (enum_thorough_typeunsafe.hairTestB4(blonde) != blonde) throw new RuntimeException("hairTest Global B4 failed"); + if (enum_thorough_typeunsafe.hairTestB5(blonde) != blonde) throw new RuntimeException("hairTest Global B5 failed"); + if (enum_thorough_typeunsafe.hairTestB6(blonde) != blonde) throw new RuntimeException("hairTest Global B6 failed"); + if (enum_thorough_typeunsafe.hairTestB7(blonde) != blonde) throw new RuntimeException("hairTest Global B7 failed"); + if (enum_thorough_typeunsafe.hairTestB8(blonde) != blonde) throw new RuntimeException("hairTest Global B8 failed"); + if (enum_thorough_typeunsafe.hairTestB9(blonde) != blonde) throw new RuntimeException("hairTest Global B9 failed"); + if (enum_thorough_typeunsafe.hairTestBA(blonde) != blonde) throw new RuntimeException("hairTest Global BA failed"); + + if (enum_thorough_typeunsafe.hairTestC1(blonde) != blonde) throw new RuntimeException("hairTest Global C1 failed"); + if (enum_thorough_typeunsafe.hairTestC2(blonde) != blonde) throw new RuntimeException("hairTest Global C2 failed"); + if (enum_thorough_typeunsafe.hairTestC3(blonde) != blonde) throw new RuntimeException("hairTest Global C3 failed"); + if (enum_thorough_typeunsafe.hairTestC4(blonde) != blonde) throw new RuntimeException("hairTest Global C4 failed"); + if (enum_thorough_typeunsafe.hairTestC5(blonde) != blonde) throw new RuntimeException("hairTest Global C5 failed"); + if (enum_thorough_typeunsafe.hairTestC6(blonde) != blonde) throw new RuntimeException("hairTest Global C6 failed"); + if (enum_thorough_typeunsafe.hairTestC7(blonde) != blonde) throw new RuntimeException("hairTest Global C7 failed"); + if (enum_thorough_typeunsafe.hairTestC8(blonde) != blonde) throw new RuntimeException("hairTest Global C8 failed"); + if (enum_thorough_typeunsafe.hairTestC9(blonde) != blonde) throw new RuntimeException("hairTest Global C9 failed"); + if (enum_thorough_typeunsafe.hairTestCA(blonde) != blonde) throw new RuntimeException("hairTest Global CA failed"); + } + { + FirStruct f = new FirStruct(); + int blonde = HairStruct.hair.blonde; + + if (f.hairTestFir1(blonde) != blonde) throw new RuntimeException("hairTestFir 1 failed"); + if (f.hairTestFir2(blonde) != blonde) throw new RuntimeException("hairTestFir 2 failed"); + if (f.hairTestFir3(blonde) != blonde) throw new RuntimeException("hairTestFir 3 failed"); + if (f.hairTestFir4(blonde) != blonde) throw new RuntimeException("hairTestFir 4 failed"); + if (f.hairTestFir5(blonde) != blonde) throw new RuntimeException("hairTestFir 5 failed"); + if (f.hairTestFir6(blonde) != blonde) throw new RuntimeException("hairTestFir 6 failed"); + if (f.hairTestFir7(blonde) != blonde) throw new RuntimeException("hairTestFir 7 failed"); + if (f.hairTestFir8(blonde) != blonde) throw new RuntimeException("hairTestFir 8 failed"); + if (f.hairTestFir9(blonde) != blonde) throw new RuntimeException("hairTestFir 9 failed"); + if (f.hairTestFirA(blonde) != blonde) throw new RuntimeException("hairTestFir A failed"); + } + { + enum_thorough_typeunsafe.setGlobalInstance(enum_thorough_typeunsafe.globalinstance2); + if (enum_thorough_typeunsafe.getGlobalInstance() != enum_thorough_typeunsafe.globalinstance2) throw new RuntimeException("GlobalInstance 1 failed"); + + Instances i = new Instances(); + i.setMemberInstance(Instances.memberinstance3); + if (i.getMemberInstance() != Instances.memberinstance3) throw new RuntimeException("MemberInstance 1 failed"); + } + } +} + diff --git a/SWIG/Examples/test-suite/java/java_enums_runme.java b/SWIG/Examples/test-suite/java/java_enums_runme.java index 300241416..bc7d41636 100644 --- a/SWIG/Examples/test-suite/java/java_enums_runme.java +++ b/SWIG/Examples/test-suite/java/java_enums_runme.java @@ -1,7 +1,7 @@ import java_enums.*; -public class java_enums_runme implements java_enumsConstants { +public class java_enums_runme implements stuff { static { try { System.loadLibrary("java_enums"); @@ -18,26 +18,26 @@ public class java_enums_runme implements java_enumsConstants { // Switch statement will only compile if these enums are initialised // from a constant Java value, that is not from a function call switch(number) { - case java_enums.FIDDLE: + case stuff.FIDDLE: break; - case java_enums.STICKS: + case stuff.STICKS: break; - case java_enums.BONGO: + case stuff.BONGO: break; - case java_enums.DRUMS: + case stuff.DRUMS: break; default: break; } - if (java_enums.DRUMS != 15) + if (stuff.DRUMS != 15) throw new RuntimeException("Incorrect value for DRUMS"); // check typemaps use short for this enum - short nonsense = java_enums.POPPYCOCK; - short tst1 = java_enums.test1(nonsense); - short tst2 = java_enums.test2(nonsense); + short poppycock = nonsense.POPPYCOCK; + short tst1 = java_enums.test1(poppycock); + short tst2 = java_enums.test2(poppycock); - // Check that we can drop the java_enums keyword as this class implements the java_enumsConstants interface + // Check that stuff is an interface and not a class - we can drop the stuff keyword as this class implements the stuff interface switch(number) { case FIDDLE: break; diff --git a/SWIG/Examples/test-suite/java/java_lib_arrays_runme.java b/SWIG/Examples/test-suite/java/java_lib_arrays_runme.java index 9c245e0e9..6866d3a96 100644 --- a/SWIG/Examples/test-suite/java/java_lib_arrays_runme.java +++ b/SWIG/Examples/test-suite/java/java_lib_arrays_runme.java @@ -34,7 +34,7 @@ public class java_lib_arrays_runme { long[] array_ll = {1008, 2008}; float[] array_f = {1009.1f, 2009.1f}; double[] array_d = {1010.2f, 2010.2f}; - int[] array_enum = {java_lib_arrays.Three, java_lib_arrays.Four}; + int[] array_enum = {finger.Three, finger.Four}; SimpleStruct[] array_struct={new SimpleStruct(), new SimpleStruct()}; array_struct[0].setDouble_field(222.333);