Skip to content

Commit

Permalink
Refs #20972. Check final configuration on unit tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed May 16, 2024
1 parent c3b2a67 commit 27a04e9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unittest/transport/TCPv4Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ TEST_F(TCPv4Tests, wrong_configuration_values)
wrong_descriptor.maxMessageSize = 1470;
TCPv4Transport transportUnderTest(wrong_descriptor);
ASSERT_TRUE(transportUnderTest.init());
auto* final_cfg = transportUnderTest.configuration();
EXPECT_GE(final_cfg->sendBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down
5 changes: 5 additions & 0 deletions test/unittest/transport/TCPv6Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ TEST_F(TCPv6Tests, wrong_configuration_values)
wrong_descriptor.maxMessageSize = 1470;
TCPv6Transport transportUnderTest(wrong_descriptor);
ASSERT_TRUE(transportUnderTest.init());
auto* final_cfg = transportUnderTest.configuration();
EXPECT_GE(final_cfg->sendBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down
5 changes: 5 additions & 0 deletions test/unittest/transport/UDPv4Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ TEST_F(UDPv4Tests, wrong_configuration)
wrong_descriptor.maxMessageSize = 1470;
UDPv4Transport transportUnderTest(wrong_descriptor);
ASSERT_TRUE(transportUnderTest.init());
auto* final_cfg = transportUnderTest.configuration();
EXPECT_GE(final_cfg->sendBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down
5 changes: 5 additions & 0 deletions test/unittest/transport/UDPv6Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ TEST_F(UDPv6Tests, wrong_configuration)
wrong_descriptor.maxMessageSize = 1470;
UDPv6Transport transportUnderTest(wrong_descriptor);
ASSERT_TRUE(transportUnderTest.init());
auto* final_cfg = transportUnderTest.configuration();
EXPECT_GE(final_cfg->sendBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down

0 comments on commit 27a04e9

Please sign in to comment.