diff --git a/test/unittest/dds/publisher/DataWriterTests.cpp b/test/unittest/dds/publisher/DataWriterTests.cpp index 3bd38b5cf91..66accd61158 100644 --- a/test/unittest/dds/publisher/DataWriterTests.cpp +++ b/test/unittest/dds/publisher/DataWriterTests.cpp @@ -1820,7 +1820,10 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyNotKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value, and does not make any change. + // Updated to check negative values (Redmine ticket #20722) + qos.resource_limits().max_samples = -1; qos.resource_limits().max_instances = -1; + qos.resource_limits().max_samples_per_instance = -1; DataWriter* data_writer2 = publisher->create_datawriter(topic, qos); ASSERT_NE(data_writer2, nullptr); @@ -1867,7 +1870,10 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyNotKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. // By not using instances, instance allocation consistency is not checked. + // Updated to check negative values (Redmine ticket #20722) + qos2.resource_limits().max_samples = -1; qos2.resource_limits().max_instances = -1; + qos2.resource_limits().max_samples_per_instance = -1; ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); @@ -1938,8 +1944,10 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. - qos.resource_limits().max_samples = 0; + // Updated to check negative values (Redmine ticket #20722) + qos.resource_limits().max_samples = -1; qos.resource_limits().max_instances = -1; + qos.resource_limits().max_samples_per_instance = -1; DataWriter* data_writer2 = publisher->create_datawriter(topic, qos); ASSERT_NE(data_writer2, nullptr); @@ -1991,8 +1999,10 @@ TEST(DataWriterTests, InstancePolicyAllocationConsistencyKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. - qos2.resource_limits().max_samples = 0; + // Updated to check negative values (Redmine ticket #20722) + qos2.resource_limits().max_samples = 1; qos2.resource_limits().max_instances = -1; + qos2.resource_limits().max_samples_per_instance = -1; ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_writer1->set_qos(qos2)); diff --git a/test/unittest/dds/subscriber/DataReaderTests.cpp b/test/unittest/dds/subscriber/DataReaderTests.cpp index 8b2b7615f4c..7705ebc3efe 100644 --- a/test/unittest/dds/subscriber/DataReaderTests.cpp +++ b/test/unittest/dds/subscriber/DataReaderTests.cpp @@ -3281,7 +3281,10 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyNotKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value, and does not make any change. + // Updated to check negative values (Redmine ticket #20722) + qos.resource_limits().max_samples = -1; qos.resource_limits().max_instances = -1; + qos.resource_limits().max_samples_per_instance = -1; DataReader* data_reader2 = subscriber->create_datareader(topic, qos); ASSERT_NE(data_reader2, nullptr); @@ -3334,7 +3337,10 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyNotKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. // By not using instances, instance allocation consistency is not checked. + // Updated to check negative values (Redmine ticket #20722) + qos2.resource_limits().max_samples = -1; qos2.resource_limits().max_instances = -1; + qos2.resource_limits().max_samples_per_instance = -1; ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); @@ -3405,8 +3411,10 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. - qos.resource_limits().max_samples = 0; + // Updated to check negative values (Redmine ticket #20722) + qos.resource_limits().max_samples = -1; qos.resource_limits().max_instances = -1; + qos.resource_limits().max_samples_per_instance = -1; DataReader* data_reader2 = subscriber->create_datareader(topic, qos); ASSERT_NE(data_reader2, nullptr); @@ -3464,8 +3472,10 @@ TEST_F(DataReaderTests, InstancePolicyAllocationConsistencyKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. - qos2.resource_limits().max_samples = 0; + // Updated to check negative values (Redmine ticket #20722) + qos2.resource_limits().max_samples = -1; qos2.resource_limits().max_instances = -1; + qos2.resource_limits().max_samples_per_instance = -1; ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_data_reader2->set_qos(qos2)); diff --git a/test/unittest/dds/topic/TopicTests.cpp b/test/unittest/dds/topic/TopicTests.cpp index 7f004619090..bd102150bfe 100644 --- a/test/unittest/dds/topic/TopicTests.cpp +++ b/test/unittest/dds/topic/TopicTests.cpp @@ -261,7 +261,10 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyNotKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value, and does not make any change. + // Updated to check negative values (Redmine ticket #20722) + qos.resource_limits().max_samples = -1; qos.resource_limits().max_instances = -1; + qos.resource_limits().max_samples_per_instance = -1; Topic* topic2 = participant->create_topic("footopic2", type.get_type_name(), qos); ASSERT_NE(topic2, nullptr); @@ -308,7 +311,10 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyNotKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. // By not using instances, instance allocation consistency is not checked. + // Updated to check negative values (Redmine ticket #20722) + qos2.resource_limits().max_samples = -1; qos2.resource_limits().max_instances = -1; + qos2.resource_limits().max_samples_per_instance = -1; ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2)); @@ -377,8 +383,10 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. - qos.resource_limits().max_samples = 0; + // Updated to check negative values (Redmine ticket #20722) + qos.resource_limits().max_samples = -1; qos.resource_limits().max_instances = -1; + qos.resource_limits().max_samples_per_instance = -1; Topic* topic2 = participant->create_topic("footopic2", type.get_type_name(), qos); ASSERT_NE(topic2, nullptr); @@ -430,8 +438,10 @@ TEST(TopicTests, InstancePolicyAllocationConsistencyKeyed) // Below an ampliation of the last comprobation, for which it is proved the case of < 0 (-1), // which also means infinite value. - qos2.resource_limits().max_samples = 0; + // Updated to check negative values (Redmine ticket #20722) + qos2.resource_limits().max_samples = -1; qos2.resource_limits().max_instances = -1; + qos2.resource_limits().max_samples_per_instance = -1; ASSERT_EQ(ReturnCode_t::RETCODE_OK, default_topic1->set_qos(qos2));