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 //=============================================================================
16 const string all_escape
= "\n\t\v\b\r\f\a\\\?\'\"";
18 const char tick
= '
\''
;
20 const char backslash
= '
\\'
;
22 // The escape sequences will display differently
23 // depending on whether the platform uses signed
24 // or unsigned chars, but either should build w/o
27 // octal escape sequences
29 const char oct_nought
= '
\000'
;
30 const char lucky
= '\
7'
;
31 const char square
= '
4'
;
32 const char blastoff
= '
\321'
;
33 const char max_char_oct
= '
\377'
;
35 // hex escape sequences
37 const char hex_nought
='\x0'
;
38 const char fingers
= '\xA'
;
39 const char fortnight
= '\xe'
;
40 const char fivebits
= '
\x32'
;
41 const char maybe_minus
= '
\xAf'
;
42 const char max_char_hex
= '
\xff'
;
44 const wstring wstr
= L
"wstr";
46 // unsigned longs greater than LONG_MAX
47 const unsigned long in_range
= 3222111000;
48 const unsigned long max_ulong_oct
= 037777777777;
49 const unsigned long max_ulong_hex
= 0XFFFFFFFF;
51 // Testing 64-bit integers. The executable will
52 // verify that the generated values are correct.
53 const unsigned long long AAA
= 122192928000000000;
54 const unsigned long AA
= 3538947897;
55 const long long NAAA
= -122192928000000000;
56 const long long PAAA
= 122192928000000000;
57 const long NAA
= -1538947897;
59 // various uncommon but legal formats for floats and doubles
61 const float root_beer
= .2;
62 const double bogey
= .2;
63 const float trip
= 2.
;
64 const double vision
= .2e-4;
65 const double take
= 2e3
;
66 const double dip
= 1.797693134862315E+308;
67 const double trouble
= 2.2250738585072014E-308;
69 // const values created through mathematic operations
71 const long sub1
= 0x10 - 0x01;
72 const long sub2
= 0x10 + (-0x01);
73 const unsigned long add1
= 16 + 1;
74 const unsigned long mul1
= 0x80 * 0x70;
75 const unsigned long div1
= 99 / 12;
77 // The original Sun code for bitwise operators was broken.
79 const unsigned short stuff
= ~
0;
80 const unsigned long day
= ~
0;
81 const unsigned long drink
= 1000000000 << 2;
82 const unsigned long c_l1
= (1 << 1);
83 const octet c_o11
= 10 + c_l1
;
84 // @@ (JP 06/03/07) Seems it is still broken for big-endian systems,
85 // at least. Rather than hold up a beta release with a redesign...
86 //const octet c_o3 = (1 << 3);
88 // An enum of one type cannot be assigned to an constant of another
89 // enum type, but it's ok if one is a typedef of the other.
92 enum enum_a
{ value_1
, value_2
, value_3
, value_4
, value_5
};
97 typedef m_a
::enum_a enum_b
;
102 const m_b
::enum_b bconst
= m_a
::value_2
;
105 // In a class, string constants cannot be declared inline, but
106 // arithmetic types can be.
107 module ClassConstants
111 const long iface_long
= 55;
112 const string iface_str
= "iface_str";
113 const wstring iface_wstr
= L
"iface_wstr";
118 const double vt_long
= 66.66;
119 const string vt_str
= "vt_str";
120 const wstring vt_wstr
= L
"vt_wstr";
124 // The bitwise OR rhs was causing bogus coercion failure.
127 typedef unsigned short UInt16
;
128 typedef UInt16 CellFlags
;
130 const CellFlags EXPLICIT_VALUE_LOCK
= 0x0400;
131 const CellFlags EDIT_VALUE_LOCK
= 0x1000;
133 const CellFlags VALUE_LOCK
= (EXPLICIT_VALUE_LOCK | EDIT_VALUE_LOCK
);
138 // On some platforms, the rhs of a typedef'd long constant is
139 // getting generated as an unsigned literal.
140 typedef long LongType
;
141 const LongType val
= -3;
142 typedef short ShortType
;
143 const ShortType short_val
= -3;