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];
37 // Once a problem with expressions in the brackets,
38 // as well as the typedef'd/anonymous thing.
42 const short byteslen
= 12;
43 typedef octet Bytes
[byteslen
+ 1];
47 Bytes the_bytes
; // typedef'd
48 long Longs
[byteslen
]; // anonymous
52 // To test that all the octet arrays build and link as
56 struct RmtPhysicalInfo
62 struct bbbBubBubBubBaby
69 typedef octet oa1
[22];
70 typedef octet oa2
[22];
72 // Test generation of Arg_Traits specialization for identical
76 void all_arrays
(in oa1 arg1
,
80 // This should generate unique _var and _forany types, but
81 // also generate TAO_String_Manager as the element type for both.
84 typedef string ArrayOfString
[15];
85 typedef string MyString
;
86 typedef MyString ArrayOfMyString
[15];
89 // Checks code generation for arrays and typedefs of arrays
90 // when they are not declared globally or inside a module.
93 typedef char Arraychar
[2];
94 typedef Arraychar ArrayDeChar
;
102 typedef sequence
<Arraychar
> ArraycharList
;
103 typedef sequence
<Arraychar
,10> BdArraycharList
;
105 typedef sequence
<ArrayDeChar
> ArrayDeCharList
;
106 typedef sequence
<ArrayDeChar
,10> BdArrayDeCharList
;
109 // Tests for explicit conversion of slice pointer to the
110 // corresponding forany class before using CDR or Any
111 // operators. This is required because myvec2_slice and
112 // myvec3_slice are the same type, so implicit conversion
113 // from myvec2_slice (in the case below) could go to
114 // myvec2_forany or myvec3_forany.
117 typedef string myvec2
[2];
118 typedef string myvec3
[3];
122 void test_method
(out myvec2 mystring
);
126 // Caught the has_constructor() flag not being passed from the
127 // element type to the array in the AST.
130 union FirstUnion
switch (boolean)
132 case TRUE
: long first_union_foo
;
133 case FALSE
: long first_union_bar
;
136 typedef FirstUnion FirstUnionArray
[2];
140 FirstUnionArray my_struct_foo
;
143 union SecondUnion
switch (boolean)
145 case TRUE
: MyStruct second_union_struct_member
;
146 case FALSE
: long wibble
;
149 typedef FirstUnion BdFirstUnionArray
[2];
153 BdFirstUnionArray my_struct_foo
;
156 union BdSecondUnion
switch (boolean)
158 case TRUE
: BdMyStruct second_union_struct_member
;
159 case FALSE
: long wibble
;