summaryrefslogtreecommitdiff
path: root/TAO/tests/IDL_Test/constants.idl
blob: 4d95752d59e6c108a00eaa138943203f46e6b186 (plain)
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
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/tests/IDL_Test
//
// = FILENAME
//    constants.idl
//
// = DESCRIPTION
//    This file contains examples of IDL code that has
//    caused problems in the past for the TAO IDL
//    compiler. This test is to make sure the problems
//    stay fixed.
//
// = AUTHORS
//    Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
//
// ============================================================================


const string all_escape = "\n\t\v\b\r\f\a\\\?\'\"";

const char tick = '\'';

const char backslash = '\\';

// The escape sequences will display differently
// depending on whether the platform uses signed
// or unsigned chars, but either should build w/o
// errors.

// octal escape sequences

const char oct_nought = '\000';
const char lucky = '\7';
const char square = '4';
const char blastoff = '\321';
const char max_char_oct = '\377';

// hex escape sequences

const char hex_nought ='\x0';
const char fingers = '\xA';
const char fortnight = '\xe';
const char fivebits = '\x32';
const char maybe_minus = '\xAf';
const char max_char_hex = '\xff';

// const wstring wstr = L"wstr";

// unsigned longs greater than LONG_MAX

const unsigned long in_range = 3222111000;
const unsigned long max_ulong_oct = 037777777777;
const unsigned long max_ulong_hex = 0XFFFFFFFF;

// various uncommon but legal formats for floats and doubles

const float root_beer = .2;
const double bogey = .2;
const float trip = 2.;
const double vision = .2e-4;
const double take = 2e3;
const double dip = 1.797693134862315E+308;
const double trouble = 2.2250738585072014E-308;

// The original Sun code for bitwise operators was broken.

const unsigned short stuff = ~0;
const unsigned long day = ~0;
const unsigned long drink = 1000000000 << 2;

// An enum of one type cannot be assigned to an constant of another
// enum type, but it's ok if one is a typedef of the other.
module m_a
{
   enum enum_a { value_1, value_2, value_3, value_4, value_5 };
};

module m_b
{
   typedef m_a::enum_a enum_b;
};

module problems
{
   const m_b::enum_b bconst = m_a::value_2;
};

// In a class, string constants cannot be declared inline, but
// arithmetic types can be.
module ClassConstants
{
  interface Iface
  {
    const long iface_long = 55;
    const string iface_str = "iface_str";
//    const wstring iface_wstr = L"iface_wstr";
  };

  valuetype Vt
  {
    const double vt_long = 66.66;
    const string vt_str = "vt_str";
//    const wstring vt_wstr = L"vt_wstr";
  };
};