From 7bb6ef20b7b2d2c78c3782686ec43a7ced48947c Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Sun, 8 Dec 2013 18:34:56 +0000 Subject: Sun Dec 8 18:30:24 UTC 2013 Johnny Willemsen * 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 --- CIAO/tests/Bug_3769_Regression/Foo.idl | 13 ++ CIAO/tests/Bug_3769_Regression/Foo_exec.cpp | 141 ++++++++++++++++++++- CIAO/tests/Bug_3769_Regression/Foo_exec.h | 32 ++++- .../descriptors/DeploymentPlan.cdp | 92 ++++++++++++-- 4 files changed, 262 insertions(+), 16 deletions(-) (limited to 'CIAO/tests') 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 sequence_bounded_string; +typedef sequence sequence_bounded_wstring; +typedef sequence bounded_sequence_bounded_string; +typedef sequence 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 @@ -157,18 +157,6 @@ - - my_octet - - - tk_octet - - - 20 - - - - my_default_octet @@ -262,6 +250,32 @@ + + my_bounded_string_array + + + tk_array + + 2 + + tk_string + + 50 + + + + + + + Hello + + + World + + + + + my_double_array @@ -1111,6 +1125,9 @@ tk_string + + 50 + Hi @@ -1227,6 +1244,57 @@ + + my_sequence_bounded_string + + + tk_sequence + + + tk_string + + 50 + + + + + + + Hi + + + World + + + + + + + my_bounded_sequence_bounded_string + + + tk_sequence + + 5 + + tk_string + + 50 + + + + + + + Hi + + + World + + + + + my_string_sequence_2 -- cgit v1.2.1