diff options
Diffstat (limited to 'TAO/tests/IDL_Test/union.idl')
-rw-r--r-- | TAO/tests/IDL_Test/union.idl | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/TAO/tests/IDL_Test/union.idl b/TAO/tests/IDL_Test/union.idl deleted file mode 100644 index fa2e4cb1607..00000000000 --- a/TAO/tests/IDL_Test/union.idl +++ /dev/null @@ -1,157 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/IDL_Test -// -// = FILENAME -// union.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. -// -// ============================================================================ - - -// Implicit default case - -enum DataType -{ - dtEmpty, - dtLong, - dtShort -}; - -union Data switch (DataType) -{ - case dtLong: long longData; - case dtShort: short shortData; - // by default, empty union -}; - -// Explicit default case - -module Necessary -{ - // It is important to have a module, in which - // the following union is declared. - - typedef long Result; - - enum Kind - { - e_Result, - e_Unused - }; - - union WhichResult switch (Kind ) - { - case e_Result: Result m_Result; - default: long m_Unused; - }; -}; - -// Make sure that CORBA_Any::to_* is used everywhere. -module UnionDiscTest - { - union BooleanUnion switch (boolean) - { - case TRUE: string value; - }; - - union CharUnion switch (char) - { - case 'a': string value; - }; - - union WCharUnion switch (wchar) - { - case 23: string value; - }; - }; - - -// Nested unions - -enum disc1 -{ - one, - two -}; - -enum disc2 -{ - a, - b -}; - -enum disc_outer -{ - out1, - out2 -}; - -union inner1 switch (disc1) -{ - case one: short s; - case two: long l; -}; - -union inner2 switch (disc2) -{ - case a: char c; - case b: long lng; -}; - -union outer switch (disc_outer) -{ - case out1: inner1 first; - case out2: inner2 second; -}; - -module UnionTest3 -{ - enum ValChoice - { - intVal, - realVal - }; - - union ValType switch(ValChoice) - { - case intVal: long integerValue; - case realVal: double realValue; - }; - - struct UpType - { - ValType high; - ValType low; - }; - - struct DownType - { - ValType high; - ValType low; - }; - - enum IndChoice - { - up_Level, - down_Level - }; - - union IndType switch(IndChoice) - { - case up_Level: UpType up; - case down_Level: DownType down; - }; -}; - |