From 443b321c8863f0880cd54ebeeac0348da96ef3b6 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Wed, 10 Jul 2024 13:15:42 +0200 Subject: [PATCH] Refs #21329: Update 'DataWriter::write' return value as ReturnCode_t Signed-off-by: JesusPoderoso --- fastdds_python/test/api/test_datareader.py | 18 +++++++++--------- fastdds_python/test/api/test_datawriter.py | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fastdds_python/test/api/test_datareader.py b/fastdds_python/test/api/test_datareader.py index c0d020e8..3b9e7406 100644 --- a/fastdds_python/test/api/test_datareader.py +++ b/fastdds_python/test/api/test_datareader.py @@ -685,7 +685,7 @@ def test_get_first_untaken(transient_datareader_qos, datareader, sample = pytest.dds_type.CompleteTestType() sample.int16_field(255) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -968,7 +968,7 @@ def test_get_unread_count(transient_datareader_qos, datareader, sample = pytest.dds_type.CompleteTestType() sample.int16_field(255) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -983,7 +983,7 @@ def test_is_sample_valid(transient_datareader_qos, datareader, """ sample = pytest.dds_type.CompleteTestType() sample.int16_field(255) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -1043,7 +1043,7 @@ def test_read(transient_datareader_qos, datareader, sample = pytest.dds_type.CompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -1123,7 +1123,7 @@ def test_read_next_instance(transient_datareader_qos, test_keyed_type, sample = pytest.dds_type.KeyedCompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -1157,7 +1157,7 @@ def test_read_next_sample(transient_datareader_qos, datareader, sample = pytest.dds_type.CompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -1189,7 +1189,7 @@ def test_take(transient_datareader_qos, datareader, sample = pytest.dds_type.CompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -1269,7 +1269,7 @@ def test_take_next_instance(transient_datareader_qos, test_keyed_type, sample = pytest.dds_type.KeyedCompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) @@ -1303,7 +1303,7 @@ def test_take_next_sample(transient_datareader_qos, datareader, sample = pytest.dds_type.CompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) diff --git a/fastdds_python/test/api/test_datawriter.py b/fastdds_python/test/api/test_datawriter.py index 504fd368..73a7e3b8 100644 --- a/fastdds_python/test/api/test_datawriter.py +++ b/fastdds_python/test/api/test_datawriter.py @@ -118,7 +118,7 @@ def test_clear_history(keep_all_datawriter_qos, datawriter): """ sample = pytest.dds_type.CompleteTestType() sample.int16_field(4) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert([fastdds.RETCODE_OK, 1] == datawriter.clear_history()) @@ -497,7 +497,7 @@ def test_wait_for_acknowledgments(test_keyed_type, datawriter): # Overload 1 sample = pytest.dds_type.KeyedCompleteTestType() sample.id(3) - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) assert(fastdds.RETCODE_OK == datawriter.wait_for_acknowledgments(fastdds.Duration_t(1, 0))) @@ -517,7 +517,7 @@ def test_write(test_keyed_type, datawriter): """ # Overload 1 sample = pytest.dds_type.KeyedCompleteTestType() - assert(datawriter.write(sample)) + assert(fastdds.RETCODE_OK == datawriter.write(sample)) # Overload 2 sample = pytest.dds_type.KeyedCompleteTestType() @@ -530,7 +530,7 @@ def test_write(test_keyed_type, datawriter): sequence_number.low = 1 params.related_sample_identity().writer_guid(guid) params.related_sample_identity().sequence_number(sequence_number) - assert(datawriter.write(sample, params)) + assert(fastdds.RETCODE_OK == datawriter.write(sample, params)) # Overload 3 sample = pytest.dds_type.KeyedCompleteTestType()