diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2013-12-08 18:34:56 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2013-12-08 18:34:56 +0000 |
commit | 7bb6ef20b7b2d2c78c3782686ec43a7ced48947c (patch) | |
tree | 7bcd81b3af2ece617ea56913409de998e8340417 /CIAO/tests | |
parent | c5f3d1e9ed14601dcce117e8bdaf549f0c2d7a72 (diff) | |
download | ATCD-7bb6ef20b7b2d2c78c3782686ec43a7ced48947c.tar.gz |
Sun Dec 8 18:30:24 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Bug_3769_Regression/Foo.idl:
* tests/Bug_3769_Regression/Foo_exec.h:
* tests/Bug_3769_Regression/Foo_exec.cpp:
* tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp:
Added various attributes that use bounded strings
Diffstat (limited to 'CIAO/tests')
-rw-r--r-- | CIAO/tests/Bug_3769_Regression/Foo.idl | 13 | ||||
-rw-r--r-- | CIAO/tests/Bug_3769_Regression/Foo_exec.cpp | 141 | ||||
-rw-r--r-- | CIAO/tests/Bug_3769_Regression/Foo_exec.h | 32 | ||||
-rw-r--r-- | CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp | 92 |
4 files changed, 262 insertions, 16 deletions
diff --git a/CIAO/tests/Bug_3769_Regression/Foo.idl b/CIAO/tests/Bug_3769_Regression/Foo.idl index c3646693df8..e63951f66ff 100644 --- a/CIAO/tests/Bug_3769_Regression/Foo.idl +++ b/CIAO/tests/Bug_3769_Regression/Foo.idl @@ -35,6 +35,12 @@ typedef octet octet_array[2]; typedef string<50> bounded_string; typedef wstring<50> bounded_wstring; +typedef sequence<bounded_string> sequence_bounded_string; +typedef sequence<bounded_wstring> sequence_bounded_wstring; +typedef sequence<bounded_string, 5> bounded_sequence_bounded_string; +typedef sequence<bounded_wstring, 5> bounded_sequence_bounded_wstring; +typedef bounded_string bounded_string_array[2]; +typedef bounded_wstring bounded_wstring_array[2]; struct Bar { @@ -190,6 +196,13 @@ component Foo supports FooSupport attribute Data my_data_union; attribute Data2 my_var_data_union; attribute StructModule::StructStruct my_struct_struct; + + attribute sequence_bounded_string my_sequence_bounded_string; + attribute sequence_bounded_wstring my_sequence_bounded_wstring; + attribute bounded_sequence_bounded_string my_bounded_sequence_bounded_string; + attribute bounded_sequence_bounded_wstring my_bounded_sequence_bounded_wstring; + attribute bounded_string_array my_bounded_string_array; + attribute bounded_wstring_array my_bounded_wstring_array; }; #endif /* FOO_IDL_ */ diff --git a/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp b/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp index d94d4857b1d..2bd5b4fbdd8 100644 --- a/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp +++ b/CIAO/tests/Bug_3769_Regression/Foo_exec.cpp @@ -97,7 +97,13 @@ namespace CIAO_Foo_Impl my_variable_string_success_ (false), my_default_variable_string_success_ (false), supported_short_success_ (false), - my_struct_struct_success_ (false) + my_struct_struct_success_ (false), + my_sequence_bounded_string_success_ (false), + my_sequence_bounded_wstring_success_ (false), + my_bounded_sequence_bounded_string_success_ (false), + my_bounded_sequence_bounded_wstring_success_ (false), + my_bounded_string_array_success_ (false), + my_bounded_wstring_array_success_ (false) { } @@ -1578,6 +1584,129 @@ namespace CIAO_Foo_Impl this->my_struct_struct_success_ = !error_found; } + void + Foo_exec_i::my_sequence_bounded_string (const sequence_bounded_string& my_sequence_bounded_string) + { + if (my_sequence_bounded_string.length() != 2) + { + ACE_ERROR ((LM_ERROR, "ERROR: my_sequence_bounded_string does not have the correct length\n")); + return; + } + + this->my_sequence_bounded_string_success_ = true; + + if (ACE_OS::strcmp (my_sequence_bounded_string[0], "Hi") != 0) + { + this->my_sequence_bounded_string_success_ = false; + ACE_ERROR ((LM_ERROR, "ERROR: my_sequence_bounded_string[0] != Hi, it is %C\n", + my_sequence_bounded_string[0].in ())); + } + + if (ACE_OS::strcmp (my_sequence_bounded_string[1], "World") != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: my_sequence_bounded_string[1] != World, it is %C\n", + my_sequence_bounded_string[1].in ())); + this->my_sequence_bounded_string_success_ = false; + } + } + + sequence_bounded_string* + Foo_exec_i::my_sequence_bounded_string (void) + { + return 0; + } + + void + Foo_exec_i::my_sequence_bounded_wstring (const sequence_bounded_wstring&) + { + } + + sequence_bounded_wstring* + Foo_exec_i::my_sequence_bounded_wstring (void) + { + return 0; + } + + void + Foo_exec_i::my_bounded_sequence_bounded_string (const bounded_sequence_bounded_string& my_bounded_sequence_bounded_string) + { + if (my_bounded_sequence_bounded_string.length() != 2) + { + ACE_ERROR ((LM_ERROR, "ERROR: my_bounded_sequence_bounded_string does not have the correct length\n")); + return; + } + + this->my_bounded_sequence_bounded_string_success_ = true; + + if (ACE_OS::strcmp (my_bounded_sequence_bounded_string[0], "Hi") != 0) + { + this->my_bounded_sequence_bounded_string_success_ = false; + ACE_ERROR ((LM_ERROR, "ERROR: my_sequence_bounded_string[0] != Hi, it is %C\n", + my_bounded_sequence_bounded_string[0].in ())); + } + + if (ACE_OS::strcmp (my_bounded_sequence_bounded_string[1], "World") != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: my_sequence_bounded_string[1] != World, it is %C\n", + my_bounded_sequence_bounded_string[1].in ())); + this->my_bounded_sequence_bounded_string_success_ = false; + } + } + + bounded_sequence_bounded_string* + Foo_exec_i::my_bounded_sequence_bounded_string (void) + { + return 0; + } + + void + Foo_exec_i::my_bounded_sequence_bounded_wstring (const bounded_sequence_bounded_wstring&) + { + } + + bounded_sequence_bounded_wstring* + Foo_exec_i::my_bounded_sequence_bounded_wstring (void) + { + return 0; + } + + void + Foo_exec_i::my_bounded_string_array (const bounded_string_array my_bounded_string_array) + { + this->my_bounded_string_array_success_ = true; + + if (ACE_OS::strcmp (my_bounded_string_array[0].in (), "Hello") != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: my_bounded_string_array[0] != 'Hello', it is %C\n", + my_bounded_string_array[0].in ())); + this->my_bounded_string_array_success_ = false; + } + + if (ACE_OS::strcmp (my_bounded_string_array[1], "World") != 0) + { + ACE_ERROR ((LM_ERROR, "ERROR: my_bounded_string_array[1] != 'World', it is %C\n", + my_bounded_string_array[1].in ())); + this->my_bounded_string_array_success_ = false; + } + } + + bounded_string_array_slice* + Foo_exec_i::my_bounded_string_array (void) + { + return 0; + } + + void + Foo_exec_i::my_bounded_wstring_array (const bounded_wstring_array) + { + } + + bounded_wstring_array_slice* + Foo_exec_i::my_bounded_wstring_array (void) + { + return 0; + } + // Operations from Components::SessionComponent. void @@ -1647,11 +1776,19 @@ namespace CIAO_Foo_Impl check_error (this->my_string_sequence_success_, "string sequence"); check_error (this->my_string_sequence_2_success_, "sequence in sequence"); check_error (this->my_array_sequence_success_, "array in sequence"); - check_error (this->my_bounded_string_success_, "fixed string"); + check_error (this->my_bounded_string_success_, "bounded string"); check_error (this->my_variable_string_success_, "variable string"); check_error (this->my_default_variable_string_success_, "default variable string"); check_error (this->supported_short_success_, "supported short"); check_error (this->my_struct_struct_success_, "nested struct"); + + // wstring not supported at this moment + check_error (this->my_sequence_bounded_string_success_, "sequence bounded strings"); + //check_error (this->my_sequence_bounded_wstring_success_, "sequence bounded wstrings"); + check_error (this->my_bounded_sequence_bounded_string_success_, "bounded sequence bounded strings"); + //check_error (this->my_bounded_sequence_bounded_wstring_success_, "bounded sequence bounded wstrings"); + check_error (this->my_bounded_string_array_success_, "array bounded strings"); + //check_error (this->my_bounded_wstring_array_success_, "array bounded wstrings"); } void diff --git a/CIAO/tests/Bug_3769_Regression/Foo_exec.h b/CIAO/tests/Bug_3769_Regression/Foo_exec.h index b5a4cb807c7..8644d9aa875 100644 --- a/CIAO/tests/Bug_3769_Regression/Foo_exec.h +++ b/CIAO/tests/Bug_3769_Regression/Foo_exec.h @@ -275,6 +275,29 @@ namespace CIAO_Foo_Impl virtual void my_struct_struct (const StructModule::StructStruct & my_struct_struct); + virtual void my_sequence_bounded_string (const sequence_bounded_string&); + + virtual sequence_bounded_string* my_sequence_bounded_string (void); + + virtual void my_sequence_bounded_wstring (const sequence_bounded_wstring&); + + virtual sequence_bounded_wstring* my_sequence_bounded_wstring (void); + + virtual void my_bounded_sequence_bounded_string (const bounded_sequence_bounded_string&); + + virtual bounded_sequence_bounded_string* my_bounded_sequence_bounded_string (void); + + virtual void my_bounded_sequence_bounded_wstring (const bounded_sequence_bounded_wstring&); + + virtual bounded_sequence_bounded_wstring* my_bounded_sequence_bounded_wstring (void); + + virtual void my_bounded_string_array (const bounded_string_array); + + virtual bounded_string_array_slice* my_bounded_string_array (void); + + virtual void my_bounded_wstring_array (const bounded_wstring_array); + + virtual bounded_wstring_array_slice* my_bounded_wstring_array (void); //@} //@{ @@ -344,8 +367,13 @@ namespace CIAO_Foo_Impl my_variable_string_success_, my_default_variable_string_success_, supported_short_success_, - my_struct_struct_success_; - + my_struct_struct_success_, + my_sequence_bounded_string_success_, + my_sequence_bounded_wstring_success_, + my_bounded_sequence_bounded_string_success_, + my_bounded_sequence_bounded_wstring_success_, + my_bounded_string_array_success_, + my_bounded_wstring_array_success_; }; extern "C" FOO_EXEC_Export ::Components::EnterpriseComponent_ptr diff --git a/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp b/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp index ef1d1a9b20e..fd8705a4deb 100644 --- a/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp +++ b/CIAO/tests/Bug_3769_Regression/descriptors/DeploymentPlan.cdp @@ -158,18 +158,6 @@ </configProperty> <configProperty> - <name>my_octet</name> - <value> - <type> - <kind>tk_octet</kind> - </type> - <value> - <octet>20</octet> - </value> - </value> - </configProperty> - - <configProperty> <name>my_default_octet</name> <value> <type> @@ -263,6 +251,32 @@ </configProperty> <configProperty> + <name>my_bounded_string_array</name> + <value> + <type> + <kind>tk_array</kind> + <array> + <length>2</length> + <elementType> + <kind>tk_string</kind> + <boundedString> + <bound>50</bound> + </boundedString> + </elementType> + </array> + </type> + <value> + <element> + <string>Hello</string> + </element> + <element> + <string>World</string> + </element> + </value> + </value> + </configProperty> + + <configProperty> <name>my_double_array</name> <value> <type> @@ -1111,6 +1125,9 @@ <value> <type> <kind>tk_string</kind> + <boundedString> + <bound>50</bound> + </boundedString> </type> <value> <string>Hi</string> @@ -1228,6 +1245,57 @@ </configProperty> <configProperty> + <name>my_sequence_bounded_string</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <elementType> + <kind>tk_string</kind> + <boundedString> + <bound>50</bound> + </boundedString> + </elementType> + </sequence> + </type> + <value> + <element> + <string>Hi</string> + </element> + <element> + <string>World</string> + </element> + </value> + </value> + </configProperty> + + <configProperty> + <name>my_bounded_sequence_bounded_string</name> + <value> + <type> + <kind>tk_sequence</kind> + <sequence> + <bound>5</bound> + <elementType> + <kind>tk_string</kind> + <boundedString> + <bound>50</bound> + </boundedString> + </elementType> + </sequence> + </type> + <value> + <element> + <string>Hi</string> + </element> + <element> + <string>World</string> + </element> + </value> + </value> + </configProperty> + + <configProperty> <name>my_string_sequence_2</name> <value> <type> |