~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/test-suite/perl5/enum_thorough_runme.pl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-10 16:29:56 UTC
  • mfrom: (1.2.8 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081110162956-xue6itkuqhbza87s
Tags: 1.3.36-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop pike and libchicken-dev from the build-depends 
    (both are universe)
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.
  - drop "--without-mzscheme", we don't have it in our build-depends

Show diffs side-by-side

added added

removed removed

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