-
Notifications
You must be signed in to change notification settings - Fork 83
/
Tests.idl
173 lines (150 loc) · 4.87 KB
/
Tests.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Tests.idl contains examples of various IDL types
module org
{
module jacorb
{
module test
{
// Test Forward Declarations
interface TestForwardDecl;
interface TestForwardDecl
{
};
interface TestForwardDecl;
// bound for Sequences and Arrays
const long Bound = 10;
// example empty Exception
exception EmptyException {};
// example non-empty Exception
exception NonEmptyException
{
long field1;
string field2;
};
// example Exception with any type
exception AnyException
{
any anything;
};
// example unbounded Sequence
typedef sequence< long > UnboundedData;
// example bounded Sequence
typedef sequence< long, Bound > BoundedData;
// example of an Array
typedef long ArrayType[Bound];
// example Enum type
enum EnumType {first, second, third, fourth, fifth};
// example Struct type
struct StructType
{
long field1;
string field2;
};
// example Union type with a default case (enumeration discriminator)
union UnionDefaultType switch (EnumType)
{
case first: long win;
case second: short place;
case third:
case fourth: octet show;
default: boolean other;
};
// example Union type without a default case (enumeration discriminator)
union UnionNoDefaultType switch (EnumType)
{
case first: long win;
case second: short place;
case third:
case fourth: octet show;
};
// example Union type that uses full range of discriminator values
// (enumeration discriminator)
union UnionFullRangeType switch (EnumType)
{
case first: long win;
case second: short place;
case third:
case fourth:
case fifth: octet show;
};
// example Union type with a default case (boolean discriminator)
union UnionDefaultBooleanType switch (boolean)
{
case FALSE: long win;
default: boolean other;
};
// example Union type without a default case (boolean discriminator)
union UnionNoDefaultBooleanType switch (boolean)
{
case FALSE: long win;
};
// example Union type with a default case (char discriminator)
union UnionDefaultCharType switch (char)
{
case 'a': long win;
case 'b': octet doit;
case 'c': double place;
default: boolean other;
};
// example Union type without a default case (char discriminator)
union UnionNoDefaultCharType switch (char)
{
case 'a': long win;
case 'b': octet doit;
case 'c': boolean other;
};
// example Union type with a default case (integer discriminator)
union UnionDefaultShortType switch (short)
{
case 0: long win;
case 1: short place;
case 2:
case 3: octet show;
default: boolean other;
};
// example Union type without a default case (integer discriminator)
union UnionNoDefaultShortType switch (short)
{
case 0: long win;
case 1: short place;
case 2:
case 3: octet show;
};
// example Union type with a default case (integer discriminator)
union UnionDefaultLongType switch (long)
{
case 0: long win;
case 1: short place;
case 2:
case 3: octet show;
default: boolean other;
};
// example Union type without a default case (integer discriminator)
union UnionNoDefaultLongType switch (long)
{
case 0: long win;
case 1: short place;
case 2:
case 3: octet show;
};
// example Union type with a default case (integer discriminator)
union UnionDefaultLongLongType switch (long long)
{
case 0: long win;
case 1: short place;
// multiple case labels per alternative do not work
// with long long discriminators due to an IDL compiler bug
// AS, 2006-09-17
case 2: octet show;
default: boolean other;
};
// example Union type without a default case (integer discriminator)
union UnionNoDefaultLongLongType switch (long long)
{
case 0: long win;
case 1: short place;
case 2: octet show;
};
};
};
};