From e1606acf44eff3ad69b057fb33a89accba52cc8b Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 14 May 2024 10:56:14 +0200 Subject: [PATCH] Refs #20972. Less strict tests. Signed-off-by: Miguel Company --- test/unittest/transport/TCPv4Tests.cpp | 6 ++++-- test/unittest/transport/TCPv6Tests.cpp | 6 ++++-- test/unittest/transport/UDPv4Tests.cpp | 6 ++++-- test/unittest/transport/UDPv6Tests.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/test/unittest/transport/TCPv4Tests.cpp b/test/unittest/transport/TCPv4Tests.cpp index 56d8804455d..dce3ab62f88 100644 --- a/test/unittest/transport/TCPv4Tests.cpp +++ b/test/unittest/transport/TCPv4Tests.cpp @@ -141,9 +141,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(); } } diff --git a/test/unittest/transport/TCPv6Tests.cpp b/test/unittest/transport/TCPv6Tests.cpp index 871aff20888..df36c0da303 100644 --- a/test/unittest/transport/TCPv6Tests.cpp +++ b/test/unittest/transport/TCPv6Tests.cpp @@ -143,9 +143,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(); } } diff --git a/test/unittest/transport/UDPv4Tests.cpp b/test/unittest/transport/UDPv4Tests.cpp index 54166e15c78..3f24c0a034b 100644 --- a/test/unittest/transport/UDPv4Tests.cpp +++ b/test/unittest/transport/UDPv4Tests.cpp @@ -132,9 +132,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(); } } diff --git a/test/unittest/transport/UDPv6Tests.cpp b/test/unittest/transport/UDPv6Tests.cpp index 3d8e2455773..6009c7b593c 100644 --- a/test/unittest/transport/UDPv6Tests.cpp +++ b/test/unittest/transport/UDPv6Tests.cpp @@ -139,9 +139,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(); } }