Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend sequence of string tests #446

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module Example {
typedef B51 B55;
typedef string B56[6][5];
typedef sequence<string> B57;
typedef sequence<unsigned long long> B57_stringlength;
typedef string<512> B58;
typedef sequence<B58> B59;
typedef B59 B60;
Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down