2 //=============================================================================
6 * This file contains examples of IDL code that has
7 * caused problems in the past for the TAO IDL
8 * compiler. This test is to make sure the problems
12 * @author Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
14 //=============================================================================
17 // Multidimensional arrays - constant vigilance.
18 typedef short TwoDArray
[64][63];
20 typedef short ThreeDArray
[64][63][62];
22 typedef short FourDArray
[64][63][62][61];
24 // This problem is a combination of two others
25 // that have long been fixed, but you never know...
27 typedef long inside_array
[5];
34 typedef wrap outside_array
[10];
35 typedef octet oa1
[22];
36 typedef octet oa2
[22];
38 // Test generation of Arg_Traits specialization for identical
42 void all_arrays
(in oa1 arg1
,
46 // This should generate unique _var and _forany types, but
47 // also generate TAO_String_Manager as the element type for both.
50 typedef string ArrayOfString
[15];
51 typedef string MyString
;
52 typedef MyString ArrayOfMyString
[15];
55 // Checks code generation for arrays and typedefs of arrays
56 // when they are not declared globally or inside a module.
59 typedef char Arraychar
[2];
60 typedef Arraychar ArrayDeChar
;
68 typedef sequence
<Arraychar
> ArraycharList
;
69 typedef sequence
<Arraychar
,10> BdArraycharList
;
71 typedef sequence
<ArrayDeChar
> ArrayDeCharList
;
72 typedef sequence
<ArrayDeChar
,10> BdArrayDeCharList
;
75 // Tests for explicit conversion of slice pointer to the
76 // corresponding forany class before using CDR or Any
77 // operators. This is required because myvec2_slice and
78 // myvec3_slice are the same type, so implicit conversion
79 // from myvec2_slice (in the case below) could go to
80 // myvec2_forany or myvec3_forany.
83 typedef string myvec2
[2];
84 typedef string myvec3
[3];
88 void test_method
(out myvec2 mystring
);
92 // Caught the has_constructor() flag not being passed from the
93 // element type to the array in the AST.
96 union FirstUnion
switch (boolean)
98 case TRUE
: long first_union_foo
;
99 case FALSE
: long first_union_bar
;
102 typedef FirstUnion FirstUnionArray
[2];
106 FirstUnionArray my_struct_foo
;
109 union SecondUnion
switch (boolean)
111 case TRUE
: MyStruct second_union_struct_member
;
112 case FALSE
: long wibble
;
115 typedef FirstUnion BdFirstUnionArray
[2];
119 BdFirstUnionArray my_struct_foo
;
122 union BdSecondUnion
switch (boolean)
124 case TRUE
: BdMyStruct second_union_struct_member
;
125 case FALSE
: long wibble
;
129 typedef long B41
[2][3];
133 union B85
switch (long) {