summaryrefslogtreecommitdiff
path: root/tests/IDL_Test/typedef.idl
blob: 5385c5ef9360c9db086bc822e3c6963ca75c9347 (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

//=============================================================================
/**
 *  @file    typedef.idl
 *
 *  $Id$
 *
 *  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.
 *
 *
 *  @author Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
 */
//=============================================================================



// Must keep unaliasing until all levels of typedef
// are removed.

// This is also a test of arrays of arrays. Once
// upon a time, the generated CDR operators of such
// animals wouldn't compile on all platforms.

typedef char TAO_A5[5];

typedef TAO_A5 TAO_C5;

typedef TAO_C5 TAO_G5;

typedef TAO_G5 TAO_J5;

typedef TAO_J5 TAO_M5[5];

typedef TAO_M5 TAO_R5;

typedef TAO_R5 TAO_V5;

typedef TAO_V5 TAO_Z5[5];

// Need to make sure that the arg traits specializations for each
// typedef has a unique #ifndef guard.
module TestModule
{
   typedef string<32> typedef_1;
  typedef string<32> typedef_2;

  interface TestInterface
  {
    void set_typedef_1 (in TestModule::typedef_1 typ1);
    void set_typedef_2 (in TestModule::typedef_2 typ2);
  };
};

// Caught failure of arg traits generation for the 2nd typedef.
module bug_2124
{
   typedef string<10> MyString;
   typedef MyString OtherString;

   interface Foo
   {
      void op1 (in MyString s);
      void op2 (in OtherString s);
   };
};

// Caught a case where the #ifdef guards were different, but the
// generated string typename was the same.
module bug_2122
{
   module One
   {
      typedef string<40> MyString;

      interface Whatever
      {
         void someOp (in MyString s);
      };
   };

   module Two
   {
      typedef string<100> MyString; // Same name, different size!

      interface WhoCares
      {
         void someOp (in MyString s);
      };
   };

   module Three
   {
      typedef string<100> MyString; // Same name, same size!

      interface WhoCares
      {
         void someOp (in MyString s);
      };
   };
};

// An anonymous string of the same bound will be found in
// another IDL file not included in this one (anonymous.idl).
// The typecode for the anonymous string should not give us
// 'already found' link errors.
module First
{
  typedef string<32> FirstString;
};

// The anonymous base type is shared by these typedefs, but it
// must be destroyed only once.
module CommaList
{
  typedef sequence<double> Dubble, Dubbel, Toil, Trouble;
};