summaryrefslogtreecommitdiff
path: root/tests/IDL_Test/including.idl
blob: 589054410a89074cd2db5dde5ae69f54058654de (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
// $Id$

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

#ifndef IDL_TEST_INCLUDING_IDL
#define IDL_TEST_INCLUDING_IDL

#include "included.idl"

enum choice
{
  dog
};

union myUnion switch (choice)
{
  // Typedef is in included file
  case dog: Aok::Seq1Type cat;
};

// Enum discriminator is in included file
union Bog switch (Agog)
{
  case Agog1: long bog1;
  case Agog2: long bog2;
  case Agog3: long bog3;
};

// We had a name clash with Me and ME, but the
// rule that requires type defined in a scope
// which is defined in an interface to be
// added to the referenced types in the interface's
// scope doesn't apply here, because Me is not
// defined in the struct, only referenced.
interface iface
{
  enum postal
  {
    ME,
    TAO_FE  // FE is #defined on HP-UX 10.20, so I prefix it with TAO
  };

  struct using_incl
  {
    Aok::Me field1;
  };
};

module VT_Test
{
  typedef sequence<VT_Def::VT> VTSeq;
};

// References to A::MyStructA from included.idl get the
// forward declaration from lookup, and we were
// getting empty typename generation in various places,
// before overriding the visit methods for forward
// declared structs and unions in the relevant visitors.
module A
{
  const long smth = 6;
};

exception MyException
{
  A::MyStructA exField;
};

struct TestStr
{
  A::MyStructA field;
};

union TestUn switch (long)
{
  case 0: A::MyStructA  value1;
  case 1: string value2;
};

interface MyInt
{
  A::MyStructA op (in A::MyStructA ab);
};

#endif /* IDL_TEST_INCLUDING_IDL */