Skip to content

Commit

Permalink
Refs #20722: Include check in previous tests
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso committed Apr 3, 2024
1 parent 1d82d1f commit 81742d8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
14 changes: 12 additions & 2 deletions test/unittest/dds/publisher/DataWriterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down
14 changes: 12 additions & 2 deletions test/unittest/dds/subscriber/DataReaderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down
14 changes: 12 additions & 2 deletions test/unittest/dds/topic/TopicTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 81742d8

Please sign in to comment.