/tags/rel-2.0.4/Examples/test-suite/perl5/enum_thorough_runme.pl

# · Perl · 409 lines · 383 code · 21 blank · 5 comment · 0 complexity · 554015de11a7330f565c14fcdcd833b8 MD5 · raw file

  1. # an adaptation of ../java/enum_thorough_runme.java
  2. use strict;
  3. use warnings;
  4. use Test::More tests => 298;
  5. BEGIN { use_ok('enum_thorough') }
  6. require_ok('enum_thorough');
  7. is($enum_thorough::ReallyAnInteger, 200, "Test Anon 1");
  8. {
  9. my $red = $enum_thorough::red;
  10. is(enum_thorough::colourTest1($red), $red, "colourTest1");
  11. is(enum_thorough::colourTest2($red), $red, "colourTest2");
  12. is(enum_thorough::colourTest3($red), $red, "colourTest3");
  13. is(enum_thorough::colourTest4($red), $red, "colourTest4");
  14. isnt($enum_thorough::myColour, $red, "colour global get");
  15. $enum_thorough::myColour = $red;
  16. is($enum_thorough::myColour, $red, "colour global set");
  17. }
  18. {
  19. my $s = enum_thorough::SpeedClass->new();
  20. my $speed = $enum_thorough::SpeedClass::slow;
  21. ok(defined($speed), "SpeedClass.slow");
  22. is($s->speedTest1($speed), $speed, "speedTest 1");
  23. is($s->speedTest2($speed), $speed, "speedTest 2");
  24. is($s->speedTest3($speed), $speed, "speedTest 3");
  25. is($s->speedTest4($speed), $speed, "speedTest 4");
  26. is($s->speedTest5($speed), $speed, "speedTest 5");
  27. is($s->speedTest6($speed), $speed, "speedTest 6");
  28. is($s->speedTest7($speed), $speed, "speedTest 7");
  29. is($s->speedTest8($speed), $speed, "speedTest 8");
  30. is(enum_thorough::speedTest1($speed), $speed, "speedTest Global 1");
  31. is(enum_thorough::speedTest2($speed), $speed, "speedTest Global 2");
  32. is(enum_thorough::speedTest3($speed), $speed, "speedTest Global 3");
  33. is(enum_thorough::speedTest4($speed), $speed, "speedTest Global 4");
  34. is(enum_thorough::speedTest5($speed), $speed, "speedTest Global 5");
  35. }
  36. {
  37. my $s = enum_thorough::SpeedClass->new();
  38. my $slow = $enum_thorough::SpeedClass::slow;
  39. my $lightning = $enum_thorough::SpeedClass::lightning;
  40. is($s->{mySpeedtd1}, $slow, "mySpeedtd1 1");
  41. is($s->{mySpeedtd1}, 10, "mySpeedtd1 2");
  42. $s->{mySpeedtd1} = $lightning;
  43. is($s->{mySpeedtd1}, $lightning, "mySpeedtd1 3");
  44. is($s->{mySpeedtd1}, 31, "mySpeedtd1 4");
  45. }
  46. is(enum_thorough::namedanonTest1($enum_thorough::NamedAnon2),
  47. $enum_thorough::NamedAnon2, "namedanonTest1");
  48. {
  49. my $val = $enum_thorough::TwoNames2;
  50. is(enum_thorough::twonamesTest1($val), $val, "twonamesTest 1");
  51. is(enum_thorough::twonamesTest2($val), $val, "twonamesTest 2");
  52. is(enum_thorough::twonamesTest3($val), $val, "twonamesTest 3");
  53. }
  54. { local $TODO = "shouldn't namespaces drop into a package?";
  55. my $val = $enum_thorough::AnonSpace::NamedAnonSpace2;
  56. ok(defined($val), "found enum value");
  57. SKIP: {
  58. skip "enum value not in expected package", 3 unless defined $val;
  59. is(enum_thorough::namedanonspaceTest1($val), $val, "namedanonspaceTest 1");
  60. is(enum_thorough::namedanonspaceTest2($val), $val, "namedanonspaceTest 2");
  61. is(enum_thorough::namedanonspaceTest3($val), $val, "namedanonspaceTest 3");
  62. }}
  63. {
  64. my $t = enum_thorough::TemplateClassInt->new();
  65. my $galileo = $enum_thorough::TemplateClassInt::galileo;
  66. is($t->scientistsTest1($galileo), $galileo, "scientistsTest 1");
  67. is($t->scientistsTest2($galileo), $galileo, "scientistsTest 2");
  68. is($t->scientistsTest3($galileo), $galileo, "scientistsTest 3");
  69. is($t->scientistsTest4($galileo), $galileo, "scientistsTest 4");
  70. is($t->scientistsTest5($galileo), $galileo, "scientistsTest 5");
  71. is($t->scientistsTest6($galileo), $galileo, "scientistsTest 6");
  72. is($t->scientistsTest7($galileo), $galileo, "scientistsTest 7");
  73. is($t->scientistsTest8($galileo), $galileo, "scientistsTest 8");
  74. is($t->scientistsTest9($galileo), $galileo, "scientistsTest 9");
  75. is($t->scientistsTestB($galileo), $galileo, "scientistsTest B");
  76. is($t->scientistsTestD($galileo), $galileo, "scientistsTest D");
  77. is($t->scientistsTestE($galileo), $galileo, "scientistsTest E");
  78. is($t->scientistsTestF($galileo), $galileo, "scientistsTest F");
  79. is($t->scientistsTestG($galileo), $galileo, "scientistsTest G");
  80. is($t->scientistsTestH($galileo), $galileo, "scientistsTest H");
  81. is($t->scientistsTestI($galileo), $galileo, "scientistsTest I");
  82. is($t->scientistsTestJ($galileo), $galileo, "scientistsTest J");
  83. is(enum_thorough::scientistsTest1($galileo), $galileo, "scientistsTest Global 1");
  84. is(enum_thorough::scientistsTest2($galileo), $galileo, "scientistsTest Global 2");
  85. is(enum_thorough::scientistsTest3($galileo), $galileo, "scientistsTest Global 3");
  86. is(enum_thorough::scientistsTest4($galileo), $galileo, "scientistsTest Global 4");
  87. is(enum_thorough::scientistsTest5($galileo), $galileo, "scientistsTest Global 5");
  88. is(enum_thorough::scientistsTest6($galileo), $galileo, "scientistsTest Global 6");
  89. is(enum_thorough::scientistsTest7($galileo), $galileo, "scientistsTest Global 7");
  90. is(enum_thorough::scientistsTest8($galileo), $galileo, "scientistsTest Global 8");
  91. }
  92. {
  93. my $t = enum_thorough::TClassInt->new();
  94. my $bell = $enum_thorough::TClassInt::bell;
  95. my $galileo = $enum_thorough::TemplateClassInt::galileo;
  96. is($t->scientistsNameTest1($bell), $bell, "scientistsNameTest 1");
  97. is($t->scientistsNameTest2($bell), $bell, "scientistsNameTest 2");
  98. is($t->scientistsNameTest3($bell), $bell, "scientistsNameTest 3");
  99. is($t->scientistsNameTest4($bell), $bell, "scientistsNameTest 4");
  100. is($t->scientistsNameTest5($bell), $bell, "scientistsNameTest 5");
  101. is($t->scientistsNameTest6($bell), $bell, "scientistsNameTest 6");
  102. is($t->scientistsNameTest7($bell), $bell, "scientistsNameTest 7");
  103. is($t->scientistsNameTest8($bell), $bell, "scientistsNameTest 8");
  104. is($t->scientistsNameTest9($bell), $bell, "scientistsNameTest 9");
  105. is($t->scientistsNameTestB($bell), $bell, "scientistsNameTest B");
  106. is($t->scientistsNameTestD($bell), $bell, "scientistsNameTest D");
  107. is($t->scientistsNameTestE($bell), $bell, "scientistsNameTest E");
  108. is($t->scientistsNameTestF($bell), $bell, "scientistsNameTest F");
  109. is($t->scientistsNameTestG($bell), $bell, "scientistsNameTest G");
  110. is($t->scientistsNameTestH($bell), $bell, "scientistsNameTest H");
  111. is($t->scientistsNameTestI($bell), $bell, "scientistsNameTest I");
  112. is($t->scientistsNameSpaceTest1($bell), $bell, "scientistsNameSpaceTest 1");
  113. is($t->scientistsNameSpaceTest2($bell), $bell, "scientistsNameSpaceTest 2");
  114. is($t->scientistsNameSpaceTest3($bell), $bell, "scientistsNameSpaceTest 3");
  115. is($t->scientistsNameSpaceTest4($bell), $bell, "scientistsNameSpaceTest 4");
  116. is($t->scientistsNameSpaceTest5($bell), $bell, "scientistsNameSpaceTest 5");
  117. is($t->scientistsNameSpaceTest6($bell), $bell, "scientistsNameSpaceTest 6");
  118. is($t->scientistsNameSpaceTest7($bell), $bell, "scientistsNameSpaceTest 7");
  119. is($t->scientistsOtherTest1($galileo), $galileo, "scientistsOtherTest 1");
  120. is($t->scientistsOtherTest2($galileo), $galileo, "scientistsOtherTest 2");
  121. is($t->scientistsOtherTest3($galileo), $galileo, "scientistsOtherTest 3");
  122. is($t->scientistsOtherTest4($galileo), $galileo, "scientistsOtherTest 4");
  123. is($t->scientistsOtherTest5($galileo), $galileo, "scientistsOtherTest 5");
  124. is($t->scientistsOtherTest6($galileo), $galileo, "scientistsOtherTest 6");
  125. is($t->scientistsOtherTest7($galileo), $galileo, "scientistsOtherTest 7");
  126. is(enum_thorough::scientistsNameTest1($bell), $bell, "scientistsNameTest Global 1");
  127. is(enum_thorough::scientistsNameTest2($bell), $bell, "scientistsNameTest Global 2");
  128. is(enum_thorough::scientistsNameTest3($bell), $bell, "scientistsNameTest Global 3");
  129. is(enum_thorough::scientistsNameTest4($bell), $bell, "scientistsNameTest Global 4");
  130. is(enum_thorough::scientistsNameTest5($bell), $bell, "scientistsNameTest Global 5");
  131. is(enum_thorough::scientistsNameTest6($bell), $bell, "scientistsNameTest Global 6");
  132. is(enum_thorough::scientistsNameTest7($bell), $bell, "scientistsNameTest Global 7");
  133. is(enum_thorough::scientistsNameSpaceTest1($bell), $bell, "scientistsNameSpaceTest Global 1");
  134. is(enum_thorough::scientistsNameSpaceTest2($bell), $bell, "scientistsNameSpaceTest Global 2");
  135. is(enum_thorough::scientistsNameSpaceTest3($bell), $bell, "scientistsNameSpaceTest Global 3");
  136. is(enum_thorough::scientistsNameSpaceTest4($bell), $bell, "scientistsNameSpaceTest Global 4");
  137. is(enum_thorough::scientistsNameSpaceTest5($bell), $bell, "scientistsNameSpaceTest Global 5");
  138. is(enum_thorough::scientistsNameSpaceTest6($bell), $bell, "scientistsNameSpaceTest Global 6");
  139. is(enum_thorough::scientistsNameSpaceTest7($bell), $bell, "scientistsNameSpaceTest Global 7");
  140. is(enum_thorough::scientistsNameSpaceTest8($bell), $bell, "scientistsNameSpaceTest Global 8");
  141. is(enum_thorough::scientistsNameSpaceTest9($bell), $bell, "scientistsNameSpaceTest Global 9");
  142. is(enum_thorough::scientistsNameSpaceTestA($bell), $bell, "scientistsNameSpaceTest Global A");
  143. is(enum_thorough::scientistsNameSpaceTestB($bell), $bell, "scientistsNameSpaceTest Global B");
  144. is(enum_thorough::scientistsNameSpaceTestC($bell), $bell, "scientistsNameSpaceTest Global C");
  145. is(enum_thorough::scientistsNameSpaceTestD($bell), $bell, "scientistsNameSpaceTest Global D");
  146. is(enum_thorough::scientistsNameSpaceTestE($bell), $bell, "scientistsNameSpaceTest Global E");
  147. is(enum_thorough::scientistsNameSpaceTestF($bell), $bell, "scientistsNameSpaceTest Global F");
  148. is(enum_thorough::scientistsNameSpaceTestG($bell), $bell, "scientistsNameSpaceTest Global G");
  149. is(enum_thorough::scientistsNameSpaceTestH($bell), $bell, "scientistsNameSpaceTest Global H");
  150. is(enum_thorough::scientistsNameSpaceTestI($bell), $bell, "scientistsNameSpaceTest Global I");
  151. is(enum_thorough::scientistsNameSpaceTestJ($bell), $bell, "scientistsNameSpaceTest Global J");
  152. is(enum_thorough::scientistsNameSpaceTestK($bell), $bell, "scientistsNameSpaceTest Global K");
  153. is(enum_thorough::scientistsNameSpaceTestL($bell), $bell, "scientistsNameSpaceTest Global L");
  154. }
  155. {
  156. my $val = $enum_thorough::argh;
  157. is(enum_thorough::renameTest1($val), $val, "renameTest Global 1");
  158. is(enum_thorough::renameTest2($val), $val, "renameTest Global 2");
  159. }
  160. {
  161. my $n = enum_thorough::NewNameStruct->new();
  162. is($n->renameTest1($enum_thorough::NewNameStruct::bang), $enum_thorough::NewNameStruct::bang, "renameTest 1");
  163. is($n->renameTest2($enum_thorough::NewNameStruct::bang), $enum_thorough::NewNameStruct::bang, "renameTest 2");
  164. is($n->renameTest3($enum_thorough::NewNameStruct::simple1), $enum_thorough::NewNameStruct::simple1, "renameTest 3");
  165. is($n->renameTest4($enum_thorough::NewNameStruct::doublename1), $enum_thorough::NewNameStruct::doublename1, "renameTest 4");
  166. is($n->renameTest5($enum_thorough::NewNameStruct::doublename1), $enum_thorough::NewNameStruct::doublename1, "renameTest 5");
  167. is($n->renameTest6($enum_thorough::NewNameStruct::singlename1), $enum_thorough::NewNameStruct::singlename1, "renameTest 6");
  168. }
  169. {
  170. is(enum_thorough::renameTest3($enum_thorough::NewNameStruct::bang), $enum_thorough::NewNameStruct::bang, "renameTest Global 3");
  171. is(enum_thorough::renameTest4($enum_thorough::NewNameStruct::simple1), $enum_thorough::NewNameStruct::simple1, "renameTest Global 4");
  172. is(enum_thorough::renameTest5($enum_thorough::NewNameStruct::doublename1), $enum_thorough::NewNameStruct::doublename1, "renameTest Global 5");
  173. is(enum_thorough::renameTest6($enum_thorough::NewNameStruct::doublename1), $enum_thorough::NewNameStruct::doublename1, "renameTest Global 6");
  174. is(enum_thorough::renameTest7($enum_thorough::NewNameStruct::singlename1), $enum_thorough::NewNameStruct::singlename1, "renameTest Global 7");
  175. }
  176. {
  177. my $t = enum_thorough::TreesClass->new();
  178. my $pine = $enum_thorough::TreesClass::pine;
  179. is($t->treesTest1($pine), $pine, "treesTest 1");
  180. is($t->treesTest2($pine), $pine, "treesTest 2");
  181. is($t->treesTest3($pine), $pine, "treesTest 3");
  182. is($t->treesTest4($pine), $pine, "treesTest 4");
  183. is($t->treesTest5($pine), $pine, "treesTest 5");
  184. is($t->treesTest6($pine), $pine, "treesTest 6");
  185. is($t->treesTest7($pine), $pine, "treesTest 7");
  186. is($t->treesTest8($pine), $pine, "treesTest 8");
  187. is($t->treesTest9($pine), $pine, "treesTest 9");
  188. is($t->treesTestA($pine), $pine, "treesTest A");
  189. is($t->treesTestB($pine), $pine, "treesTest B");
  190. is($t->treesTestC($pine), $pine, "treesTest C");
  191. is($t->treesTestD($pine), $pine, "treesTest D");
  192. is($t->treesTestE($pine), $pine, "treesTest E");
  193. is($t->treesTestF($pine), $pine, "treesTest F");
  194. is($t->treesTestG($pine), $pine, "treesTest G");
  195. is($t->treesTestH($pine), $pine, "treesTest H");
  196. is($t->treesTestI($pine), $pine, "treesTest I");
  197. is($t->treesTestJ($pine), $pine, "treesTest J");
  198. is($t->treesTestK($pine), $pine, "treesTest K");
  199. is($t->treesTestL($pine), $pine, "treesTest L");
  200. is($t->treesTestM($pine), $pine, "treesTest M");
  201. is($t->treesTestN($pine), $pine, "treesTest N");
  202. is($t->treesTestO($pine), $pine, "treesTest O");
  203. is(enum_thorough::treesTest1($pine), $pine, "treesTest Global 1");
  204. is(enum_thorough::treesTest2($pine), $pine, "treesTest Global 2");
  205. is(enum_thorough::treesTest3($pine), $pine, "treesTest Global 3");
  206. is(enum_thorough::treesTest4($pine), $pine, "treesTest Global 4");
  207. is(enum_thorough::treesTest5($pine), $pine, "treesTest Global 5");
  208. is(enum_thorough::treesTest6($pine), $pine, "treesTest Global 6");
  209. is(enum_thorough::treesTest7($pine), $pine, "treesTest Global 7");
  210. is(enum_thorough::treesTest8($pine), $pine, "treesTest Global 8");
  211. is(enum_thorough::treesTest9($pine), $pine, "treesTest Global 9");
  212. is(enum_thorough::treesTestA($pine), $pine, "treesTest Global A");
  213. is(enum_thorough::treesTestB($pine), $pine, "treesTest Global B");
  214. is(enum_thorough::treesTestC($pine), $pine, "treesTest Global C");
  215. is(enum_thorough::treesTestD($pine), $pine, "treesTest Global D");
  216. is(enum_thorough::treesTestE($pine), $pine, "treesTest Global E");
  217. is(enum_thorough::treesTestF($pine), $pine, "treesTest Global F");
  218. is(enum_thorough::treesTestG($pine), $pine, "treesTest Global G");
  219. is(enum_thorough::treesTestH($pine), $pine, "treesTest Global H");
  220. is(enum_thorough::treesTestI($pine), $pine, "treesTest Global I");
  221. is(enum_thorough::treesTestJ($pine), $pine, "treesTest Global J");
  222. is(enum_thorough::treesTestK($pine), $pine, "treesTest Global K");
  223. is(enum_thorough::treesTestL($pine), $pine, "treesTest Global L");
  224. is(enum_thorough::treesTestM($pine), $pine, "treesTest Global M");
  225. is(enum_thorough::treesTestO($pine), $pine, "treesTest Global O");
  226. is(enum_thorough::treesTestP($pine), $pine, "treesTest Global P");
  227. is(enum_thorough::treesTestQ($pine), $pine, "treesTest Global Q");
  228. is(enum_thorough::treesTestR($pine), $pine, "treesTest Global R");
  229. }
  230. {
  231. my $h = enum_thorough::HairStruct->new();
  232. my $ginger = $enum_thorough::HairStruct::ginger;
  233. is($h->hairTest1($ginger), $ginger, "hairTest 1");
  234. is($h->hairTest2($ginger), $ginger, "hairTest 2");
  235. is($h->hairTest3($ginger), $ginger, "hairTest 3");
  236. is($h->hairTest4($ginger), $ginger, "hairTest 4");
  237. is($h->hairTest5($ginger), $ginger, "hairTest 5");
  238. is($h->hairTest6($ginger), $ginger, "hairTest 6");
  239. is($h->hairTest7($ginger), $ginger, "hairTest 7");
  240. is($h->hairTest8($ginger), $ginger, "hairTest 8");
  241. is($h->hairTest9($ginger), $ginger, "hairTest 9");
  242. is($h->hairTestA($ginger), $ginger, "hairTest A");
  243. is($h->hairTestB($ginger), $ginger, "hairTest B");
  244. my $red = $enum_thorough::red;
  245. is($h->colourTest1($red), $red, "colourTest HairStruct 1");
  246. is($h->colourTest2($red), $red, "colourTest HairStruct 2");
  247. is($h->namedanonTest1($enum_thorough::NamedAnon2), $enum_thorough::NamedAnon2, "namedanonTest HairStruct 1");
  248. { local $TODO = "shouldn't namespaces drop into a package?";
  249. ok(defined($enum_thorough::AnonSpace::NamedAnonSpace2), "found enum value");
  250. SKIP: {
  251. skip "enum value not in expected package", 1 unless defined $enum_thorough::AnonSpace::NamedAnonSpace2;
  252. is($h->namedanonspaceTest1($enum_thorough::AnonSpace::NamedAnonSpace2), $enum_thorough::AnonSpace::NamedAnonSpace2, "namedanonspaceTest HairStruct 1");
  253. }}
  254. my $fir = $enum_thorough::TreesClass::fir;
  255. is($h->treesGlobalTest1($fir), $fir, "treesGlobalTest1 HairStruct 1");
  256. is($h->treesGlobalTest2($fir), $fir, "treesGlobalTest1 HairStruct 2");
  257. is($h->treesGlobalTest3($fir), $fir, "treesGlobalTest1 HairStruct 3");
  258. is($h->treesGlobalTest4($fir), $fir, "treesGlobalTest1 HairStruct 4");
  259. }
  260. {
  261. my $blonde = $enum_thorough::HairStruct::blonde;
  262. is(enum_thorough::hairTest1($blonde), $blonde, "hairTest Global 1");
  263. is(enum_thorough::hairTest2($blonde), $blonde, "hairTest Global 2");
  264. is(enum_thorough::hairTest3($blonde), $blonde, "hairTest Global 3");
  265. is(enum_thorough::hairTest4($blonde), $blonde, "hairTest Global 4");
  266. is(enum_thorough::hairTest5($blonde), $blonde, "hairTest Global 5");
  267. is(enum_thorough::hairTest6($blonde), $blonde, "hairTest Global 6");
  268. is(enum_thorough::hairTest7($blonde), $blonde, "hairTest Global 7");
  269. is(enum_thorough::hairTest8($blonde), $blonde, "hairTest Global 8");
  270. is(enum_thorough::hairTest9($blonde), $blonde, "hairTest Global 9");
  271. is(enum_thorough::hairTestA($blonde), $blonde, "hairTest Global A");
  272. is(enum_thorough::hairTestB($blonde), $blonde, "hairTest Global B");
  273. is(enum_thorough::hairTestC($blonde), $blonde, "hairTest Global C");
  274. is(enum_thorough::hairTestA1($blonde), $blonde, "hairTest Global A1");
  275. is(enum_thorough::hairTestA2($blonde), $blonde, "hairTest Global A2");
  276. is(enum_thorough::hairTestA3($blonde), $blonde, "hairTest Global A3");
  277. is(enum_thorough::hairTestA4($blonde), $blonde, "hairTest Global A4");
  278. is(enum_thorough::hairTestA5($blonde), $blonde, "hairTest Global A5");
  279. is(enum_thorough::hairTestA6($blonde), $blonde, "hairTest Global A6");
  280. is(enum_thorough::hairTestA7($blonde), $blonde, "hairTest Global A7");
  281. is(enum_thorough::hairTestA8($blonde), $blonde, "hairTest Global A8");
  282. is(enum_thorough::hairTestA9($blonde), $blonde, "hairTest Global A9");
  283. is(enum_thorough::hairTestAA($blonde), $blonde, "hairTest Global AA");
  284. is(enum_thorough::hairTestAB($blonde), $blonde, "hairTest Global AB");
  285. is(enum_thorough::hairTestAC($blonde), $blonde, "hairTest Global AC");
  286. is(enum_thorough::hairTestB1($blonde), $blonde, "hairTest Global B1");
  287. is(enum_thorough::hairTestB2($blonde), $blonde, "hairTest Global B2");
  288. is(enum_thorough::hairTestB3($blonde), $blonde, "hairTest Global B3");
  289. is(enum_thorough::hairTestB4($blonde), $blonde, "hairTest Global B4");
  290. is(enum_thorough::hairTestB5($blonde), $blonde, "hairTest Global B5");
  291. is(enum_thorough::hairTestB6($blonde), $blonde, "hairTest Global B6");
  292. is(enum_thorough::hairTestB7($blonde), $blonde, "hairTest Global B7");
  293. is(enum_thorough::hairTestB8($blonde), $blonde, "hairTest Global B8");
  294. is(enum_thorough::hairTestB9($blonde), $blonde, "hairTest Global B9");
  295. is(enum_thorough::hairTestBA($blonde), $blonde, "hairTest Global BA");
  296. is(enum_thorough::hairTestBB($blonde), $blonde, "hairTest Global BB");
  297. is(enum_thorough::hairTestBC($blonde), $blonde, "hairTest Global BC");
  298. is(enum_thorough::hairTestC1($blonde), $blonde, "hairTest Global C1");
  299. is(enum_thorough::hairTestC2($blonde), $blonde, "hairTest Global C2");
  300. is(enum_thorough::hairTestC3($blonde), $blonde, "hairTest Global C3");
  301. is(enum_thorough::hairTestC4($blonde), $blonde, "hairTest Global C4");
  302. is(enum_thorough::hairTestC5($blonde), $blonde, "hairTest Global C5");
  303. is(enum_thorough::hairTestC6($blonde), $blonde, "hairTest Global C6");
  304. is(enum_thorough::hairTestC7($blonde), $blonde, "hairTest Global C7");
  305. is(enum_thorough::hairTestC8($blonde), $blonde, "hairTest Global C8");
  306. is(enum_thorough::hairTestC9($blonde), $blonde, "hairTest Global C9");
  307. is(enum_thorough::hairTestCA($blonde), $blonde, "hairTest Global CA");
  308. is(enum_thorough::hairTestCB($blonde), $blonde, "hairTest Global CB");
  309. is(enum_thorough::hairTestCC($blonde), $blonde, "hairTest Global CC");
  310. }
  311. {
  312. my $f = enum_thorough::FirStruct->new();
  313. my $blonde = $enum_thorough::HairStruct::blonde;
  314. is($f->hairTestFir1($blonde), $blonde, "hairTestFir 1");
  315. is($f->hairTestFir2($blonde), $blonde, "hairTestFir 2");
  316. is($f->hairTestFir3($blonde), $blonde, "hairTestFir 3");
  317. is($f->hairTestFir4($blonde), $blonde, "hairTestFir 4");
  318. is($f->hairTestFir5($blonde), $blonde, "hairTestFir 5");
  319. is($f->hairTestFir6($blonde), $blonde, "hairTestFir 6");
  320. is($f->hairTestFir7($blonde), $blonde, "hairTestFir 7");
  321. is($f->hairTestFir8($blonde), $blonde, "hairTestFir 8");
  322. is($f->hairTestFir9($blonde), $blonde, "hairTestFir 9");
  323. is($f->hairTestFirA($blonde), $blonde, "hairTestFir A");
  324. }
  325. {
  326. $enum_thorough::GlobalInstance = $enum_thorough::globalinstance2;
  327. is($enum_thorough::GlobalInstance, $enum_thorough::globalinstance2, "GlobalInstance 1");
  328. my $i = enum_thorough::Instances->new();
  329. $i->{MemberInstance} = $enum_thorough::Instances::memberinstance3;
  330. is($i->{MemberInstance}, $enum_thorough::Instances::memberinstance3, "MemberInstance 1");
  331. }
  332. # ignore enum item tests start
  333. {
  334. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_zero), 0, "ignoreATest 0");
  335. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_three), 3, "ignoreATest 3");
  336. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_ten), 10, "ignoreATest 10");
  337. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_eleven), 11, "ignoreATest 11");
  338. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_thirteen), 13, "ignoreATest 13");
  339. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_fourteen), 14, "ignoreATest 14");
  340. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_twenty), 20, "ignoreATest 20");
  341. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_thirty), 30, "ignoreATest 30");
  342. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_thirty_two), 32, "ignoreATest 32");
  343. is(enum_thorough::ignoreATest($enum_thorough::IgnoreTest::ignoreA_thirty_three), 33, "ignoreATest 33");
  344. }
  345. {
  346. is(enum_thorough::ignoreBTest($enum_thorough::IgnoreTest::ignoreB_eleven), 11, "ignoreBTest 11");
  347. is(enum_thorough::ignoreBTest($enum_thorough::IgnoreTest::ignoreB_twelve), 12, "ignoreBTest 12");
  348. is(enum_thorough::ignoreBTest($enum_thorough::IgnoreTest::ignoreB_thirty_one), 31, "ignoreBTest 31");
  349. is(enum_thorough::ignoreBTest($enum_thorough::IgnoreTest::ignoreB_thirty_two), 32, "ignoreBTest 32");
  350. is(enum_thorough::ignoreBTest($enum_thorough::IgnoreTest::ignoreB_forty_one), 41, "ignoreBTest 41");
  351. is(enum_thorough::ignoreBTest($enum_thorough::IgnoreTest::ignoreB_forty_two), 42, "ignoreBTest 42");
  352. }
  353. {
  354. is(enum_thorough::ignoreCTest($enum_thorough::IgnoreTest::ignoreC_ten), 10, "ignoreCTest 10");
  355. is(enum_thorough::ignoreCTest($enum_thorough::IgnoreTest::ignoreC_twelve), 12, "ignoreCTest 12");
  356. is(enum_thorough::ignoreCTest($enum_thorough::IgnoreTest::ignoreC_thirty), 30, "ignoreCTest 30");
  357. is(enum_thorough::ignoreCTest($enum_thorough::IgnoreTest::ignoreC_thirty_two), 32, "ignoreCTest 32");
  358. is(enum_thorough::ignoreCTest($enum_thorough::IgnoreTest::ignoreC_forty), 40, "ignoreCTest 40");
  359. is(enum_thorough::ignoreCTest($enum_thorough::IgnoreTest::ignoreC_forty_two), 42, "ignoreCTest 42");
  360. }
  361. {
  362. is(enum_thorough::ignoreDTest($enum_thorough::IgnoreTest::ignoreD_twenty_one), 21, "ignoreDTest 21");
  363. is(enum_thorough::ignoreDTest($enum_thorough::IgnoreTest::ignoreD_twenty_two), 22, "ignoreDTest 22");
  364. }
  365. {
  366. is(enum_thorough::ignoreETest($enum_thorough::IgnoreTest::ignoreE_zero), 0, "ignoreETest 0");
  367. is(enum_thorough::ignoreETest($enum_thorough::IgnoreTest::ignoreE_twenty_one), 21, "ignoreETest 21");
  368. is(enum_thorough::ignoreETest($enum_thorough::IgnoreTest::ignoreE_twenty_two), 22, "ignoreETest 22");
  369. }
  370. # ignore enum item tests end
  371. {
  372. is(enum_thorough::repeatTest($enum_thorough::one), 1, "repeatTest 1");
  373. is(enum_thorough::repeatTest($enum_thorough::initial), 1, "repeatTest 2");
  374. is(enum_thorough::repeatTest($enum_thorough::two), 2, "repeatTest 3");
  375. is(enum_thorough::repeatTest($enum_thorough::three), 3, "repeatTest 4");
  376. is(enum_thorough::repeatTest($enum_thorough::llast), 3, "repeatTest 5");
  377. is(enum_thorough::repeatTest($enum_thorough::end), 3, "repeatTest 6");
  378. }
  379. # these were the preexisting Perl testcases before the port.
  380. # Just test an in and out typemap for enum SWIGTYPE and const enum SWIGTYPE & typemaps
  381. is(enum_thorough::speedTest4($enum_thorough::SpeedClass::slow),
  382. $enum_thorough::SpeedClass::slow, "speedTest Global 4");
  383. is(enum_thorough::speedTest5($enum_thorough::SpeedClass::slow),
  384. $enum_thorough::SpeedClass::slow, "speedTest Global 5");
  385. is(enum_thorough::speedTest4($enum_thorough::SpeedClass::fast),
  386. $enum_thorough::SpeedClass::fast, "speedTest Global 4");
  387. is(enum_thorough::speedTest5($enum_thorough::SpeedClass::fast),
  388. $enum_thorough::SpeedClass::fast, "speedTest Global 5");