summaryrefslogtreecommitdiff
path: root/TAO/tests/IDL_Test/nested_scope.idl
blob: b36ce32cdb12cf98876fae9a5765fc23f90f1b91 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/tests/IDL_Test
//
// = FILENAME
//    nested_scope.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.
//
// ============================================================================

// Tests all the problem datatypes for repeating a scope
// name after skipping one nesting level.

module skip
{
  module hump
  {
    struct skip {short s;};
  };
};

module u_skip
{
  module u_hump
  {
    union u_skip switch (short)
    {
      case 0: short s;
    };
  };
};

module e_skip
{
  module e_hump
  {
    exception e_skip {};
  };
};

module i_skip
{
  module i_hump
  {
    interface i_skip {};
  };
};

module pre_u_skip
{
  module pre_u_hump
  {
    typedef sequence<long> pre_u_skip;
  };
};

module pre_b_skip
{
  module pre_b_hump
  {
    typedef sequence<long, 3> pre_b_skip;
  };
};

module str_u_skip
{
  module str_u_hump
  {
    typedef sequence<string> str_u_skip;
  };
};

module str_b_skip
{
  module str_b_hump
  {
    typedef sequence<string, 3> str_b_skip;
  };
};

module wstr_u_skip
{
  module wstr_u_hump
  {
    typedef sequence<wstring> wstr_u_skip;
  };
};

module wstr_b_skip
{
  module wstr_b_hump
  {
    typedef sequence<wstring, 3> wstr_b_skip;
  };
};

interface bloo {};

module obj_u_skip
{
  module obj_u_hump
  {
    typedef sequence<bloo> obj_u_skip;
  };
};

module obj_b_skip
{
  module obj_b_hump
  {
    typedef sequence<bloo> obj_b_skip;
  };
};

module bug_1985_a
{
  module b
  {
    interface something {};
  };
};

module bug_1985_c
{
  module d
  {
    interface something : bug_1985_a::b::something {};
  };
};

// This one caused several problems - in the stub declaration of
// the operation, and in the skeleton body's allocation of return type.
module Negotiator
{
  interface UAV_Negotiator {};

  interface UAV_Negotiator_Factory : ::Negotiator::UAV_Negotiator
  {
    ::Negotiator::UAV_Negotiator make_negotiator (in string bitrate_sc);
  };
};

// Caught some generation of arg helper template parameters not using
// the qualifying '::' on scoped names.

module bug_2125
{
  module Bar
  {
    enum Stuff {ONE, TWO};
  };
};

module Wow
{
  module bug_2125
  {
    interface MyInterface
    {
      void op1 (in bug_2125::Bar::Stuff fbs);
      void op2 (in ::bug_2125::Bar::Stuff fbs);
    };
  };
};

// This will ensure that we always put the '::'
// before the 'CORBA' on predefined types.
module Company
{
  module CORBA
  {
    typedef unsigned long LongU;

    module Inner
    {
      struct Foo
      {
        boolean x;
      };
    };
  };
};