diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-29 09:17:11 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-29 09:17:11 +0100 |
commit | eea373d412ecd69cc17acff7d9de5814c0d13d12 (patch) | |
tree | c25921d3c1207868cace916efd1119a474efe23c /TAO | |
parent | daabeb9bb2388926f610f93c987563ce596e091f (diff) | |
parent | 541805ce6f992bcde8e77ebc94a83f6b802da0d0 (diff) | |
download | ATCD-eea373d412ecd69cc17acff7d9de5814c0d13d12.tar.gz |
Merge branch 'master' of https://github.com/DOCGroup/ACE_TAO into master
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/tests/IDL_Test/IDL_Test.mpc | 30 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/array.idl | 44 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/array_anonymous.idl | 47 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/sequence.idl | 28 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/sequence_anonymous.idl | 41 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/struct.idl | 17 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/union.idl | 108 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/union_anonymous.idl | 68 |
8 files changed, 267 insertions, 116 deletions
diff --git a/TAO/tests/IDL_Test/IDL_Test.mpc b/TAO/tests/IDL_Test/IDL_Test.mpc index 7ce1884e8bc..1fd59ffc79d 100644 --- a/TAO/tests/IDL_Test/IDL_Test.mpc +++ b/TAO/tests/IDL_Test/IDL_Test.mpc @@ -15,6 +15,7 @@ project(*IDL): taoserver, messaging, gen_ostream { } IDL_Files { + array.idl Bug_2350_Regression.idl Bug_2577_Regression.idl Bug_2582_Regression.idl @@ -41,22 +42,24 @@ project(*IDL): taoserver, messaging, gen_ostream { old_union2.idl params.idl reopened_modules.idl + sequence.idl struct.idl string_value.idl reopen_include1.idl reopen_include2.idl typeprefix.idl + union.idl } IDL_Files { idlflags += -as enum_in_struct.idl - array.idl + array_anonymous.idl array_anon_nested.idl included.idl including.idl - sequence.idl - union.idl + sequence_anonymous.idl + union_anonymous.idl anyunion.idl valuetype.idl } @@ -109,6 +112,8 @@ project(*DLL): taoidldefaults, taolib, messaging { anyunionS.cpp arrayC.cpp arrayS.cpp + array_anonymousC.cpp + array_anonymousS.cpp array_anon_nestedC.cpp array_anon_nestedS.cpp array_onlyA.cpp @@ -201,6 +206,8 @@ project(*DLL): taoidldefaults, taolib, messaging { repo_id_modS.cpp sequenceC.cpp sequenceS.cpp + sequence_anonymousC.cpp + sequence_anonymousS.cpp simple2C.cpp simple2S.cpp simpleC.cpp @@ -219,6 +226,8 @@ project(*DLL): taoidldefaults, taolib, messaging { typeprefixS.cpp unionC.cpp unionS.cpp + union_anonymousC.cpp + union_anonymousS.cpp valuetypeC.cpp valuetypeS.cpp } @@ -261,6 +270,7 @@ project(*NDDS_IDL): ndds_cck_ts_defaults { NDDSTypeSupport_Files { anonymous.idl array.idl + array_anonymous.idl array_only.idl attribute.idl Bug_2350_Regression.idl @@ -301,6 +311,7 @@ project(*NDDS_IDL): ndds_cck_ts_defaults { reopen_include2.idl repo_id_mod.idl sequence.idl + sequence_anonymous.idl simple.idl simple2.idl struct.idl @@ -308,6 +319,7 @@ project(*NDDS_IDL): ndds_cck_ts_defaults { typedef.idl typeprefix.idl union.idl + union_anonymous.idl valuetype.idl } } @@ -318,6 +330,7 @@ project(*CoreDX_IDL): coredx_ts_defaults { CoreDXTypeSupport_Files { anonymous.idl array.idl + array_anonymous.idl array_only.idl attribute.idl Bug_2350_Regression.idl @@ -358,6 +371,7 @@ project(*CoreDX_IDL): coredx_ts_defaults { reopen_include2.idl repo_id_mod.idl sequence.idl + sequence_anonymous.idl simple.idl simple2.idl struct.idl @@ -365,6 +379,7 @@ project(*CoreDX_IDL): coredx_ts_defaults { typedef.idl typeprefix.idl union.idl + uion_anonymous.idl valuetype.idl } } @@ -390,6 +405,9 @@ project(*NDDS_Lib): taolib, messaging, gen_ostream, nddslib { array.cxx arrayPlugin.cxx arraySupport.cxx + array_anonymous.cxx + array_anonymousPlugin.cxx + array_anonymousSupport.cxx array_only.cxx array_onlyPlugin.cxx array_onlySupport.cxx @@ -500,6 +518,9 @@ project(*NDDS_Lib): taolib, messaging, gen_ostream, nddslib { // sequence.cxx // sequencePlugin.cxx // sequenceSupport.cxx +// sequence_anonymous.cxx +// sequence_anonymousPlugin.cxx +// sequence_anonymousSupport.cxx simple.cxx simple2.cxx simple2Plugin.cxx @@ -521,6 +542,9 @@ project(*NDDS_Lib): taolib, messaging, gen_ostream, nddslib { // union.cxx // unionPlugin.cxx // unionSupport.cxx +// union_anonymous.cxx +// union_anonymousPlugin.cxx +// union_anonymousSupport.cxx // valuetype.cxx // valuetypePlugin.cxx // valuetypeSupport.cxx diff --git a/TAO/tests/IDL_Test/array.idl b/TAO/tests/IDL_Test/array.idl index 63febd22d68..61b217bc768 100644 --- a/TAO/tests/IDL_Test/array.idl +++ b/TAO/tests/IDL_Test/array.idl @@ -32,40 +32,6 @@ struct wrap }; typedef wrap outside_array[10]; - - -// Once a problem with expressions in the brackets, -// as well as the typedef'd/anonymous thing. - -interface tdef -{ - const short byteslen = 12; - typedef octet Bytes[byteslen + 1]; - - struct bytes_or_longs - { - Bytes the_bytes; // typedef'd - long Longs[byteslen]; // anonymous - }; -}; - -// To test that all the octet arrays build and link as -// unique types. -module ABCModule -{ - struct RmtPhysicalInfo - { - octet rmtNodeId[22]; - octet rmtDetails[22]; - }; - - struct bbbBubBubBubBaby - { - octet rmtNodeId[22]; - octet rmtDetails[22]; - }; -}; - typedef octet oa1[22]; typedef octet oa2[22]; @@ -160,3 +126,13 @@ module bug_2126 }; }; +typedef long B41[2][3]; +typedef long B42[2]; +typedef long B43[4]; + +union B85 switch (long) { + case 1: B42 b_85_1; + case 2: B43 b_85_2; + case 3: B41 b_85_3; +}; + diff --git a/TAO/tests/IDL_Test/array_anonymous.idl b/TAO/tests/IDL_Test/array_anonymous.idl new file mode 100644 index 00000000000..7303d219625 --- /dev/null +++ b/TAO/tests/IDL_Test/array_anonymous.idl @@ -0,0 +1,47 @@ + +//============================================================================= +/** + * @file array_anonymous.idl + * + * 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. + */ +//============================================================================= + +// Once a problem with expressions in the brackets, +// as well as the typedef'd/anonymous thing. +interface tdef +{ + const short byteslen = 12; + typedef octet Bytes[byteslen + 1]; + + struct bytes_or_longs + { + Bytes the_bytes; // typedef'd + long Longs[byteslen]; // anonymous + }; +}; + +// To test that all the octet arrays build and link as +// unique types. +module ABCModule +{ + struct RmtPhysicalInfo + { + octet rmtNodeId[22]; + octet rmtDetails[22]; + }; + + struct bbbBubBubBubBaby + { + octet rmtNodeId[22]; + octet rmtDetails[22]; + }; +}; + + + diff --git a/TAO/tests/IDL_Test/sequence.idl b/TAO/tests/IDL_Test/sequence.idl index 69f374d1fe2..9be00507897 100644 --- a/TAO/tests/IDL_Test/sequence.idl +++ b/TAO/tests/IDL_Test/sequence.idl @@ -35,40 +35,12 @@ exception nasty // tao/OctetSeqC.h is ever removed. typedef sequence<CORBA::OctetSeq> OctetSeqSeq; -// Bounded string elements of a sequence, -// require the use of CORBA_Any::to_char. - -interface seqTest -{ - typedef sequence< string<12> > dozens; - - void send_dozen (inout dozens bouquets); -}; - local interface seqLocal { }; typedef sequence<seqLocal> seqLocalSeq; -// Anonymous sequence members must be unique types even if the -// sequence itself is not, so the member name has been -// incorported into the sequence class name. #if !defined guards -// are generated around code for the inner anonymous sequences. -struct twinStruct - { - sequence<sequence<short> > and_; - sequence<sequence<short> > or_; - }; - -// Nested sequences -typedef sequence<sequence<short, 5> > outside; - -struct nestedSeqStruct -{ - sequence<sequence<outside>, 7> inside; -}; - // Tests deeply nested recursive type. module Deployment { diff --git a/TAO/tests/IDL_Test/sequence_anonymous.idl b/TAO/tests/IDL_Test/sequence_anonymous.idl new file mode 100644 index 00000000000..416d311bd9b --- /dev/null +++ b/TAO/tests/IDL_Test/sequence_anonymous.idl @@ -0,0 +1,41 @@ +//============================================================================= +/** + * @file sequence_anonymous.idl + * + * 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. + */ +//============================================================================= + +// Bounded string elements of a sequence, +// require the use of CORBA_Any::to_char. +interface seqTest +{ + typedef sequence< string<12> > dozens; + + void send_dozen (inout dozens bouquets); +}; + +// Anonymous sequence members must be unique types even if the +// sequence itself is not, so the member name has been +// incorported into the sequence class name. #if !defined guards +// are generated around code for the inner anonymous sequences. +struct twinStruct + { + sequence<sequence<short> > and_; + sequence<sequence<short> > or_; + }; + +// Nested sequences +typedef sequence<sequence<short, 5> > outside; + +struct nestedSeqStruct +{ + sequence<sequence<outside>, 7> inside; +}; + diff --git a/TAO/tests/IDL_Test/struct.idl b/TAO/tests/IDL_Test/struct.idl index bd80df37061..f8b0317d7cc 100644 --- a/TAO/tests/IDL_Test/struct.idl +++ b/TAO/tests/IDL_Test/struct.idl @@ -39,4 +39,21 @@ module Test FooType Foo1; FooType Foo2; }; + + enum S90 + { + S90_1, + S90_2 + }; + typedef S90 S90Array[2]; + typedef long S42[2]; + typedef string SString43[2]; + typedef S4 S4Array[2]; + struct S10 + { + S90 s10_1; + S42 s10_2; + SString43 s10_3; + S4 s10_4; + }; }; diff --git a/TAO/tests/IDL_Test/union.idl b/TAO/tests/IDL_Test/union.idl index 4aea781b9f6..0ea237b65e2 100644 --- a/TAO/tests/IDL_Test/union.idl +++ b/TAO/tests/IDL_Test/union.idl @@ -225,21 +225,6 @@ struct Field FieldValue value; }; -// Tricky case of lookup for a recursive union. When defined -// inside another datatype like this, the union is referenced -// inside itself before the closing brace is seen, but not -// declared yet. -struct Element -{ - union ValueUnion switch (short) - { - case 0: - long lvalue; - case 1: - sequence<ValueUnion> VUValue; - } Value; -}; - // A fix to the IDL compiler's typecode generation created // a problem with unions that have more than one member, // where any member except the last is itself a scoped type. @@ -263,44 +248,65 @@ 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. +typedef long U41[2][3]; +typedef long U42[2]; + +union U85 switch (long) { + case 1: U41 b_85_1; + case 2: U42 b_85_2; +}; + +typedef string UString[2]; +union U86 switch (long) { + case 1: string b_86_1; + case 2: long b_86_2; +}; +union U88 switch (long) { + case 1: UString b_86_1; + case 2: long b_86_2; +}; + +struct UBar { + long foo; +}; +typedef UBar UBarArray[2]; -typedef long NamedLongArray[10]; +union U87 switch (long) { + case 1: UBar b_87_1; + case 2: long b_87_2; +}; +union U89 switch (long) { + case 1: UBarArray b_87_1; + case 2: long b_87_2; +}; -union decl_heavy_union switch (short) +enum U90 { - 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]; - // The following caused compile problems once - // when generating ostream ops - case 5: - NamedLongArray m_named_long_array; - case 6: - long m_anon_long_array[10]; + U90_1, + U90_2 +}; + +typedef U90 U90Array[2]; + +union U91 switch (long) { + case 1: U90Array b_91_1; + case 2: long b_92_2; +}; + +union U92 switch (long) { + case 1: UBar b_92_1; + case 2: long b_92_2; + default: UBar b_92_3; }; +union U93 switch (long) { + case 1: UBarArray b_93_1; + case 2: long b_93_2; + default: UBarArray b_93_3; +}; + +union U94 switch (long) { + case 1: U90Array b_94_1; + case 2: long b_94_2; + default: U90Array b_94_3; +}; diff --git a/TAO/tests/IDL_Test/union_anonymous.idl b/TAO/tests/IDL_Test/union_anonymous.idl new file mode 100644 index 00000000000..0800949f504 --- /dev/null +++ b/TAO/tests/IDL_Test/union_anonymous.idl @@ -0,0 +1,68 @@ +//============================================================================= +/** + * @file union_anonymous.idl + * + * 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. + */ +//============================================================================= + +// Tricky case of lookup for a recursive union. When defined +// inside another datatype like this, the union is referenced +// inside itself before the closing brace is seen, but not +// declared yet. +struct Element +{ + union ValueUnion switch (short) + { + case 0: + long lvalue; + case 1: + sequence<ValueUnion> VUValue; + } Value; +}; + +// Test for various kinds of declarations inside a union, +// similar to the example in enum_in_struct.idl. +typedef long NamedLongArray[10]; + +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]; + // The following caused compile problems once + // when generating ostream ops + case 5: + NamedLongArray m_named_long_array; + case 6: + long m_anon_long_array[10]; +}; |