PageRenderTime 118ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/java/enum_thorough_proper_runme.java

#
Java | 443 lines | 407 code | 27 blank | 9 comment | 598 complexity | abb26cb49a52dcdc29f7575a498a6520 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import enum_thorough_proper.*;
  2. public class enum_thorough_proper_runme {
  3. static {
  4. try {
  5. System.loadLibrary("enum_thorough_proper");
  6. } catch (UnsatisfiedLinkError e) {
  7. 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);
  8. System.exit(1);
  9. }
  10. }
  11. public static void main(String argv[])
  12. {
  13. {
  14. // Anonymous enums
  15. int i = enum_thorough_proper.AnonEnum1;
  16. if (enum_thorough_proper.ReallyAnInteger != 200) throw new RuntimeException("Test Anon 1 failed");
  17. int j = enum_thorough_proper.AnonSpaceEnum1;
  18. int k = AnonStruct.AnonStructEnum1;
  19. }
  20. {
  21. colour red = colour.red;
  22. enum_thorough_proper.colourTest1(red);
  23. enum_thorough_proper.colourTest2(red);
  24. enum_thorough_proper.colourTest3(red);
  25. enum_thorough_proper.colourTest4(red);
  26. enum_thorough_proper.setMyColour(red);
  27. }
  28. {
  29. SpeedClass s = new SpeedClass();
  30. SpeedClass.speed speed = SpeedClass.speed.slow;
  31. if (s.speedTest1(speed) != speed) throw new RuntimeException("speedTest 1 failed");
  32. if (s.speedTest2(speed) != speed) throw new RuntimeException("speedTest 2 failed");
  33. if (s.speedTest3(speed) != speed) throw new RuntimeException("speedTest 3 failed");
  34. if (s.speedTest4(speed) != speed) throw new RuntimeException("speedTest 4 failed");
  35. if (s.speedTest5(speed) != speed) throw new RuntimeException("speedTest 5 failed");
  36. if (s.speedTest6(speed) != speed) throw new RuntimeException("speedTest 6 failed");
  37. if (s.speedTest7(speed) != speed) throw new RuntimeException("speedTest 7 failed");
  38. if (s.speedTest8(speed) != speed) throw new RuntimeException("speedTest 8 failed");
  39. if (enum_thorough_proper.speedTest1(speed) != speed) throw new RuntimeException("speedTest Global 1 failed");
  40. if (enum_thorough_proper.speedTest2(speed) != speed) throw new RuntimeException("speedTest Global 2 failed");
  41. if (enum_thorough_proper.speedTest3(speed) != speed) throw new RuntimeException("speedTest Global 3 failed");
  42. if (enum_thorough_proper.speedTest4(speed) != speed) throw new RuntimeException("speedTest Global 4 failed");
  43. if (enum_thorough_proper.speedTest5(speed) != speed) throw new RuntimeException("speedTest Global 5 failed");
  44. }
  45. {
  46. SpeedClass s = new SpeedClass();
  47. SpeedClass.speed slow = SpeedClass.speed.slow;
  48. SpeedClass.speed lightning = SpeedClass.speed.lightning;
  49. if (s.getMySpeedtd1() != slow) throw new RuntimeException("mySpeedtd1 1 failed");
  50. if (s.getMySpeedtd1().swigValue() != 10) throw new RuntimeException("mySpeedtd1 2 failed");
  51. s.setMySpeedtd1(lightning);
  52. if (s.getMySpeedtd1() != lightning) throw new RuntimeException("mySpeedtd1 3 failed");
  53. if (s.getMySpeedtd1().swigValue() != 31) throw new RuntimeException("mySpeedtd1 4 failed");
  54. }
  55. {
  56. if (enum_thorough_proper.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new RuntimeException("namedanonTest 1 failed");
  57. }
  58. {
  59. twonames val = twonames.TwoNames2;
  60. if (enum_thorough_proper.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed");
  61. if (enum_thorough_proper.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed");
  62. if (enum_thorough_proper.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed");
  63. }
  64. {
  65. TwoNamesStruct t = new TwoNamesStruct();
  66. TwoNamesStruct.twonames val = TwoNamesStruct.twonames.TwoNamesStruct1;
  67. if (t.twonamesTest1(val) != val) throw new RuntimeException("twonamesTest 1 failed");
  68. if (t.twonamesTest2(val) != val) throw new RuntimeException("twonamesTest 2 failed");
  69. if (t.twonamesTest3(val) != val) throw new RuntimeException("twonamesTest 3 failed");
  70. }
  71. {
  72. namedanonspace val = namedanonspace.NamedAnonSpace2;
  73. if (enum_thorough_proper.namedanonspaceTest1(val) != val) throw new RuntimeException("namedanonspaceTest 1 failed");
  74. if (enum_thorough_proper.namedanonspaceTest2(val) != val) throw new RuntimeException("namedanonspaceTest 2 failed");
  75. if (enum_thorough_proper.namedanonspaceTest3(val) != val) throw new RuntimeException("namedanonspaceTest 3 failed");
  76. if (enum_thorough_proper.namedanonspaceTest4(val) != val) throw new RuntimeException("namedanonspaceTest 4 failed");
  77. }
  78. {
  79. TemplateClassInt t = new TemplateClassInt();
  80. TemplateClassInt.scientists galileo = TemplateClassInt.scientists.galileo;
  81. if (t.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest 1 failed");
  82. if (t.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest 2 failed");
  83. if (t.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest 3 failed");
  84. if (t.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest 4 failed");
  85. if (t.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest 5 failed");
  86. if (t.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest 6 failed");
  87. if (t.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest 7 failed");
  88. if (t.scientistsTest8(galileo) != galileo) throw new RuntimeException("scientistsTest 8 failed");
  89. if (t.scientistsTest9(galileo) != galileo) throw new RuntimeException("scientistsTest 9 failed");
  90. // if (t.scientistsTestA(galileo) != galileo) throw new RuntimeException("scientistsTest A failed");
  91. if (t.scientistsTestB(galileo) != galileo) throw new RuntimeException("scientistsTest B failed");
  92. // if (t.scientistsTestC(galileo) != galileo) throw new RuntimeException("scientistsTest C failed");
  93. if (t.scientistsTestD(galileo) != galileo) throw new RuntimeException("scientistsTest D failed");
  94. if (t.scientistsTestE(galileo) != galileo) throw new RuntimeException("scientistsTest E failed");
  95. if (t.scientistsTestF(galileo) != galileo) throw new RuntimeException("scientistsTest F failed");
  96. if (t.scientistsTestG(galileo) != galileo) throw new RuntimeException("scientistsTest G failed");
  97. if (t.scientistsTestH(galileo) != galileo) throw new RuntimeException("scientistsTest H failed");
  98. if (t.scientistsTestI(galileo) != galileo) throw new RuntimeException("scientistsTest I failed");
  99. if (t.scientistsTestJ(galileo) != galileo) throw new RuntimeException("scientistsTest J failed");
  100. if (enum_thorough_proper.scientistsTest1(galileo) != galileo) throw new RuntimeException("scientistsTest Global 1 failed");
  101. if (enum_thorough_proper.scientistsTest2(galileo) != galileo) throw new RuntimeException("scientistsTest Global 2 failed");
  102. if (enum_thorough_proper.scientistsTest3(galileo) != galileo) throw new RuntimeException("scientistsTest Global 3 failed");
  103. if (enum_thorough_proper.scientistsTest4(galileo) != galileo) throw new RuntimeException("scientistsTest Global 4 failed");
  104. if (enum_thorough_proper.scientistsTest5(galileo) != galileo) throw new RuntimeException("scientistsTest Global 5 failed");
  105. if (enum_thorough_proper.scientistsTest6(galileo) != galileo) throw new RuntimeException("scientistsTest Global 6 failed");
  106. if (enum_thorough_proper.scientistsTest7(galileo) != galileo) throw new RuntimeException("scientistsTest Global 7 failed");
  107. if (enum_thorough_proper.scientistsTest8(galileo) != galileo) throw new RuntimeException("scientistsTest Global 8 failed");
  108. }
  109. {
  110. TClassInt t = new TClassInt();
  111. TClassInt.scientists bell = TClassInt.scientists.bell;
  112. TemplateClassInt.scientists galileo = TemplateClassInt.scientists.galileo;
  113. if (t.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest 1 failed");
  114. if (t.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest 2 failed");
  115. if (t.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest 3 failed");
  116. if (t.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest 4 failed");
  117. if (t.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest 5 failed");
  118. if (t.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest 6 failed");
  119. if (t.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest 7 failed");
  120. if (t.scientistsNameTest8(bell) != bell) throw new RuntimeException("scientistsNameTest 8 failed");
  121. if (t.scientistsNameTest9(bell) != bell) throw new RuntimeException("scientistsNameTest 9 failed");
  122. // if (t.scientistsNameTestA(bell) != bell) throw new RuntimeException("scientistsNameTest A failed");
  123. if (t.scientistsNameTestB(bell) != bell) throw new RuntimeException("scientistsNameTest B failed");
  124. // if (t.scientistsNameTestC(bell) != bell) throw new RuntimeException("scientistsNameTest C failed");
  125. if (t.scientistsNameTestD(bell) != bell) throw new RuntimeException("scientistsNameTest D failed");
  126. if (t.scientistsNameTestE(bell) != bell) throw new RuntimeException("scientistsNameTest E failed");
  127. if (t.scientistsNameTestF(bell) != bell) throw new RuntimeException("scientistsNameTest F failed");
  128. if (t.scientistsNameTestG(bell) != bell) throw new RuntimeException("scientistsNameTest G failed");
  129. if (t.scientistsNameTestH(bell) != bell) throw new RuntimeException("scientistsNameTest H failed");
  130. if (t.scientistsNameTestI(bell) != bell) throw new RuntimeException("scientistsNameTest I failed");
  131. if (t.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 1 failed");
  132. if (t.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 2 failed");
  133. if (t.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 3 failed");
  134. if (t.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 4 failed");
  135. if (t.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 5 failed");
  136. if (t.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 6 failed");
  137. if (t.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest 7 failed");
  138. if (t.scientistsOtherTest1(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 1 failed");
  139. if (t.scientistsOtherTest2(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 2 failed");
  140. if (t.scientistsOtherTest3(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 3 failed");
  141. if (t.scientistsOtherTest4(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 4 failed");
  142. if (t.scientistsOtherTest5(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 5 failed");
  143. if (t.scientistsOtherTest6(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 6 failed");
  144. if (t.scientistsOtherTest7(galileo) != galileo) throw new RuntimeException("scientistsOtherTest 7 failed");
  145. if (enum_thorough_proper.scientistsNameTest1(bell) != bell) throw new RuntimeException("scientistsNameTest Global 1 failed");
  146. if (enum_thorough_proper.scientistsNameTest2(bell) != bell) throw new RuntimeException("scientistsNameTest Global 2 failed");
  147. if (enum_thorough_proper.scientistsNameTest3(bell) != bell) throw new RuntimeException("scientistsNameTest Global 3 failed");
  148. if (enum_thorough_proper.scientistsNameTest4(bell) != bell) throw new RuntimeException("scientistsNameTest Global 4 failed");
  149. if (enum_thorough_proper.scientistsNameTest5(bell) != bell) throw new RuntimeException("scientistsNameTest Global 5 failed");
  150. if (enum_thorough_proper.scientistsNameTest6(bell) != bell) throw new RuntimeException("scientistsNameTest Global 6 failed");
  151. if (enum_thorough_proper.scientistsNameTest7(bell) != bell) throw new RuntimeException("scientistsNameTest Global 7 failed");
  152. if (enum_thorough_proper.scientistsNameSpaceTest1(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 1 failed");
  153. if (enum_thorough_proper.scientistsNameSpaceTest2(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 2 failed");
  154. if (enum_thorough_proper.scientistsNameSpaceTest3(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 3 failed");
  155. if (enum_thorough_proper.scientistsNameSpaceTest4(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 4 failed");
  156. if (enum_thorough_proper.scientistsNameSpaceTest5(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 5 failed");
  157. if (enum_thorough_proper.scientistsNameSpaceTest6(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 6 failed");
  158. if (enum_thorough_proper.scientistsNameSpaceTest7(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 7 failed");
  159. if (enum_thorough_proper.scientistsNameSpaceTest8(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 8 failed");
  160. if (enum_thorough_proper.scientistsNameSpaceTest9(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global 9 failed");
  161. if (enum_thorough_proper.scientistsNameSpaceTestA(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global A failed");
  162. if (enum_thorough_proper.scientistsNameSpaceTestB(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global B failed");
  163. if (enum_thorough_proper.scientistsNameSpaceTestC(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global C failed");
  164. if (enum_thorough_proper.scientistsNameSpaceTestD(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global D failed");
  165. if (enum_thorough_proper.scientistsNameSpaceTestE(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global E failed");
  166. if (enum_thorough_proper.scientistsNameSpaceTestF(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global F failed");
  167. if (enum_thorough_proper.scientistsNameSpaceTestG(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global G failed");
  168. if (enum_thorough_proper.scientistsNameSpaceTestH(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global H failed");
  169. if (enum_thorough_proper.scientistsNameSpaceTestI(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global I failed");
  170. if (enum_thorough_proper.scientistsNameSpaceTestJ(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global J failed");
  171. if (enum_thorough_proper.scientistsNameSpaceTestK(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global K failed");
  172. if (enum_thorough_proper.scientistsNameSpaceTestL(bell) != bell) throw new RuntimeException("scientistsNameSpaceTest Global L failed");
  173. }
  174. {
  175. newname val = newname.argh;
  176. if (enum_thorough_proper.renameTest1(val) != val) throw new RuntimeException("renameTest Global 1 failed");
  177. if (enum_thorough_proper.renameTest2(val) != val) throw new RuntimeException("renameTest Global 2 failed");
  178. }
  179. {
  180. NewNameStruct n = new NewNameStruct();
  181. if (n.renameTest1(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest 1 failed");
  182. if (n.renameTest2(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest 2 failed");
  183. if (n.renameTest3(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new RuntimeException("renameTest 3 failed");
  184. if (n.renameTest4(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest 4 failed");
  185. if (n.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest 5 failed");
  186. if (n.renameTest6(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new RuntimeException("renameTest 6 failed");
  187. }
  188. {
  189. if (enum_thorough_proper.renameTest3(NewNameStruct.enumeration.bang) != NewNameStruct.enumeration.bang) throw new RuntimeException("renameTest Global 3 failed");
  190. if (enum_thorough_proper.renameTest4(NewNameStruct.simplerenamed.simple1) != NewNameStruct.simplerenamed.simple1) throw new RuntimeException("renameTest Global 4 failed");
  191. if (enum_thorough_proper.renameTest5(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest Global 5 failed");
  192. if (enum_thorough_proper.renameTest6(NewNameStruct.doublenamerenamed.doublename1) != NewNameStruct.doublenamerenamed.doublename1) throw new RuntimeException("renameTest Global 6 failed");
  193. if (enum_thorough_proper.renameTest7(NewNameStruct.singlenamerenamed.singlename1) != NewNameStruct.singlenamerenamed.singlename1) throw new RuntimeException("renameTest Global 7 failed");
  194. }
  195. {
  196. TreesClass t = new TreesClass();
  197. TreesClass.trees pine = TreesClass.trees.pine;
  198. if (t.treesTest1(pine) != pine) throw new RuntimeException("treesTest 1 failed");
  199. if (t.treesTest2(pine) != pine) throw new RuntimeException("treesTest 2 failed");
  200. if (t.treesTest3(pine) != pine) throw new RuntimeException("treesTest 3 failed");
  201. if (t.treesTest4(pine) != pine) throw new RuntimeException("treesTest 4 failed");
  202. if (t.treesTest5(pine) != pine) throw new RuntimeException("treesTest 5 failed");
  203. if (t.treesTest6(pine) != pine) throw new RuntimeException("treesTest 6 failed");
  204. if (t.treesTest7(pine) != pine) throw new RuntimeException("treesTest 7 failed");
  205. if (t.treesTest8(pine) != pine) throw new RuntimeException("treesTest 8 failed");
  206. if (t.treesTest9(pine) != pine) throw new RuntimeException("treesTest 9 failed");
  207. if (t.treesTestA(pine) != pine) throw new RuntimeException("treesTest A failed");
  208. if (t.treesTestB(pine) != pine) throw new RuntimeException("treesTest B failed");
  209. if (t.treesTestC(pine) != pine) throw new RuntimeException("treesTest C failed");
  210. if (t.treesTestD(pine) != pine) throw new RuntimeException("treesTest D failed");
  211. if (t.treesTestE(pine) != pine) throw new RuntimeException("treesTest E failed");
  212. if (t.treesTestF(pine) != pine) throw new RuntimeException("treesTest F failed");
  213. if (t.treesTestG(pine) != pine) throw new RuntimeException("treesTest G failed");
  214. if (t.treesTestH(pine) != pine) throw new RuntimeException("treesTest H failed");
  215. if (t.treesTestI(pine) != pine) throw new RuntimeException("treesTest I failed");
  216. if (t.treesTestJ(pine) != pine) throw new RuntimeException("treesTest J failed");
  217. if (t.treesTestK(pine) != pine) throw new RuntimeException("treesTest K failed");
  218. if (t.treesTestL(pine) != pine) throw new RuntimeException("treesTest L failed");
  219. if (t.treesTestM(pine) != pine) throw new RuntimeException("treesTest M failed");
  220. if (t.treesTestN(pine) != pine) throw new RuntimeException("treesTest N failed");
  221. if (t.treesTestO(pine) != pine) throw new RuntimeException("treesTest O failed");
  222. if (enum_thorough_proper.treesTest1(pine) != pine) throw new RuntimeException("treesTest Global 1 failed");
  223. if (enum_thorough_proper.treesTest2(pine) != pine) throw new RuntimeException("treesTest Global 2 failed");
  224. if (enum_thorough_proper.treesTest3(pine) != pine) throw new RuntimeException("treesTest Global 3 failed");
  225. if (enum_thorough_proper.treesTest4(pine) != pine) throw new RuntimeException("treesTest Global 4 failed");
  226. if (enum_thorough_proper.treesTest5(pine) != pine) throw new RuntimeException("treesTest Global 5 failed");
  227. if (enum_thorough_proper.treesTest6(pine) != pine) throw new RuntimeException("treesTest Global 6 failed");
  228. if (enum_thorough_proper.treesTest7(pine) != pine) throw new RuntimeException("treesTest Global 7 failed");
  229. if (enum_thorough_proper.treesTest8(pine) != pine) throw new RuntimeException("treesTest Global 8 failed");
  230. if (enum_thorough_proper.treesTest9(pine) != pine) throw new RuntimeException("treesTest Global 9 failed");
  231. if (enum_thorough_proper.treesTestA(pine) != pine) throw new RuntimeException("treesTest Global A failed");
  232. if (enum_thorough_proper.treesTestB(pine) != pine) throw new RuntimeException("treesTest Global B failed");
  233. if (enum_thorough_proper.treesTestC(pine) != pine) throw new RuntimeException("treesTest Global C failed");
  234. if (enum_thorough_proper.treesTestD(pine) != pine) throw new RuntimeException("treesTest Global D failed");
  235. if (enum_thorough_proper.treesTestE(pine) != pine) throw new RuntimeException("treesTest Global E failed");
  236. if (enum_thorough_proper.treesTestF(pine) != pine) throw new RuntimeException("treesTest Global F failed");
  237. if (enum_thorough_proper.treesTestG(pine) != pine) throw new RuntimeException("treesTest Global G failed");
  238. if (enum_thorough_proper.treesTestH(pine) != pine) throw new RuntimeException("treesTest Global H failed");
  239. if (enum_thorough_proper.treesTestI(pine) != pine) throw new RuntimeException("treesTest Global I failed");
  240. if (enum_thorough_proper.treesTestJ(pine) != pine) throw new RuntimeException("treesTest Global J failed");
  241. if (enum_thorough_proper.treesTestK(pine) != pine) throw new RuntimeException("treesTest Global K failed");
  242. if (enum_thorough_proper.treesTestL(pine) != pine) throw new RuntimeException("treesTest Global L failed");
  243. if (enum_thorough_proper.treesTestM(pine) != pine) throw new RuntimeException("treesTest Global M failed");
  244. // if (enum_thorough_proper.treesTestN(pine) != pine) throw new RuntimeException("treesTest Global N failed");
  245. if (enum_thorough_proper.treesTestO(pine) != pine) throw new RuntimeException("treesTest Global O failed");
  246. if (enum_thorough_proper.treesTestP(pine) != pine) throw new RuntimeException("treesTest Global P failed");
  247. if (enum_thorough_proper.treesTestQ(pine) != pine) throw new RuntimeException("treesTest Global Q failed");
  248. if (enum_thorough_proper.treesTestR(pine) != pine) throw new RuntimeException("treesTest Global R failed");
  249. }
  250. {
  251. HairStruct h = new HairStruct();
  252. HairStruct.hair ginger = HairStruct.hair.ginger;
  253. if (h.hairTest1(ginger) != ginger) throw new RuntimeException("hairTest 1 failed");
  254. if (h.hairTest2(ginger) != ginger) throw new RuntimeException("hairTest 2 failed");
  255. if (h.hairTest3(ginger) != ginger) throw new RuntimeException("hairTest 3 failed");
  256. if (h.hairTest4(ginger) != ginger) throw new RuntimeException("hairTest 4 failed");
  257. if (h.hairTest5(ginger) != ginger) throw new RuntimeException("hairTest 5 failed");
  258. if (h.hairTest6(ginger) != ginger) throw new RuntimeException("hairTest 6 failed");
  259. if (h.hairTest7(ginger) != ginger) throw new RuntimeException("hairTest 7 failed");
  260. if (h.hairTest8(ginger) != ginger) throw new RuntimeException("hairTest 8 failed");
  261. if (h.hairTest9(ginger) != ginger) throw new RuntimeException("hairTest 9 failed");
  262. if (h.hairTestA(ginger) != ginger) throw new RuntimeException("hairTest A failed");
  263. if (h.hairTestB(ginger) != ginger) throw new RuntimeException("hairTest B failed");
  264. colour red = colour.red;
  265. if (h.colourTest1(red) != red) throw new RuntimeException("colourTest HairStruct 1 failed");
  266. if (h.colourTest2(red) != red) throw new RuntimeException("colourTest HairStruct 2 failed");
  267. if (h.namedanonTest1(namedanon.NamedAnon2) != namedanon.NamedAnon2) throw new RuntimeException("namedanonTest HairStruct 1 failed");
  268. if (h.namedanonspaceTest1(namedanonspace.NamedAnonSpace2) != namedanonspace.NamedAnonSpace2) throw new RuntimeException("namedanonspaceTest HairStruct 1 failed");
  269. TreesClass.trees fir = TreesClass.trees.fir;
  270. if (h.treesGlobalTest1(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 1 failed");
  271. if (h.treesGlobalTest2(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 2 failed");
  272. if (h.treesGlobalTest3(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 3 failed");
  273. if (h.treesGlobalTest4(fir) != fir) throw new RuntimeException("treesGlobalTest1 HairStruct 4 failed");
  274. }
  275. {
  276. HairStruct.hair blonde = HairStruct.hair.blonde;
  277. if (enum_thorough_proper.hairTest1(blonde) != blonde) throw new RuntimeException("hairTest Global 1 failed");
  278. if (enum_thorough_proper.hairTest2(blonde) != blonde) throw new RuntimeException("hairTest Global 2 failed");
  279. if (enum_thorough_proper.hairTest3(blonde) != blonde) throw new RuntimeException("hairTest Global 3 failed");
  280. if (enum_thorough_proper.hairTest4(blonde) != blonde) throw new RuntimeException("hairTest Global 4 failed");
  281. if (enum_thorough_proper.hairTest5(blonde) != blonde) throw new RuntimeException("hairTest Global 5 failed");
  282. if (enum_thorough_proper.hairTest6(blonde) != blonde) throw new RuntimeException("hairTest Global 6 failed");
  283. if (enum_thorough_proper.hairTest7(blonde) != blonde) throw new RuntimeException("hairTest Global 7 failed");
  284. if (enum_thorough_proper.hairTest8(blonde) != blonde) throw new RuntimeException("hairTest Global 8 failed");
  285. if (enum_thorough_proper.hairTest9(blonde) != blonde) throw new RuntimeException("hairTest Global 9 failed");
  286. if (enum_thorough_proper.hairTestA(blonde) != blonde) throw new RuntimeException("hairTest Global A failed");
  287. if (enum_thorough_proper.hairTestB(blonde) != blonde) throw new RuntimeException("hairTest Global B failed");
  288. if (enum_thorough_proper.hairTestC(blonde) != blonde) throw new RuntimeException("hairTest Global C failed");
  289. if (enum_thorough_proper.hairTestA1(blonde) != blonde) throw new RuntimeException("hairTest Global A1 failed");
  290. if (enum_thorough_proper.hairTestA2(blonde) != blonde) throw new RuntimeException("hairTest Global A2 failed");
  291. if (enum_thorough_proper.hairTestA3(blonde) != blonde) throw new RuntimeException("hairTest Global A3 failed");
  292. if (enum_thorough_proper.hairTestA4(blonde) != blonde) throw new RuntimeException("hairTest Global A4 failed");
  293. if (enum_thorough_proper.hairTestA5(blonde) != blonde) throw new RuntimeException("hairTest Global A5 failed");
  294. if (enum_thorough_proper.hairTestA6(blonde) != blonde) throw new RuntimeException("hairTest Global A6 failed");
  295. if (enum_thorough_proper.hairTestA7(blonde) != blonde) throw new RuntimeException("hairTest Global A7 failed");
  296. if (enum_thorough_proper.hairTestA8(blonde) != blonde) throw new RuntimeException("hairTest Global A8 failed");
  297. if (enum_thorough_proper.hairTestA9(blonde) != blonde) throw new RuntimeException("hairTest Global A9 failed");
  298. if (enum_thorough_proper.hairTestAA(blonde) != blonde) throw new RuntimeException("hairTest Global AA failed");
  299. if (enum_thorough_proper.hairTestAB(blonde) != blonde) throw new RuntimeException("hairTest Global AB failed");
  300. if (enum_thorough_proper.hairTestAC(blonde) != blonde) throw new RuntimeException("hairTest Global AC failed");
  301. if (enum_thorough_proper.hairTestB1(blonde) != blonde) throw new RuntimeException("hairTest Global B1 failed");
  302. if (enum_thorough_proper.hairTestB2(blonde) != blonde) throw new RuntimeException("hairTest Global B2 failed");
  303. if (enum_thorough_proper.hairTestB3(blonde) != blonde) throw new RuntimeException("hairTest Global B3 failed");
  304. if (enum_thorough_proper.hairTestB4(blonde) != blonde) throw new RuntimeException("hairTest Global B4 failed");
  305. if (enum_thorough_proper.hairTestB5(blonde) != blonde) throw new RuntimeException("hairTest Global B5 failed");
  306. if (enum_thorough_proper.hairTestB6(blonde) != blonde) throw new RuntimeException("hairTest Global B6 failed");
  307. if (enum_thorough_proper.hairTestB7(blonde) != blonde) throw new RuntimeException("hairTest Global B7 failed");
  308. if (enum_thorough_proper.hairTestB8(blonde) != blonde) throw new RuntimeException("hairTest Global B8 failed");
  309. if (enum_thorough_proper.hairTestB9(blonde) != blonde) throw new RuntimeException("hairTest Global B9 failed");
  310. if (enum_thorough_proper.hairTestBA(blonde) != blonde) throw new RuntimeException("hairTest Global BA failed");
  311. if (enum_thorough_proper.hairTestBB(blonde) != blonde) throw new RuntimeException("hairTest Global BB failed");
  312. if (enum_thorough_proper.hairTestBC(blonde) != blonde) throw new RuntimeException("hairTest Global BC failed");
  313. if (enum_thorough_proper.hairTestC1(blonde) != blonde) throw new RuntimeException("hairTest Global C1 failed");
  314. if (enum_thorough_proper.hairTestC2(blonde) != blonde) throw new RuntimeException("hairTest Global C2 failed");
  315. if (enum_thorough_proper.hairTestC3(blonde) != blonde) throw new RuntimeException("hairTest Global C3 failed");
  316. if (enum_thorough_proper.hairTestC4(blonde) != blonde) throw new RuntimeException("hairTest Global C4 failed");
  317. if (enum_thorough_proper.hairTestC5(blonde) != blonde) throw new RuntimeException("hairTest Global C5 failed");
  318. if (enum_thorough_proper.hairTestC6(blonde) != blonde) throw new RuntimeException("hairTest Global C6 failed");
  319. if (enum_thorough_proper.hairTestC7(blonde) != blonde) throw new RuntimeException("hairTest Global C7 failed");
  320. if (enum_thorough_proper.hairTestC8(blonde) != blonde) throw new RuntimeException("hairTest Global C8 failed");
  321. if (enum_thorough_proper.hairTestC9(blonde) != blonde) throw new RuntimeException("hairTest Global C9 failed");
  322. if (enum_thorough_proper.hairTestCA(blonde) != blonde) throw new RuntimeException("hairTest Global CA failed");
  323. if (enum_thorough_proper.hairTestCB(blonde) != blonde) throw new RuntimeException("hairTest Global CB failed");
  324. if (enum_thorough_proper.hairTestCC(blonde) != blonde) throw new RuntimeException("hairTest Global CC failed");
  325. }
  326. {
  327. FirStruct f = new FirStruct();
  328. HairStruct.hair blonde = HairStruct.hair.blonde;
  329. if (f.hairTestFir1(blonde) != blonde) throw new RuntimeException("hairTestFir 1 failed");
  330. if (f.hairTestFir2(blonde) != blonde) throw new RuntimeException("hairTestFir 2 failed");
  331. if (f.hairTestFir3(blonde) != blonde) throw new RuntimeException("hairTestFir 3 failed");
  332. if (f.hairTestFir4(blonde) != blonde) throw new RuntimeException("hairTestFir 4 failed");
  333. if (f.hairTestFir5(blonde) != blonde) throw new RuntimeException("hairTestFir 5 failed");
  334. if (f.hairTestFir6(blonde) != blonde) throw new RuntimeException("hairTestFir 6 failed");
  335. if (f.hairTestFir7(blonde) != blonde) throw new RuntimeException("hairTestFir 7 failed");
  336. if (f.hairTestFir8(blonde) != blonde) throw new RuntimeException("hairTestFir 8 failed");
  337. if (f.hairTestFir9(blonde) != blonde) throw new RuntimeException("hairTestFir 9 failed");
  338. if (f.hairTestFirA(blonde) != blonde) throw new RuntimeException("hairTestFir A failed");
  339. }
  340. {
  341. enum_thorough_proper.setGlobalInstance(enum_thorough_proper.globalinstance2);
  342. if (enum_thorough_proper.getGlobalInstance() != enum_thorough_proper.globalinstance2) throw new RuntimeException("GlobalInstance 1 failed");
  343. Instances i = new Instances();
  344. i.setMemberInstance(Instances.memberinstance3);
  345. if (i.getMemberInstance() != Instances.memberinstance3) throw new RuntimeException("MemberInstance 1 failed");
  346. }
  347. // ignore enum item tests start
  348. {
  349. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_zero).swigValue() != 0) throw new RuntimeException("ignoreATest 0 failed");
  350. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_three).swigValue() != 3) throw new RuntimeException("ignoreATest 3 failed");
  351. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_ten).swigValue() != 10) throw new RuntimeException("ignoreATest 10 failed");
  352. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_eleven).swigValue() != 11) throw new RuntimeException("ignoreATest 11 failed");
  353. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirteen).swigValue() != 13) throw new RuntimeException("ignoreATest 13 failed");
  354. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_fourteen).swigValue() != 14) throw new RuntimeException("ignoreATest 14 failed");
  355. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_twenty).swigValue() != 20) throw new RuntimeException("ignoreATest 20 failed");
  356. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirty).swigValue() != 30) throw new RuntimeException("ignoreATest 30 failed");
  357. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirty_two).swigValue() != 32) throw new RuntimeException("ignoreATest 32 failed");
  358. if (enum_thorough_proper.ignoreATest(IgnoreTest.IgnoreA.ignoreA_thirty_three).swigValue() != 33) throw new RuntimeException("ignoreATest 33 failed");
  359. }
  360. {
  361. if (enum_thorough_proper.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_eleven).swigValue() != 11) throw new RuntimeException("ignoreBTest 11 failed");
  362. if (enum_thorough_proper.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_twelve).swigValue() != 12) throw new RuntimeException("ignoreBTest 12 failed");
  363. if (enum_thorough_proper.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_thirty_one).swigValue() != 31) throw new RuntimeException("ignoreBTest 31 failed");
  364. if (enum_thorough_proper.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_thirty_two).swigValue() != 32) throw new RuntimeException("ignoreBTest 32 failed");
  365. if (enum_thorough_proper.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_forty_one).swigValue() != 41) throw new RuntimeException("ignoreBTest 41 failed");
  366. if (enum_thorough_proper.ignoreBTest(IgnoreTest.IgnoreB.ignoreB_forty_two).swigValue() != 42) throw new RuntimeException("ignoreBTest 42 failed");
  367. }
  368. {
  369. if (enum_thorough_proper.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_ten).swigValue() != 10) throw new RuntimeException("ignoreCTest 10 failed");
  370. if (enum_thorough_proper.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_twelve).swigValue() != 12) throw new RuntimeException("ignoreCTest 12 failed");
  371. if (enum_thorough_proper.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_thirty).swigValue() != 30) throw new RuntimeException("ignoreCTest 30 failed");
  372. if (enum_thorough_proper.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_thirty_two).swigValue() != 32) throw new RuntimeException("ignoreCTest 32 failed");
  373. if (enum_thorough_proper.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_forty).swigValue() != 40) throw new RuntimeException("ignoreCTest 40 failed");
  374. if (enum_thorough_proper.ignoreCTest(IgnoreTest.IgnoreC.ignoreC_forty_two).swigValue() != 42) throw new RuntimeException("ignoreCTest 42 failed");
  375. }
  376. {
  377. if (enum_thorough_proper.ignoreDTest(IgnoreTest.IgnoreD.ignoreD_twenty_one).swigValue() != 21) throw new RuntimeException("ignoreDTest 21 failed");
  378. if (enum_thorough_proper.ignoreDTest(IgnoreTest.IgnoreD.ignoreD_twenty_two).swigValue() != 22) throw new RuntimeException("ignoreDTest 22 failed");
  379. }
  380. {
  381. if (enum_thorough_proper.ignoreETest(IgnoreTest.IgnoreE.ignoreE_zero).swigValue() != 0) throw new RuntimeException("ignoreETest 0 failed");
  382. if (enum_thorough_proper.ignoreETest(IgnoreTest.IgnoreE.ignoreE_twenty_one).swigValue() != 21) throw new RuntimeException("ignoreETest 21 failed");
  383. if (enum_thorough_proper.ignoreETest(IgnoreTest.IgnoreE.ignoreE_twenty_two).swigValue() != 22) throw new RuntimeException("ignoreETest 22 failed");
  384. }
  385. // ignore enum item tests end
  386. {
  387. if (enum_thorough_proper.repeatTest(repeat.one).swigValue() != 1) throw new RuntimeException("repeatTest 1 failed");
  388. if (enum_thorough_proper.repeatTest(repeat.initial).swigValue() != 1) throw new RuntimeException("repeatTest 2 failed");
  389. if (enum_thorough_proper.repeatTest(repeat.two).swigValue() != 2) throw new RuntimeException("repeatTest 3 failed");
  390. if (enum_thorough_proper.repeatTest(repeat.three).swigValue() != 3) throw new RuntimeException("repeatTest 4 failed");
  391. if (enum_thorough_proper.repeatTest(repeat.llast).swigValue() != 3) throw new RuntimeException("repeatTest 5 failed");
  392. if (enum_thorough_proper.repeatTest(repeat.end).swigValue() != 3) throw new RuntimeException("repeatTest 6 failed");
  393. }
  394. // different types
  395. {
  396. if (enum_thorough_proper.differentTypesTest(DifferentTypes.typeint).swigValue() != 10) throw new RuntimeException("differentTypes 1 failed");
  397. if (enum_thorough_proper.differentTypesTest(DifferentTypes.typeboolfalse).swigValue() != 0) throw new RuntimeException("differentTypes 2 failed");
  398. if (enum_thorough_proper.differentTypesTest(DifferentTypes.typebooltrue).swigValue() != 1) throw new RuntimeException("differentTypes 3 failed");
  399. if (enum_thorough_proper.differentTypesTest(DifferentTypes.typebooltwo).swigValue() != 2) throw new RuntimeException("differentTypes 4 failed");
  400. if (enum_thorough_proper.differentTypesTest(DifferentTypes.typechar).swigValue() != 'C') throw new RuntimeException("differentTypes 5 failed");
  401. if (enum_thorough_proper.differentTypesTest(DifferentTypes.typedefaultint).swigValue() != 'D') throw new RuntimeException("differentTypes 6 failed");
  402. int global_enum = enum_thorough_proper.global_typeint;
  403. if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 10) throw new RuntimeException("global differentTypes 1 failed");
  404. global_enum = enum_thorough_proper.global_typeboolfalse;
  405. if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 0) throw new RuntimeException("global differentTypes 2 failed");
  406. global_enum = enum_thorough_proper.global_typebooltrue;
  407. if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 1) throw new RuntimeException("global differentTypes 3 failed");
  408. global_enum = enum_thorough_proper.global_typebooltwo;
  409. if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 2) throw new RuntimeException("global differentTypes 4 failed");
  410. global_enum = enum_thorough_proper.global_typechar;
  411. if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 'C') throw new RuntimeException("global differentTypes 5 failed");
  412. global_enum = enum_thorough_proper.global_typedefaultint;
  413. if (enum_thorough_proper.globalDifferentTypesTest(global_enum) != 'D') throw new RuntimeException("global differentTypes 6 failed");
  414. }
  415. }
  416. }