Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / IDLv4 / explicit_ints / test.idl
blob426a962d857344454f3a61d89fb78b93f355f5e2
1 #include __TAO_IDL_FEATURES
2 #ifdef TAO_IDL_HAS_EXPLICIT_INTS
3 # if !TAO_IDL_HAS_EXPLICIT_INTS
4 # error "Expecting macro to be true"
5 # endif
6 #else
7 # error "Expecting macro to be defined"
8 #endif
10 #include "tao/Int8Seq.pidl"
11 #include "tao/UInt8Seq.pidl"
12 #include "tao/OctetSeq.pidl"
13 #include "tao/CharSeq.pidl"
15 const uint8 u8_min = 0;
16 const uint8 u8_max = 255;
17 const int8 i8_min = -128;
18 const int8 i8_max = 127;
19 const uint16 u16_max = 65535;
20 const int16 i16_min = -32768;
21 const int16 i16_max = 32767;
22 const uint32 u32_max = 4294967295;
23 const int32 i32_min = -2147483648;
24 const int32 i32_max = 2147483647;
25 const uint64 u64_max = 18446744073709551615;
26 const int64 i64_min = -9223372036854775808;
27 const int64 i64_max = 9223372036854775807;
29 const uint8 u8_min_overflow = u8_min - 1; // == u8_max
30 const int8 i8_min_overflow = i8_min - 1; // == i8_max
31 const uint8 u8_max_overflow = u8_max + 1; // == 0
32 const int8 i8_max_overflow = i8_max + 1; // == i8_min
34 const uint8 u8_max_negate = ~u8_max; // == 0
35 const int8 i8_max_negate = ~i8_max; // == i8_min
37 const uint8 u8_e1 = 2;
38 const uint8 u8_e2 = u8_e1 + 2;
39 const uint8 u8_e3 = u8_e2 * 3;
40 const uint8 u8_e4 = u8_e3 / 4;
41 const uint8 u8_e5 = u8_e4 | 5;
42 const uint8 u8_e6 = u8_e5 ^ 6;
43 const uint8 u8_e7 = u8_e6 & 7;
44 const uint8 u8_e8 = u8_e7 << 4;
45 const uint8 u8_e9 = u8_e8 >> 1;
47 const int8 i8_e1 = -2;
48 const int8 i8_e2 = i8_e1 - -6;
49 const int8 i8_e3 = i8_e2 * 3;
50 const int8 i8_e4 = i8_e3 / 4;
51 const int8 i8_e5 = i8_e4 | 5;
52 const int8 i8_e6 = i8_e5 ^ 6;
53 const int8 i8_e7 = i8_e6 & 7;
54 const int8 i8_e8 = i8_e7 << 4;
55 const int8 i8_e9 = i8_e8 >> 1;
57 typedef uint8 U8arr[3];
58 typedef int8 I8arr[3];
59 typedef octet Oarr[3];
60 typedef char Carr[3];
61 typedef sequence<uint8> U8seq;
62 typedef sequence<int8> I8seq;
63 typedef sequence<octet> Oseq;
64 typedef sequence<char> Cseq;
66 struct StructWithInts {
67 uint8 u8;
68 int8 i8;
69 uint16 u16;
70 int16 i16;
71 uint32 u32;
72 int32 i32;
73 uint64 u64;
74 int64 i64;
76 // Make sure there's no conflict between uint8, int8, octet, and char.
77 uint8 u8_arr[3];
78 int8 i8_arr[3];
79 sequence<uint8> u8_seq;
80 sequence<int8> i8_seq;
81 sequence<octet> o_seq;
82 sequence<char> c_seq;
84 U8arr td_u8_arr;
85 I8arr td_i8_arr;
86 U8seq td_u8_seq;
87 I8seq td_i8_seq;
88 Oseq td_o_seq;
89 Cseq td_c_seq;
92 union UnionOverU8 switch (uint8) {
93 case 0:
94 uint8 u8;
95 case 1:
96 int8 i8;
97 case 2:
98 uint8 u8arr[3];
99 case 3:
100 int8 i8arr[3];
101 case 4:
102 sequence<uint8> u8seq;
103 case 5:
104 sequence<int8> i8seq;
107 union UnionOverI8 switch (int8) {
108 case 0:
109 uint8 u8;
110 case 1:
111 int8 i8;
112 case 2:
113 uint8 u8arr[3];
114 case 3:
115 int8 i8arr[3];
116 case 4:
117 sequence<uint8> u8seq;
118 case 5:
119 sequence<int8> i8seq;