summaryrefslogtreecommitdiff
path: root/TAO/tests/IDL_Test
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-07-22 22:28:28 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-07-22 22:28:28 +0000
commit57368ce48d7378aa333b9df705ba89c1df2bf0e4 (patch)
tree95b54052f4394257c7f46607247c5129bf47649b /TAO/tests/IDL_Test
parentdaeea59f4d5813c0a957968bae431250c186d7f2 (diff)
downloadATCD-57368ce48d7378aa333b9df705ba89c1df2bf0e4.tar.gz
ChangeLogTag: Mon Jul 22 17:20:41 2002 Jeff Parsons <parsons@cs.wustl.edu>
Diffstat (limited to 'TAO/tests/IDL_Test')
-rw-r--r--TAO/tests/IDL_Test/enum_in_struct.idl41
-rw-r--r--TAO/tests/IDL_Test/union.idl33
2 files changed, 74 insertions, 0 deletions
diff --git a/TAO/tests/IDL_Test/enum_in_struct.idl b/TAO/tests/IDL_Test/enum_in_struct.idl
index 07e309fe5b7..a8c98468f30 100644
--- a/TAO/tests/IDL_Test/enum_in_struct.idl
+++ b/TAO/tests/IDL_Test/enum_in_struct.idl
@@ -41,3 +41,44 @@ struct HoldsEnum
UnNamed unnamed_enum;
};
+// Test for anonymous arrays of member declarations
+
+struct decl_heavy_struct
+{
+ enum en
+ {
+ a,
+ b,
+ c
+ } m_en[10];
+
+ struct st
+ {
+ long a;
+ char b;
+ } m_st[10];
+
+ union un switch (long)
+ {
+ case 1: long a;
+ case 2: char b;
+ } m_un[10];
+};
+
+// Similar case for exception included here - no sense
+// in making a separte file for exceptions, which are
+// almost the same as structs.
+
+exception ErrorException
+{
+ enum ReasonCode
+ {
+ RESOURCE,
+ COMMUNICATION,
+ ASSERTION,
+ STATE,
+ ALREADY,
+ OTHER
+ } reason;
+};
+
diff --git a/TAO/tests/IDL_Test/union.idl b/TAO/tests/IDL_Test/union.idl
index f2e88ae05c6..30064ac3360 100644
--- a/TAO/tests/IDL_Test/union.idl
+++ b/TAO/tests/IDL_Test/union.idl
@@ -236,3 +236,36 @@ union TestUnion switch (short)
case 2: TestTwoEnum twoEnum;
};
+// Test for various kinds of declarations inside a union,
+// similar to the example in enum_in_struct.idl.
+
+union decl_heavy_union switch (short)
+{
+ case 1:
+ enum which
+ {
+ ZERO,
+ ONE,
+ TWO
+ } m_which;
+ case 2:
+ enum en
+ {
+ a,
+ b,
+ c
+ } m_en_arr[10];
+ case 3:
+ struct st
+ {
+ long a;
+ char b;
+ } m_st_arr[10];
+ case 4:
+ union un switch (long)
+ {
+ case 1: long a;
+ case 2: char b;
+ } m_un_arr[10];
+};
+