From 846d22560cbdb8347276b316c559c27ce04ca6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Thu, 18 Jul 2024 08:14:41 +0200 Subject: [PATCH 1/2] Refs #21382. Fix tests on Ubuntu 24.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- .../dds/domain/DomainParticipantFactory.i | 124 +---- fastdds_python/test/api/test_datareader.py | 72 +-- fastdds_python/test/api/test_datawriter.py | 70 +-- .../test/api/test_domainparticipant.py | 435 +++++------------- .../test/api/test_domainparticipantfactory.py | 155 ++----- fastdds_python/test/api/test_publisher.py | 215 +++------ fastdds_python/test/api/test_subscriber.py | 217 +++------ 7 files changed, 302 insertions(+), 986 deletions(-) diff --git a/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i b/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i index 950579bc..a4d10f4d 100644 --- a/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i +++ b/fastdds_python/src/swig/fastdds/dds/domain/DomainParticipantFactory.i @@ -16,124 +16,22 @@ #include "fastdds/dds/domain/DomainParticipantFactory.hpp" %} -%extend eprosima::fastdds::dds::DomainParticipantFactory -{ - /** - * Create a Participant. - * - * @param domain_id Domain Id. - * @param qos DomainParticipantQos Reference. - * @param listener DomainParticipantListener Pointer (default: nullptr) - * @param mask StatusMask Reference (default: all) - * @return DomainParticipant pointer. (nullptr if not created.) - */ - DomainParticipant* create_participant( - DomainId_t domain_id, - const DomainParticipantQos& qos, - DomainParticipantListener* listener = nullptr, - const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all()) - { - if (nullptr != listener) - { - Swig::Director* director = SWIG_DIRECTOR_CAST(listener); - - if (nullptr != director) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_INCREF(director->swig_get_self()); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - return self->create_participant(domain_id, qos, listener, mask); - } - - /** - * Create a Participant. - * - * @param extended_qos DomainParticipantExtendedQos Reference. - * @param listener DomainParticipantListener Pointer (default: nullptr) - * @param mask StatusMask Reference (default: all) - * @return DomainParticipant pointer. (nullptr if not created.) - */ - DomainParticipant* create_participant( - const DomainParticipantExtendedQos& extended_qos, - DomainParticipantListener* listener = nullptr, - const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all()) - { - if (nullptr != listener) - { - Swig::Director* director = SWIG_DIRECTOR_CAST(listener); - - if (nullptr != director) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_INCREF(director->swig_get_self()); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - return self->create_participant(extended_qos.domainId(), extended_qos, listener, mask); - } - - /** - * Create a Participant. - * - * @param domain_id Domain Id. - * @param profile_name Participant profile name. - * @param listener DomainParticipantListener Pointer (default: nullptr) - * @param mask StatusMask Reference (default: all) - * @return DomainParticipant pointer. (nullptr if not created.) - */ - DomainParticipant* create_participant_with_profile( - DomainId_t domain_id, - const std::string& profile_name, - DomainParticipantListener* listener = nullptr, - const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all()) +%typemap(in) (eprosima::fastdds::dds::DomainParticipantListener* listener) %{ + $typemap(in, eprosima::fastdds::dds::DomainParticipantListener* DISOWN) { - if (nullptr != listener) - { - Swig::Director* director = SWIG_DIRECTOR_CAST(listener); + Swig::Director* director = SWIG_DIRECTOR_CAST($1); - if (nullptr != director) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_INCREF(director->swig_get_self()); - SWIG_PYTHON_THREAD_END_BLOCK; - } - } - - return self->create_participant_with_profile(domain_id, profile_name, listener, mask); - } - - /** - * Create a Participant. - * - * @param profile_name Participant profile name. - * @param listener DomainParticipantListener Pointer (default: nullptr) - * @param mask StatusMask Reference (default: all) - * @return DomainParticipant pointer. (nullptr if not created.) - */ - DomainParticipant* create_participant_with_profile( - const std::string& profile_name, - DomainParticipantListener* listener = nullptr, - const StatusMask& mask = eprosima::fastdds::dds::StatusMask::all()) - { - if (nullptr != listener) + if (nullptr != director) { - Swig::Director* director = SWIG_DIRECTOR_CAST(listener); - - if (nullptr != director) - { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_INCREF(director->swig_get_self()); - SWIG_PYTHON_THREAD_END_BLOCK; - } + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + director->swig_incref(); + SWIG_PYTHON_THREAD_END_BLOCK; } - - return self->create_participant_with_profile(profile_name, listener, mask); } + %} +%extend eprosima::fastdds::dds::DomainParticipantFactory +{ /** * Remove a Participant and all associated publishers and subscribers. * @@ -164,8 +62,6 @@ } } -%ignore eprosima::fastdds::dds::DomainParticipantFactory::create_participant; -%ignore eprosima::fastdds::dds::DomainParticipantFactory::create_participant_with_profile; %ignore eprosima::fastdds::dds::DomainParticipantFactory::delete_participant; %ignore eprosima::fastdds::dds::DomainParticipantFactory::get_dynamic_type_builder_from_xml_by_name; diff --git a/fastdds_python/test/api/test_datareader.py b/fastdds_python/test/api/test_datareader.py index da3faef5..20ec83bf 100644 --- a/fastdds_python/test/api/test_datareader.py +++ b/fastdds_python/test/api/test_datareader.py @@ -743,9 +743,9 @@ def test_get_set_listener(datareader): assert(fastdds.StatusMask.all() == datareader.get_status_mask()) - def test(status_mask_1, status_mask_2): + def test(status_mask_1): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ listener = DataReaderListener() assert(listener is not None) @@ -753,57 +753,24 @@ def test(status_mask_1, status_mask_2): datareader.set_listener(listener, status_mask_1)) assert(datareader.get_listener() == listener) assert(status_mask_1 == datareader.get_status_mask()) - listener = DataReaderListener() - assert(listener is not None) - assert(fastdds.RETCODE_OK == - datareader.set_listener(listener, status_mask_2)) - assert(datareader.get_listener() == listener) - assert(status_mask_2 == datareader.get_status_mask()) # Overload 2: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none()) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available()) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers()) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic()) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed()) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost()) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed()) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos()) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched()) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed()) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos()) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost()) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected()) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched()) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.none()) + test(fastdds.StatusMask.data_available()) + test(fastdds.StatusMask.data_on_readers()) + test(fastdds.StatusMask.inconsistent_topic()) + test(fastdds.StatusMask.liveliness_changed()) + test(fastdds.StatusMask.liveliness_lost()) + test(fastdds.StatusMask.offered_deadline_missed()) + test(fastdds.StatusMask.offered_incompatible_qos()) + test(fastdds.StatusMask.publication_matched()) + test(fastdds.StatusMask.requested_deadline_missed()) + test(fastdds.StatusMask.requested_incompatible_qos()) + test(fastdds.StatusMask.sample_lost()) + test(fastdds.StatusMask.sample_rejected()) + test(fastdds.StatusMask.subscription_matched()) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -817,8 +784,7 @@ def test(status_mask_1, status_mask_2): fastdds.StatusMask.requested_incompatible_qos() << fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << - fastdds.StatusMask.subscription_matched(), - m) + fastdds.StatusMask.subscription_matched()) def test_get_listening_locators(datareader): diff --git a/fastdds_python/test/api/test_datawriter.py b/fastdds_python/test/api/test_datawriter.py index 73a7e3b8..709f55a1 100644 --- a/fastdds_python/test/api/test_datawriter.py +++ b/fastdds_python/test/api/test_datawriter.py @@ -253,7 +253,7 @@ def test_get_set_listener(datawriter): assert(datawriter.get_listener() == listener) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) - def test(status_mask_1, status_mask_2): + def test(status_mask_1): """ Test the entity creation using the two types of StatusMasks. """ @@ -263,57 +263,24 @@ def test(status_mask_1, status_mask_2): datawriter.set_listener(listener, status_mask_1)) assert(datawriter.get_listener() == listener) assert(status_mask_1 == datawriter.get_status_mask()) - listener = DataWriterListener() - assert(listener is not None) - assert(fastdds.RETCODE_OK == - datawriter.set_listener(listener, status_mask_2)) - assert(datawriter.get_listener() == listener) - assert(status_mask_2 == datawriter.get_status_mask()) # Overload 2: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none()) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available()) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers()) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic()) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed()) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost()) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed()) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos()) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched()) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed()) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos()) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost()) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected()) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched()) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.none()) + test(fastdds.StatusMask.data_available()) + test(fastdds.StatusMask.data_on_readers()) + test(fastdds.StatusMask.inconsistent_topic()) + test(fastdds.StatusMask.liveliness_changed()) + test(fastdds.StatusMask.liveliness_lost()) + test(fastdds.StatusMask.offered_deadline_missed()) + test(fastdds.StatusMask.offered_incompatible_qos()) + test(fastdds.StatusMask.publication_matched()) + test(fastdds.StatusMask.requested_deadline_missed()) + test(fastdds.StatusMask.requested_incompatible_qos()) + test(fastdds.StatusMask.sample_lost()) + test(fastdds.StatusMask.sample_rejected()) + test(fastdds.StatusMask.subscription_matched()) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -327,8 +294,7 @@ def test(status_mask_1, status_mask_2): fastdds.StatusMask.requested_incompatible_qos() << fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << - fastdds.StatusMask.subscription_matched(), - m) + fastdds.StatusMask.subscription_matched()) def test_get_liveliness_lost_status(datawriter): diff --git a/fastdds_python/test/api/test_domainparticipant.py b/fastdds_python/test/api/test_domainparticipant.py index 41da4a5a..b7ff48ca 100644 --- a/fastdds_python/test/api/test_domainparticipant.py +++ b/fastdds_python/test/api/test_domainparticipant.py @@ -107,9 +107,9 @@ def test_create_publisher(participant): assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ publisher = participant.create_publisher( fastdds.PUBLISHER_QOS_DEFAULT, listnr, status_mask_1) @@ -118,58 +118,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == publisher.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - publisher = participant.create_publisher( - fastdds.PUBLISHER_QOS_DEFAULT, listnr, status_mask_2) - assert(publisher is not None) - assert(publisher.is_enabled()) - assert(status_mask_2 == publisher.get_status_mask()) - assert(fastdds.RETCODE_OK == - participant.delete_publisher(publisher)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -184,7 +150,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -227,9 +192,9 @@ def test_create_publisher_with_profile(participant): assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ publisher = participant.create_publisher_with_profile( 'test_publisher_profile', listnr, status_mask_1) @@ -240,60 +205,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == publisher.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - publisher = participant.create_publisher_with_profile( - 'test_publisher_profile', listnr, status_mask_2) - assert(publisher is not None) - assert(publisher.is_enabled()) - qos = publisher.get_qos() - assert('partition_name_c' == qos.partition()[0]) - assert(status_mask_2 == publisher.get_status_mask()) - assert(fastdds.RETCODE_OK == - participant.delete_publisher(publisher)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -308,7 +237,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -341,9 +269,9 @@ def test_create_subscriber(participant): assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ subscriber = participant.create_subscriber( fastdds.SUBSCRIBER_QOS_DEFAULT, listnr, status_mask_1) @@ -352,58 +280,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == subscriber.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - subscriber = participant.create_subscriber( - fastdds.SUBSCRIBER_QOS_DEFAULT, listnr, status_mask_2) - assert(subscriber is not None) - assert(subscriber.is_enabled()) - assert(status_mask_2 == subscriber.get_status_mask()) - assert(fastdds.RETCODE_OK == - participant.delete_subscriber(subscriber)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -418,7 +312,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -461,9 +354,9 @@ def test_create_subscriber_with_profile(participant): assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ subscriber = participant.create_subscriber_with_profile( 'test_subscriber_profile', listnr, status_mask_1) @@ -474,60 +367,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == subscriber.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - subscriber = participant.create_subscriber_with_profile( - 'test_subscriber_profile', listnr, status_mask_2) - assert(subscriber is not None) - assert(subscriber.is_enabled()) - qos = subscriber.get_qos() - assert('partition_name_b' == qos.partition()[0]) - assert(status_mask_2 == subscriber.get_status_mask()) - assert(fastdds.RETCODE_OK == - participant.delete_subscriber(subscriber)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -542,7 +399,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -589,9 +445,9 @@ def test_create_and_delete_topic(participant): assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ topic = participant.create_topic( "Complete", test_type.get_type_name(), @@ -601,59 +457,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == topic.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - topic = participant.create_topic( - "Complete", test_type.get_type_name(), - fastdds.TOPIC_QOS_DEFAULT, listnr, status_mask_2) - assert(topic is not None) - assert(topic.is_enabled()) - assert(status_mask_2 == topic.get_status_mask()) - assert(fastdds.RETCODE_OK == - participant.delete_topic(topic)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -668,7 +489,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -821,9 +641,9 @@ def test_get_set_listener(participant): assert(participant.get_listener() == listener) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - def test(status_mask_1, status_mask_2): + def test(status_mask_1): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ listener = DomainParticipantListener() assert(listener is not None) @@ -831,57 +651,24 @@ def test(status_mask_1, status_mask_2): participant.set_listener(listener, status_mask_1)) assert(participant.get_listener() == listener) assert(status_mask_1 == participant.get_status_mask()) - listener = DomainParticipantListener() - assert(listener is not None) - assert(fastdds.RETCODE_OK == - participant.set_listener(listener, status_mask_2)) - assert(participant.get_listener() == listener) - assert(status_mask_2 == participant.get_status_mask()) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none()) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available()) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers()) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic()) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed()) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost()) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed()) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos()) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched()) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed()) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos()) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost()) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected()) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched()) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.none()) + test(fastdds.StatusMask.data_available()) + test(fastdds.StatusMask.data_on_readers()) + test(fastdds.StatusMask.inconsistent_topic()) + test(fastdds.StatusMask.liveliness_changed()) + test(fastdds.StatusMask.liveliness_lost()) + test(fastdds.StatusMask.offered_deadline_missed()) + test(fastdds.StatusMask.offered_incompatible_qos()) + test(fastdds.StatusMask.publication_matched()) + test(fastdds.StatusMask.requested_deadline_missed()) + test(fastdds.StatusMask.requested_incompatible_qos()) + test(fastdds.StatusMask.sample_lost()) + test(fastdds.StatusMask.sample_rejected()) + test(fastdds.StatusMask.subscription_matched()) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -895,9 +682,7 @@ def test(status_mask_1, status_mask_2): fastdds.StatusMask.requested_incompatible_qos() << fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << - fastdds.StatusMask.subscription_matched(), - m) - + fastdds.StatusMask.subscription_matched()) def test_get_partitipant_names(testname_participant_qos, participant): """ @@ -1000,7 +785,7 @@ def test_listener_ownership(): factory = fastdds.DomainParticipantFactory.get_instance() def second_participant(): - listener = DomainParticipantListener() + listener = fastdds.DomainParticipantListener() return factory.create_participant(0, fastdds.PARTICIPANT_QOS_DEFAULT, listener, fastdds.StatusMask.all()) diff --git a/fastdds_python/test/api/test_domainparticipantfactory.py b/fastdds_python/test/api/test_domainparticipantfactory.py index d992be31..7e58cf50 100644 --- a/fastdds_python/test/api/test_domainparticipantfactory.py +++ b/fastdds_python/test/api/test_domainparticipantfactory.py @@ -31,9 +31,9 @@ def test_create_participant(): assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ participant = factory.create_participant( 0, fastdds.PARTICIPANT_QOS_DEFAULT, listnr, status_mask_1) @@ -42,58 +42,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == participant.get_status_mask()) assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - participant = factory.create_participant( - 0, fastdds.PARTICIPANT_QOS_DEFAULT, listnr, status_mask_2) - assert(participant is not None) - assert(participant.is_enabled()) - assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.RETCODE_OK == - factory.delete_participant(participant)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -108,7 +74,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) # Overload 4 @@ -186,9 +151,9 @@ def test_create_participant_with_profile(): assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ participant = factory.create_participant_with_profile( 'test_participant_profile', listnr, status_mask_1) @@ -210,71 +175,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == participant.get_status_mask()) assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - participant = factory.create_participant_with_profile( - 'test_participant_profile', listnr, status_mask_2) - assert(participant is not None) - assert(participant.is_enabled()) - assert(3 == participant.get_domain_id()) - qos = participant.get_qos() - assert('test_name' == qos.name()) - assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.RETCODE_OK == - factory.delete_participant(participant)) - participant = factory.create_participant_with_profile( - 0, 'test_participant_profile', listnr, status_mask_2) - assert(participant is not None) - assert(participant.is_enabled()) - assert(0 == participant.get_domain_id()) - qos = participant.get_qos() - assert('test_name' == qos.name()) - assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.RETCODE_OK == - factory.delete_participant(participant)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -289,5 +207,4 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) diff --git a/fastdds_python/test/api/test_publisher.py b/fastdds_python/test/api/test_publisher.py index 032de12d..ad7b9d1c 100644 --- a/fastdds_python/test/api/test_publisher.py +++ b/fastdds_python/test/api/test_publisher.py @@ -124,9 +124,9 @@ def test_create_datawriter(topic, publisher): assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ datawriter = publisher.create_datawriter( topic, fastdds.DATAWRITER_QOS_DEFAULT, listnr, status_mask_1) @@ -135,58 +135,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == datawriter.get_status_mask()) assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - datawriter = publisher.create_datawriter( - topic, fastdds.DATAWRITER_QOS_DEFAULT, listnr, status_mask_2) - assert(datawriter is not None) - assert(datawriter.is_enabled()) - assert(status_mask_2 == datawriter.get_status_mask()) - assert(fastdds.RETCODE_OK == - publisher.delete_datawriter(datawriter)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -201,7 +167,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -246,7 +211,7 @@ def test_create_datawriter_with_profile(topic, publisher): assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ Test the entity creation using the two types of StatusMasks. """ @@ -260,61 +225,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == datawriter.get_status_mask()) assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - datawriter = publisher.create_datawriter_with_profile( - topic, 'test_datawriter_profile', listnr, status_mask_2) - assert(datawriter is not None) - assert(datawriter.is_enabled()) - qos = datawriter.get_qos() - assert(fastdds.VOLATILE_DURABILITY_QOS == - qos.durability().kind) - assert(status_mask_2 == datawriter.get_status_mask()) - assert(fastdds.RETCODE_OK == - publisher.delete_datawriter(datawriter)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -329,7 +257,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -451,9 +378,9 @@ def test_get_set_listener(publisher): assert(publisher.get_listener() == listener) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) - def test(status_mask_1, status_mask_2): + def test(status_mask_1): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ listener = PublisherListener() assert(listener is not None) @@ -461,57 +388,24 @@ def test(status_mask_1, status_mask_2): publisher.set_listener(listener, status_mask_1)) assert(publisher.get_listener() == listener) assert(status_mask_1 == publisher.get_status_mask()) - listener = PublisherListener() - assert(listener is not None) - assert(fastdds.RETCODE_OK == - publisher.set_listener(listener, status_mask_2)) - assert(publisher.get_listener() == listener) - assert(status_mask_2 == publisher.get_status_mask()) # Overload 2: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none()) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available()) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers()) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic()) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed()) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost()) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed()) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos()) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched()) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed()) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos()) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost()) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected()) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched()) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.none()) + test(fastdds.StatusMask.data_available()) + test(fastdds.StatusMask.data_on_readers()) + test(fastdds.StatusMask.inconsistent_topic()) + test(fastdds.StatusMask.liveliness_changed()) + test(fastdds.StatusMask.liveliness_lost()) + test(fastdds.StatusMask.offered_deadline_missed()) + test(fastdds.StatusMask.offered_incompatible_qos()) + test(fastdds.StatusMask.publication_matched()) + test(fastdds.StatusMask.requested_deadline_missed()) + test(fastdds.StatusMask.requested_incompatible_qos()) + test(fastdds.StatusMask.sample_lost()) + test(fastdds.StatusMask.sample_rejected()) + test(fastdds.StatusMask.subscription_matched()) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -525,8 +419,7 @@ def test(status_mask_1, status_mask_2): fastdds.StatusMask.requested_incompatible_qos() << fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << - fastdds.StatusMask.subscription_matched(), - m) + fastdds.StatusMask.subscription_matched()) def test_lookup_datawriter(topic, publisher): diff --git a/fastdds_python/test/api/test_subscriber.py b/fastdds_python/test/api/test_subscriber.py index b8f443a0..3313cbaf 100644 --- a/fastdds_python/test/api/test_subscriber.py +++ b/fastdds_python/test/api/test_subscriber.py @@ -127,9 +127,9 @@ def test_create_datareader(topic, subscriber): assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ datareader = subscriber.create_datareader( topic, fastdds.DATAREADER_QOS_DEFAULT, listnr, status_mask_1) @@ -138,58 +138,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == datareader.get_status_mask()) assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - datareader = subscriber.create_datareader( - topic, fastdds.DATAREADER_QOS_DEFAULT, listnr, status_mask_2) - assert(datareader is not None) - assert(datareader.is_enabled()) - assert(status_mask_2 == datareader.get_status_mask()) - assert(fastdds.RETCODE_OK == - subscriber.delete_datareader(datareader)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -204,7 +170,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -249,9 +214,9 @@ def test_create_datareader_with_profile(topic, subscriber): assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - def test(status_mask_1, status_mask_2, listnr=None): + def test(status_mask_1, listnr=None): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ datareader = subscriber.create_datareader_with_profile( topic, 'test_datareader_profile', listnr, status_mask_1) @@ -263,61 +228,24 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(status_mask_1 == datareader.get_status_mask()) assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - datareader = subscriber.create_datareader_with_profile( - topic, 'test_datareader_profile', listnr, status_mask_2) - assert(datareader is not None) - assert(datareader.is_enabled()) - qos = datareader.get_qos() - assert(fastdds.RELIABLE_RELIABILITY_QOS == - qos.reliability().kind) - assert(status_mask_2 == datareader.get_status_mask()) - assert(fastdds.RETCODE_OK == - subscriber.delete_datareader(datareader)) # Overload 3: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), None) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all(), listener) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none(), listener) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available(), listener) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers(), listener) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic(), listener) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed(), listener) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost(), listener) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed(), listener) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos(), listener) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched(), listener) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed(), listener) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos(), listener) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost(), listener) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected(), listener) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched(), listener) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all(), None) + test(fastdds.StatusMask.all(), listener) + test(fastdds.StatusMask.none(), listener) + test(fastdds.StatusMask.data_available(), listener) + test(fastdds.StatusMask.data_on_readers(), listener) + test(fastdds.StatusMask.inconsistent_topic(), listener) + test(fastdds.StatusMask.liveliness_changed(), listener) + test(fastdds.StatusMask.liveliness_lost(), listener) + test(fastdds.StatusMask.offered_deadline_missed(), listener) + test(fastdds.StatusMask.offered_incompatible_qos(), listener) + test(fastdds.StatusMask.publication_matched(), listener) + test(fastdds.StatusMask.requested_deadline_missed(), listener) + test(fastdds.StatusMask.requested_incompatible_qos(), listener) + test(fastdds.StatusMask.sample_lost(), listener) + test(fastdds.StatusMask.sample_rejected(), listener) + test(fastdds.StatusMask.subscription_matched(), listener) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -332,7 +260,6 @@ def test(status_mask_1, status_mask_2, listnr=None): fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << fastdds.StatusMask.subscription_matched(), - m, listener) @@ -450,9 +377,9 @@ def test_get_set_listener(subscriber): assert(subscriber.get_listener() == listener) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) - def test(status_mask_1, status_mask_2): + def test(status_mask_1): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ listener = SubscriberListener() assert(listener is not None) @@ -460,57 +387,24 @@ def test(status_mask_1, status_mask_2): subscriber.set_listener(listener, status_mask_1)) assert(subscriber.get_listener() == listener) assert(status_mask_1 == subscriber.get_status_mask()) - listener = SubscriberListener() - assert(listener is not None) - assert(fastdds.RETCODE_OK == - subscriber.set_listener(listener, status_mask_2)) - assert(subscriber.get_listener() == listener) - assert(status_mask_2 == subscriber.get_status_mask()) # Overload 2: Different status masks - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.all(), fastdds.StatusMask_all()) - test(fastdds.StatusMask.none(), fastdds.StatusMask_none()) - test(fastdds.StatusMask.data_available(), - fastdds.StatusMask_data_available()) - test(fastdds.StatusMask.data_on_readers(), - fastdds.StatusMask_data_on_readers()) - test(fastdds.StatusMask.inconsistent_topic(), - fastdds.StatusMask_inconsistent_topic()) - test(fastdds.StatusMask.liveliness_changed(), - fastdds.StatusMask_liveliness_changed()) - test(fastdds.StatusMask.liveliness_lost(), - fastdds.StatusMask_liveliness_lost()) - test(fastdds.StatusMask.offered_deadline_missed(), - fastdds.StatusMask_offered_deadline_missed()) - test(fastdds.StatusMask.offered_incompatible_qos(), - fastdds.StatusMask_offered_incompatible_qos()) - test(fastdds.StatusMask.publication_matched(), - fastdds.StatusMask_publication_matched()) - test(fastdds.StatusMask.requested_deadline_missed(), - fastdds.StatusMask_requested_deadline_missed()) - test(fastdds.StatusMask.requested_incompatible_qos(), - fastdds.StatusMask_requested_incompatible_qos()) - test(fastdds.StatusMask.sample_lost(), - fastdds.StatusMask_sample_lost()) - test(fastdds.StatusMask.sample_rejected(), - fastdds.StatusMask_sample_rejected()) - test(fastdds.StatusMask.subscription_matched(), - fastdds.StatusMask_subscription_matched()) - - m = fastdds.StatusMask_data_available() << \ - fastdds.StatusMask_data_on_readers() << \ - fastdds.StatusMask_inconsistent_topic() << \ - fastdds.StatusMask_liveliness_changed() << \ - fastdds.StatusMask_liveliness_lost() << \ - fastdds.StatusMask_offered_deadline_missed() << \ - fastdds.StatusMask_offered_incompatible_qos() << \ - fastdds.StatusMask_publication_matched() << \ - fastdds.StatusMask_requested_deadline_missed() << \ - fastdds.StatusMask_requested_incompatible_qos() << \ - fastdds.StatusMask_sample_lost() << \ - fastdds.StatusMask_sample_rejected() << \ - fastdds.StatusMask_subscription_matched() + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.all()) + test(fastdds.StatusMask.none()) + test(fastdds.StatusMask.data_available()) + test(fastdds.StatusMask.data_on_readers()) + test(fastdds.StatusMask.inconsistent_topic()) + test(fastdds.StatusMask.liveliness_changed()) + test(fastdds.StatusMask.liveliness_lost()) + test(fastdds.StatusMask.offered_deadline_missed()) + test(fastdds.StatusMask.offered_incompatible_qos()) + test(fastdds.StatusMask.publication_matched()) + test(fastdds.StatusMask.requested_deadline_missed()) + test(fastdds.StatusMask.requested_incompatible_qos()) + test(fastdds.StatusMask.sample_lost()) + test(fastdds.StatusMask.sample_rejected()) + test(fastdds.StatusMask.subscription_matched()) test(fastdds.StatusMask.data_available() << fastdds.StatusMask.data_on_readers() << @@ -524,8 +418,7 @@ def test(status_mask_1, status_mask_2): fastdds.StatusMask.requested_incompatible_qos() << fastdds.StatusMask.sample_lost() << fastdds.StatusMask.sample_rejected() << - fastdds.StatusMask.subscription_matched(), - m) + fastdds.StatusMask.subscription_matched()) def test_lookup_datareader(topic, subscriber): From ddb9b93727a1656a47a08aacccfc68a51704f7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Fri, 19 Jul 2024 08:22:08 +0200 Subject: [PATCH 2/2] Refs #21382. Apply suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- fastdds_python/test/api/test_datareader.py | 7 ++-- fastdds_python/test/api/test_datawriter.py | 9 ++--- .../test/api/test_domainparticipant.py | 37 +++++++++---------- .../test/api/test_domainparticipantfactory.py | 16 ++++---- fastdds_python/test/api/test_publisher.py | 19 +++++----- fastdds_python/test/api/test_subscriber.py | 19 +++++----- 6 files changed, 51 insertions(+), 56 deletions(-) diff --git a/fastdds_python/test/api/test_datareader.py b/fastdds_python/test/api/test_datareader.py index 20ec83bf..c63fb204 100644 --- a/fastdds_python/test/api/test_datareader.py +++ b/fastdds_python/test/api/test_datareader.py @@ -743,20 +743,19 @@ def test_get_set_listener(datareader): assert(fastdds.StatusMask.all() == datareader.get_status_mask()) - def test(status_mask_1): + def test(status_mask): """ Test the entity creation using the type of StatusMask. """ listener = DataReaderListener() assert(listener is not None) assert(fastdds.RETCODE_OK == - datareader.set_listener(listener, status_mask_1)) + datareader.set_listener(listener, status_mask)) assert(datareader.get_listener() == listener) - assert(status_mask_1 == datareader.get_status_mask()) + assert(status_mask == datareader.get_status_mask()) # Overload 2: Different status masks test(fastdds.StatusMask.all()) - test(fastdds.StatusMask.all()) test(fastdds.StatusMask.none()) test(fastdds.StatusMask.data_available()) test(fastdds.StatusMask.data_on_readers()) diff --git a/fastdds_python/test/api/test_datawriter.py b/fastdds_python/test/api/test_datawriter.py index 709f55a1..71c93e7b 100644 --- a/fastdds_python/test/api/test_datawriter.py +++ b/fastdds_python/test/api/test_datawriter.py @@ -253,20 +253,19 @@ def test_get_set_listener(datawriter): assert(datawriter.get_listener() == listener) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) - def test(status_mask_1): + def test(status_mask): """ - Test the entity creation using the two types of StatusMasks. + Test the entity creation using the type of StatusMask. """ listener = DataWriterListener() assert(listener is not None) assert(fastdds.RETCODE_OK == - datawriter.set_listener(listener, status_mask_1)) + datawriter.set_listener(listener, status_mask)) assert(datawriter.get_listener() == listener) - assert(status_mask_1 == datawriter.get_status_mask()) + assert(status_mask == datawriter.get_status_mask()) # Overload 2: Different status masks test(fastdds.StatusMask.all()) - test(fastdds.StatusMask.all()) test(fastdds.StatusMask.none()) test(fastdds.StatusMask.data_available()) test(fastdds.StatusMask.data_on_readers()) diff --git a/fastdds_python/test/api/test_domainparticipant.py b/fastdds_python/test/api/test_domainparticipant.py index b7ff48ca..ef4056a2 100644 --- a/fastdds_python/test/api/test_domainparticipant.py +++ b/fastdds_python/test/api/test_domainparticipant.py @@ -107,15 +107,15 @@ def test_create_publisher(participant): assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ publisher = participant.create_publisher( - fastdds.PUBLISHER_QOS_DEFAULT, listnr, status_mask_1) + fastdds.PUBLISHER_QOS_DEFAULT, listnr, status_mask) assert(publisher is not None) assert(publisher.is_enabled()) - assert(status_mask_1 == publisher.get_status_mask()) + assert(status_mask == publisher.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) @@ -192,17 +192,17 @@ def test_create_publisher_with_profile(participant): assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ publisher = participant.create_publisher_with_profile( - 'test_publisher_profile', listnr, status_mask_1) + 'test_publisher_profile', listnr, status_mask) assert(publisher is not None) assert(publisher.is_enabled()) qos = publisher.get_qos() assert('partition_name_c' == qos.partition()[0]) - assert(status_mask_1 == publisher.get_status_mask()) + assert(status_mask == publisher.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) @@ -269,15 +269,15 @@ def test_create_subscriber(participant): assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ subscriber = participant.create_subscriber( - fastdds.SUBSCRIBER_QOS_DEFAULT, listnr, status_mask_1) + fastdds.SUBSCRIBER_QOS_DEFAULT, listnr, status_mask) assert(subscriber is not None) assert(subscriber.is_enabled()) - assert(status_mask_1 == subscriber.get_status_mask()) + assert(status_mask == subscriber.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) @@ -354,17 +354,17 @@ def test_create_subscriber_with_profile(participant): assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ subscriber = participant.create_subscriber_with_profile( - 'test_subscriber_profile', listnr, status_mask_1) + 'test_subscriber_profile', listnr, status_mask) assert(subscriber is not None) assert(subscriber.is_enabled()) qos = subscriber.get_qos() assert('partition_name_b' == qos.partition()[0]) - assert(status_mask_1 == subscriber.get_status_mask()) + assert(status_mask == subscriber.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) @@ -445,16 +445,16 @@ def test_create_and_delete_topic(participant): assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ topic = participant.create_topic( "Complete", test_type.get_type_name(), - fastdds.TOPIC_QOS_DEFAULT, listnr, status_mask_1) + fastdds.TOPIC_QOS_DEFAULT, listnr, status_mask) assert(topic is not None) assert(topic.is_enabled()) - assert(status_mask_1 == topic.get_status_mask()) + assert(status_mask == topic.get_status_mask()) assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) @@ -641,20 +641,19 @@ def test_get_set_listener(participant): assert(participant.get_listener() == listener) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - def test(status_mask_1): + def test(status_mask): """ Test the entity creation using the type of StatusMask. """ listener = DomainParticipantListener() assert(listener is not None) assert(fastdds.RETCODE_OK == - participant.set_listener(listener, status_mask_1)) + participant.set_listener(listener, status_mask)) assert(participant.get_listener() == listener) - assert(status_mask_1 == participant.get_status_mask()) + assert(status_mask == participant.get_status_mask()) # Overload 3: Different status masks test(fastdds.StatusMask.all()) - test(fastdds.StatusMask.all()) test(fastdds.StatusMask.none()) test(fastdds.StatusMask.data_available()) test(fastdds.StatusMask.data_on_readers()) diff --git a/fastdds_python/test/api/test_domainparticipantfactory.py b/fastdds_python/test/api/test_domainparticipantfactory.py index 7e58cf50..ad67b9b0 100644 --- a/fastdds_python/test/api/test_domainparticipantfactory.py +++ b/fastdds_python/test/api/test_domainparticipantfactory.py @@ -31,15 +31,15 @@ def test_create_participant(): assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ participant = factory.create_participant( - 0, fastdds.PARTICIPANT_QOS_DEFAULT, listnr, status_mask_1) + 0, fastdds.PARTICIPANT_QOS_DEFAULT, listnr, status_mask) assert(participant is not None) assert(participant.is_enabled()) - assert(status_mask_1 == participant.get_status_mask()) + assert(status_mask == participant.get_status_mask()) assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -151,28 +151,28 @@ def test_create_participant_with_profile(): assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ participant = factory.create_participant_with_profile( - 'test_participant_profile', listnr, status_mask_1) + 'test_participant_profile', listnr, status_mask) assert(participant is not None) assert(participant.is_enabled()) assert(3 == participant.get_domain_id()) qos = participant.get_qos() assert('test_name' == qos.name()) - assert(status_mask_1 == participant.get_status_mask()) + assert(status_mask == participant.get_status_mask()) assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) participant = factory.create_participant_with_profile( - 0, 'test_participant_profile', listnr, status_mask_1) + 0, 'test_participant_profile', listnr, status_mask) assert(participant is not None) assert(participant.is_enabled()) assert(0 == participant.get_domain_id()) qos = participant.get_qos() assert('test_name' == qos.name()) - assert(status_mask_1 == participant.get_status_mask()) + assert(status_mask == participant.get_status_mask()) assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) diff --git a/fastdds_python/test/api/test_publisher.py b/fastdds_python/test/api/test_publisher.py index ad7b9d1c..6f83237a 100644 --- a/fastdds_python/test/api/test_publisher.py +++ b/fastdds_python/test/api/test_publisher.py @@ -124,15 +124,15 @@ def test_create_datawriter(topic, publisher): assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ datawriter = publisher.create_datawriter( - topic, fastdds.DATAWRITER_QOS_DEFAULT, listnr, status_mask_1) + topic, fastdds.DATAWRITER_QOS_DEFAULT, listnr, status_mask) assert(datawriter is not None) assert(datawriter.is_enabled()) - assert(status_mask_1 == datawriter.get_status_mask()) + assert(status_mask == datawriter.get_status_mask()) assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) @@ -211,18 +211,18 @@ def test_create_datawriter_with_profile(topic, publisher): assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the two types of StatusMasks. """ datawriter = publisher.create_datawriter_with_profile( - topic, 'test_datawriter_profile', listnr, status_mask_1) + topic, 'test_datawriter_profile', listnr, status_mask) assert(datawriter is not None) assert(datawriter.is_enabled()) qos = datawriter.get_qos() assert(fastdds.VOLATILE_DURABILITY_QOS == qos.durability().kind) - assert(status_mask_1 == datawriter.get_status_mask()) + assert(status_mask == datawriter.get_status_mask()) assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) @@ -378,20 +378,19 @@ def test_get_set_listener(publisher): assert(publisher.get_listener() == listener) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) - def test(status_mask_1): + def test(status_mask): """ Test the entity creation using the type of StatusMask. """ listener = PublisherListener() assert(listener is not None) assert(fastdds.RETCODE_OK == - publisher.set_listener(listener, status_mask_1)) + publisher.set_listener(listener, status_mask)) assert(publisher.get_listener() == listener) - assert(status_mask_1 == publisher.get_status_mask()) + assert(status_mask == publisher.get_status_mask()) # Overload 2: Different status masks test(fastdds.StatusMask.all()) - test(fastdds.StatusMask.all()) test(fastdds.StatusMask.none()) test(fastdds.StatusMask.data_available()) test(fastdds.StatusMask.data_on_readers()) diff --git a/fastdds_python/test/api/test_subscriber.py b/fastdds_python/test/api/test_subscriber.py index 3313cbaf..ca096e7c 100644 --- a/fastdds_python/test/api/test_subscriber.py +++ b/fastdds_python/test/api/test_subscriber.py @@ -127,15 +127,15 @@ def test_create_datareader(topic, subscriber): assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ datareader = subscriber.create_datareader( - topic, fastdds.DATAREADER_QOS_DEFAULT, listnr, status_mask_1) + topic, fastdds.DATAREADER_QOS_DEFAULT, listnr, status_mask) assert(datareader is not None) assert(datareader.is_enabled()) - assert(status_mask_1 == datareader.get_status_mask()) + assert(status_mask == datareader.get_status_mask()) assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) @@ -214,18 +214,18 @@ def test_create_datareader_with_profile(topic, subscriber): assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - def test(status_mask_1, listnr=None): + def test(status_mask, listnr=None): """ Test the entity creation using the type of StatusMask. """ datareader = subscriber.create_datareader_with_profile( - topic, 'test_datareader_profile', listnr, status_mask_1) + topic, 'test_datareader_profile', listnr, status_mask) assert(datareader is not None) assert(datareader.is_enabled()) qos = datareader.get_qos() assert(fastdds.RELIABLE_RELIABILITY_QOS == qos.reliability().kind) - assert(status_mask_1 == datareader.get_status_mask()) + assert(status_mask == datareader.get_status_mask()) assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) @@ -377,20 +377,19 @@ def test_get_set_listener(subscriber): assert(subscriber.get_listener() == listener) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) - def test(status_mask_1): + def test(status_mask): """ Test the entity creation using the type of StatusMask. """ listener = SubscriberListener() assert(listener is not None) assert(fastdds.RETCODE_OK == - subscriber.set_listener(listener, status_mask_1)) + subscriber.set_listener(listener, status_mask)) assert(subscriber.get_listener() == listener) - assert(status_mask_1 == subscriber.get_status_mask()) + assert(status_mask == subscriber.get_status_mask()) # Overload 2: Different status masks test(fastdds.StatusMask.all()) - test(fastdds.StatusMask.all()) test(fastdds.StatusMask.none()) test(fastdds.StatusMask.data_available()) test(fastdds.StatusMask.data_on_readers())