diff --git a/connectors/dds4ccm/tests/idl_conversion/data/idl_conversion.idl b/connectors/dds4ccm/tests/idl_conversion/data/idl_conversion.idl index 2fa98119..84302c00 100644 --- a/connectors/dds4ccm/tests/idl_conversion/data/idl_conversion.idl +++ b/connectors/dds4ccm/tests/idl_conversion/data/idl_conversion.idl @@ -69,6 +69,7 @@ module Example { typedef B51 B55; typedef string B56[6][5]; typedef sequence B57; + typedef sequence B57_stringlength; typedef string<512> B58; typedef sequence B59; typedef B59 B60; @@ -169,6 +170,7 @@ module Example { B55 b_55; B56 b_56; B57 b_57; + B57_stringlength b_57_stringlength; B59 b_59; B60 b_60; diff --git a/connectors/dds4ccm/tests/idl_conversion/receiver/idl_conversion_receiver_exec.cpp b/connectors/dds4ccm/tests/idl_conversion/receiver/idl_conversion_receiver_exec.cpp index d33d8545..4377110e 100644 --- a/connectors/dds4ccm/tests/idl_conversion/receiver/idl_conversion_receiver_exec.cpp +++ b/connectors/dds4ccm/tests/idl_conversion/receiver/idl_conversion_receiver_exec.cpp @@ -435,8 +435,7 @@ namespace IDL_Conversion_Test_Receiver_Impl { for (uint16_t y = 0; y < 5; ++y) { - const std::string expected ( - std::to_string (x + y + datum.iteration ())); + const std::string expected (std::to_string (x + y + datum.iteration ())); if (datum.b_56 ()[x][y] != expected) { DDS4CCM_TEST_ERROR << "Receiver check - ERROR: unexpected value for " @@ -454,12 +453,18 @@ namespace IDL_Conversion_Test_Receiver_Impl const std::string expected ("VALUE_"+std::to_string (datum.iteration () + c)); if (val != expected) { + if (datum.b_57_stringlength()[c] != expected.length()) + { + DDS4CCM_TEST_ERROR << "Receiver check - ERROR: string length of " + << "datum.b_57[" << c << "] is not " << expected.length() + << " but " << datum.b_57_stringlength()[c] << std::endl; + } if (!val.empty ()) { if (val.back() == 0) { DDS4CCM_TEST_ERROR << "Receiver check - ERROR: last character of " - << "datum.b_57[" << c << "] is 0" << std::endl; + << "datum.b_57[" << c << "] is 0" << std::endl; } } DDS4CCM_TEST_ERROR << "Receiver check - ERROR: unexpected value for " diff --git a/connectors/dds4ccm/tests/idl_conversion/sender/idl_conversion_sender_exec.cpp b/connectors/dds4ccm/tests/idl_conversion/sender/idl_conversion_sender_exec.cpp index 80c96c8b..1144a51b 100644 --- a/connectors/dds4ccm/tests/idl_conversion/sender/idl_conversion_sender_exec.cpp +++ b/connectors/dds4ccm/tests/idl_conversion/sender/idl_conversion_sender_exec.cpp @@ -405,9 +405,12 @@ namespace IDL_Conversion_Test_Sender_Impl } Example::B57 b57; + Example::B57_stringlength b57_stringlength; for (uint16_t val = this->last_iteration_; val < this->last_iteration_ + 100; ++val) { - b57.push_back ("VALUE_"+std::to_string (val)); + std::string tosend = "VALUE_"+std::to_string (val); + b57.push_back (tosend); + b57_stringlength.push_back (tosend.length ()); } Example::B59 b59; @@ -487,6 +490,7 @@ namespace IDL_Conversion_Test_Sender_Impl b55, b56, b57, + b57_stringlength, b59, b60, a_13 ? Example::B70::B70_1 : Example::B70::B70_2,