PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/csharp/enum_thorough_typesafe_runme.cs

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