Skip to content

Commit

Permalink
Refs #20972. Less strict 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 c0a0f63 commit 6d94732
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions test/unittest/transport/TCPv4Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ TEST_F(TCPv4Tests, wrong_configuration_values)
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);
// The system could allow for the send buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
// The system could allow for the receive buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/unittest/transport/TCPv6Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ TEST_F(TCPv6Tests, wrong_configuration_values)
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);
// The system could allow for the send buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
// The system could allow for the receive buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/unittest/transport/UDPv4Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ TEST_F(UDPv4Tests, wrong_configuration)
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);
// The system could allow for the send buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
// The system could allow for the receive buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/unittest/transport/UDPv6Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ TEST_F(UDPv6Tests, wrong_configuration)
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);
// The system could allow for the send buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->sendBufferSize, wrong_descriptor.sendBufferSize);
EXPECT_GE(final_cfg->receiveBufferSize, final_cfg->maxMessageSize);
EXPECT_LT(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
// The system could allow for the receive buffer to be MAX_INT, so we cannot check it to be strictly lower
EXPECT_LE(final_cfg->receiveBufferSize, wrong_descriptor.receiveBufferSize);
eprosima::fastdds::dds::Log::Flush();
}
}
Expand Down

0 comments on commit 6d94732

Please sign in to comment.