diff --git a/fastdds_python/src/swig/fastdds/dds/topic/TypeSupport.i b/fastdds_python/src/swig/fastdds/dds/topic/TypeSupport.i index 4ad811dd..9fc8a9c8 100644 --- a/fastdds_python/src/swig/fastdds/dds/topic/TypeSupport.i +++ b/fastdds_python/src/swig/fastdds/dds/topic/TypeSupport.i @@ -37,14 +37,14 @@ // Do not worry about the heap allocation, SWIG recognizes the method as a constructor // and successfully deallocates on destruction %extend eprosima::fastdds::dds::TypeSupport { - %apply SWIGTYPE *DISOWN { TopicDataType* ptr }; - TypeSupport(TopicDataType* ptr) + %apply SWIGTYPE *DISOWN { eprosima::fastdds::dds::TopicDataType* ptr }; + TypeSupport(eprosima::fastdds::dds::TopicDataType* ptr) { return new eprosima::fastdds::dds::TypeSupport(ptr); } - %apply SWIGTYPE *DISOWN { TopicDataType* ptr }; - void set(TopicDataType* ptr) + %apply SWIGTYPE *DISOWN { eprosima::fastdds::dds::TopicDataType* ptr }; + void set(eprosima::fastdds::dds::TopicDataType* ptr) { self->reset(ptr); } diff --git a/fastdds_python/test/api/test_datareader.py b/fastdds_python/test/api/test_datareader.py index 6e83e0ba..a7bcdde4 100644 --- a/fastdds_python/test/api/test_datareader.py +++ b/fastdds_python/test/api/test_datareader.py @@ -72,14 +72,14 @@ def datareader(participant, topic, subscriber, datareader_qos): yield datareader - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -109,14 +109,14 @@ def datawriter(writer_participant, writer_topic, publisher): yield datawriter - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_topic(writer_topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_publisher(publisher)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(writer_participant)) @@ -135,8 +135,8 @@ def fill_keyed_complete_test_type(data, cdr_version): struct_type1.float_field(1.0) struct_type1.double_field(1200.5) struct_type1.bool_field(False) - struct_type1.enum_field(pytest.dds_type.RED) - struct_type1.enum2_field(pytest.dds_type.STONE) + struct_type1.enum_field(pytest.dds_type.Color_RED) + struct_type1.enum2_field(pytest.dds_type.Material_STONE) struct_type2 = pytest.dds_type.StructType() struct_type2.char_field('\x02') struct_type2.uint8_field(255) @@ -149,8 +149,8 @@ def fill_keyed_complete_test_type(data, cdr_version): struct_type2.float_field(2.0) struct_type2.double_field(1202.5) struct_type2.bool_field(True) - struct_type2.enum_field(pytest.dds_type.BLUE) - struct_type2.enum2_field(pytest.dds_type.PLASTIC) + struct_type2.enum_field(pytest.dds_type.Color_BLUE) + struct_type2.enum2_field(pytest.dds_type.Material_PLASTIC) struct_type3 = pytest.dds_type.StructType() struct_type3.char_field('\x03') struct_type3.uint8_field(1) @@ -163,8 +163,8 @@ def fill_keyed_complete_test_type(data, cdr_version): struct_type3.float_field(3.0) struct_type3.double_field(3.5) struct_type3.bool_field(False) - struct_type3.enum_field(pytest.dds_type.MAGENTA) - struct_type3.enum2_field(pytest.dds_type.METAL) + struct_type3.enum_field(pytest.dds_type.Color_MAGENTA) + struct_type3.enum2_field(pytest.dds_type.Material_METAL) data.char_field('\x01') data.uint8_field(254) @@ -178,8 +178,8 @@ def fill_keyed_complete_test_type(data, cdr_version): data.double_field(1202.5) data.bool_field(True) data.string_field("Test string") - data.enum_field(pytest.dds_type.MAGENTA) - data.enum2_field(pytest.dds_type.METAL) + data.enum_field(pytest.dds_type.Color_MAGENTA) + data.enum2_field(pytest.dds_type.Material_METAL) data.struct_field().char_field('\x01') data.struct_field().uint8_field(254) data.struct_field().int16_field(-10) @@ -192,8 +192,8 @@ def fill_keyed_complete_test_type(data, cdr_version): data.struct_field().double_field(1202.5) data.struct_field().bool_field(False) data.struct_field().string_field("Test string") - data.struct_field().enum_field(pytest.dds_type.MAGENTA) - data.struct_field().enum2_field(pytest.dds_type.METAL) + data.struct_field().enum_field(pytest.dds_type.Color_MAGENTA) + data.struct_field().enum2_field(pytest.dds_type.Material_METAL) if (cdr_version == 'v1'): data.char_opt_field('\x01') data.uint8_opt_field(254) @@ -207,7 +207,7 @@ def fill_keyed_complete_test_type(data, cdr_version): data.double_opt_field(1202.5) data.bool_opt_field(True) data.string_opt_field("Test string") - data.enum_opt_field(pytest.dds_type.MAGENTA) + data.enum_opt_field(pytest.dds_type.Color_MAGENTA) else: data.char_opt_field().set_value('\x01') data.uint8_opt_field().set_value(254) @@ -221,7 +221,7 @@ def fill_keyed_complete_test_type(data, cdr_version): data.double_opt_field().set_value(1202.5) data.bool_opt_field().set_value(True) data.string_opt_field().set_value("Test string") - data.enum_opt_field().set_value(pytest.dds_type.MAGENTA) + data.enum_opt_field().set_value(pytest.dds_type.Color_MAGENTA) struct_field = pytest.dds_type.StructType() struct_field.char_field('\x01') struct_field.uint8_field(254) @@ -235,8 +235,8 @@ def fill_keyed_complete_test_type(data, cdr_version): struct_field.double_field(1202.5) struct_field.bool_field(True) struct_field.string_field("Test string") - struct_field.enum_field(pytest.dds_type.MAGENTA) - struct_field.enum2_field(pytest.dds_type.METAL) + struct_field.enum_field(pytest.dds_type.Color_MAGENTA) + struct_field.enum2_field(pytest.dds_type.Material_METAL) if (cdr_version == 'v1'): data.struct_opt_field(struct_field) else: @@ -252,10 +252,10 @@ def fill_keyed_complete_test_type(data, cdr_version): data.array_float_field([1.0, 2.0, 3.0]) data.array_double_field([1200.5, 1202.5, 3.5]) data.array_bool_field([False, True, False]) - data.array_enum_field([pytest.dds_type.RED, pytest.dds_type.BLUE, pytest.dds_type.MAGENTA]) - data.array_enum2_field()[0] = pytest.dds_type.METAL - data.array_enum2_field()[1] = pytest.dds_type.STONE - data.array_enum2_field()[2] = pytest.dds_type.PLASTIC + data.array_enum_field([pytest.dds_type.Color_RED, pytest.dds_type.Color_BLUE, pytest.dds_type.Color_MAGENTA]) + data.array_enum2_field()[0] = pytest.dds_type.Material_METAL + data.array_enum2_field()[1] = pytest.dds_type.Material_STONE + data.array_enum2_field()[2] = pytest.dds_type.Material_PLASTIC data.array_struct_field([struct_type1, struct_type2, struct_type3]) data.bounded_sequence_char_field(['\x01', '\x02', '\x03']) data.bounded_sequence_uint8_field([254, 255, 1]) @@ -268,10 +268,10 @@ def fill_keyed_complete_test_type(data, cdr_version): data.bounded_sequence_float_field([1.0, 2.0, 3.0]) data.bounded_sequence_double_field([1200.5, 1202.5, 3.5]) data.bounded_sequence_bool_field([False, True, False]) - data.bounded_sequence_enum_field([pytest.dds_type.RED, pytest.dds_type.BLUE, pytest.dds_type.MAGENTA]) - data.bounded_sequence_enum2_field().push_back(pytest.dds_type.METAL) - data.bounded_sequence_enum2_field().push_back(pytest.dds_type.STONE) - data.bounded_sequence_enum2_field().push_back(pytest.dds_type.PLASTIC) + data.bounded_sequence_enum_field([pytest.dds_type.Color_RED, pytest.dds_type.Color_BLUE, pytest.dds_type.Color_MAGENTA]) + data.bounded_sequence_enum2_field().push_back(pytest.dds_type.Material_METAL) + data.bounded_sequence_enum2_field().push_back(pytest.dds_type.Material_STONE) + data.bounded_sequence_enum2_field().push_back(pytest.dds_type.Material_PLASTIC) data.bounded_sequence_struct_field([struct_type1, struct_type2, struct_type3]) data.unbounded_sequence_char_field(['\x01', '\x02', '\x03']) data.unbounded_sequence_uint8_field([254, 255, 1]) @@ -284,10 +284,10 @@ def fill_keyed_complete_test_type(data, cdr_version): data.unbounded_sequence_float_field([1.0, 2.0, 3.0]) data.unbounded_sequence_double_field([1200.5, 1202.5, 3.5]) data.unbounded_sequence_bool_field([False, True, False]) - data.unbounded_sequence_enum_field([pytest.dds_type.RED, pytest.dds_type.BLUE, pytest.dds_type.MAGENTA]) - data.unbounded_sequence_enum2_field().push_back(pytest.dds_type.METAL) - data.unbounded_sequence_enum2_field().push_back(pytest.dds_type.STONE) - data.unbounded_sequence_enum2_field().push_back(pytest.dds_type.PLASTIC) + data.unbounded_sequence_enum_field([pytest.dds_type.Color_RED, pytest.dds_type.Color_BLUE, pytest.dds_type.Color_MAGENTA]) + data.unbounded_sequence_enum2_field().push_back(pytest.dds_type.Material_METAL) + data.unbounded_sequence_enum2_field().push_back(pytest.dds_type.Material_STONE) + data.unbounded_sequence_enum2_field().push_back(pytest.dds_type.Material_PLASTIC) data.unbounded_sequence_struct_field([struct_type1, struct_type2, struct_type3]) @@ -305,8 +305,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.double_field() == 1202.5) assert(data.bool_field() == True) assert(data.string_field() == "Test string") - assert(data.enum_field() == pytest.dds_type.MAGENTA) - assert(data.enum2_field() == pytest.dds_type.METAL) + assert(data.enum_field() == pytest.dds_type.Color_MAGENTA) + assert(data.enum2_field() == pytest.dds_type.Material_METAL) assert(data.struct_field().char_field() == '\x01') assert(data.struct_field().uint8_field() == 254) assert(data.struct_field().int16_field() == -10) @@ -319,8 +319,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.struct_field().double_field() == 1202.5) assert(data.struct_field().bool_field() == False) assert(data.struct_field().string_field() == "Test string") - assert(data.struct_field().enum_field() == pytest.dds_type.MAGENTA) - assert(data.struct_field().enum2_field() == pytest.dds_type.METAL) + assert(data.struct_field().enum_field() == pytest.dds_type.Color_MAGENTA) + assert(data.struct_field().enum2_field() == pytest.dds_type.Material_METAL) if cdr_version == 'v1': assert(data.char_opt_field() == '\x01') assert(data.uint8_opt_field() == 254) @@ -334,7 +334,7 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.double_opt_field() == 1202.5) assert(data.bool_opt_field() == True) assert(data.string_opt_field() == "Test string") - assert(data.enum_opt_field() == pytest.dds_type.MAGENTA) + assert(data.enum_opt_field() == pytest.dds_type.Color_MAGENTA) else: assert(data.char_opt_field().has_value()) assert(data.char_opt_field().get_value() == '\x01') @@ -361,7 +361,7 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.string_opt_field().has_value()) assert(data.string_opt_field().get_value() == "Test string") assert(data.enum_opt_field().has_value()) - assert(data.enum_opt_field().get_value() == pytest.dds_type.MAGENTA) + assert(data.enum_opt_field().get_value() == pytest.dds_type.Color_MAGENTA) assert(not data.enum2_opt_field().has_value()) assert(data.struct_opt_field().has_value()) assert(data.struct_opt_field().char_field() == '\x01') @@ -376,8 +376,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.struct_opt_field().double_field() == 1202.5) assert(data.struct_opt_field().bool_field() == True) assert(data.struct_opt_field().string_field() == "Test string") - assert(data.struct_opt_field().enum_field() == pytest.dds_type.MAGENTA) - assert(data.struct_opt_field().enum2_field() == pytest.dds_type.METAL) + assert(data.struct_opt_field().enum_field() == pytest.dds_type.Color_MAGENTA) + assert(data.struct_opt_field().enum2_field() == pytest.dds_type.Material_METAL) assert(data.array_char_field()[0] == '\x01') assert(data.array_char_field()[1] == '\x02') assert(data.array_char_field()[2] == '\x03') @@ -411,12 +411,12 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.array_bool_field()[0] == False) assert(data.array_bool_field()[1] == True) assert(data.array_bool_field()[2] == False) - assert(data.array_enum_field()[0] == pytest.dds_type.RED) - assert(data.array_enum_field()[1] == pytest.dds_type.BLUE) - assert(data.array_enum_field()[2] == pytest.dds_type.MAGENTA) - assert(data.array_enum2_field()[0] == pytest.dds_type.METAL) - assert(data.array_enum2_field()[1] == pytest.dds_type.STONE) - assert(data.array_enum2_field()[2] == pytest.dds_type.PLASTIC) + assert(data.array_enum_field()[0] == pytest.dds_type.Color_RED) + assert(data.array_enum_field()[1] == pytest.dds_type.Color_BLUE) + assert(data.array_enum_field()[2] == pytest.dds_type.Color_MAGENTA) + assert(data.array_enum2_field()[0] == pytest.dds_type.Material_METAL) + assert(data.array_enum2_field()[1] == pytest.dds_type.Material_STONE) + assert(data.array_enum2_field()[2] == pytest.dds_type.Material_PLASTIC) assert(data.array_struct_field()[0].char_field() == '\x01') assert(data.array_struct_field()[0].uint8_field() == 254) assert(data.array_struct_field()[0].int16_field() == -10) @@ -428,8 +428,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.array_struct_field()[0].float_field() == 1.0) assert(data.array_struct_field()[0].double_field() == 1200.5) assert(data.array_struct_field()[0].bool_field() == False) - assert(data.array_struct_field()[0].enum_field() == pytest.dds_type.RED) - assert(data.array_struct_field()[0].enum2_field() == pytest.dds_type.STONE) + assert(data.array_struct_field()[0].enum_field() == pytest.dds_type.Color_RED) + assert(data.array_struct_field()[0].enum2_field() == pytest.dds_type.Material_STONE) assert(data.array_struct_field()[1].char_field() == '\x02') assert(data.array_struct_field()[1].uint8_field() == 255) assert(data.array_struct_field()[1].int16_field() == 10) @@ -441,8 +441,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.array_struct_field()[1].float_field() == 2.0) assert(data.array_struct_field()[1].double_field() == 1202.5) assert(data.array_struct_field()[1].bool_field() == True) - assert(data.array_struct_field()[1].enum_field() == pytest.dds_type.BLUE) - assert(data.array_struct_field()[1].enum2_field() == pytest.dds_type.PLASTIC) + assert(data.array_struct_field()[1].enum_field() == pytest.dds_type.Color_BLUE) + assert(data.array_struct_field()[1].enum2_field() == pytest.dds_type.Material_PLASTIC) assert(data.array_struct_field()[2].char_field() == '\x03') assert(data.array_struct_field()[2].uint8_field() == 1) assert(data.array_struct_field()[2].int16_field() == -20) @@ -454,8 +454,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.array_struct_field()[2].float_field() == 3.0) assert(data.array_struct_field()[2].double_field() == 3.5) assert(data.array_struct_field()[2].bool_field() == False) - assert(data.array_struct_field()[2].enum_field() == pytest.dds_type.MAGENTA) - assert(data.array_struct_field()[2].enum2_field() == pytest.dds_type.METAL) + assert(data.array_struct_field()[2].enum_field() == pytest.dds_type.Color_MAGENTA) + assert(data.array_struct_field()[2].enum2_field() == pytest.dds_type.Material_METAL) assert(data.bounded_sequence_char_field().size() == 3) assert(data.bounded_sequence_char_field()[0] == '\x01') assert(data.bounded_sequence_char_field()[1] == '\x02') @@ -501,13 +501,13 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.bounded_sequence_bool_field()[1] == True) assert(data.bounded_sequence_bool_field()[2] == False) assert(data.bounded_sequence_enum_field().size() == 3) - assert(data.bounded_sequence_enum_field()[0] == pytest.dds_type.RED) - assert(data.bounded_sequence_enum_field()[1] == pytest.dds_type.BLUE) - assert(data.bounded_sequence_enum_field()[2] == pytest.dds_type.MAGENTA) + assert(data.bounded_sequence_enum_field()[0] == pytest.dds_type.Color_RED) + assert(data.bounded_sequence_enum_field()[1] == pytest.dds_type.Color_BLUE) + assert(data.bounded_sequence_enum_field()[2] == pytest.dds_type.Color_MAGENTA) assert(data.bounded_sequence_enum2_field().size() == 3) - assert(data.bounded_sequence_enum2_field()[0] == pytest.dds_type.METAL) - assert(data.bounded_sequence_enum2_field()[1] == pytest.dds_type.STONE) - assert(data.bounded_sequence_enum2_field()[2] == pytest.dds_type.PLASTIC) + assert(data.bounded_sequence_enum2_field()[0] == pytest.dds_type.Material_METAL) + assert(data.bounded_sequence_enum2_field()[1] == pytest.dds_type.Material_STONE) + assert(data.bounded_sequence_enum2_field()[2] == pytest.dds_type.Material_PLASTIC) assert(data.bounded_sequence_struct_field().size() == 3) assert(data.bounded_sequence_struct_field()[0].char_field() == '\x01') assert(data.bounded_sequence_struct_field()[0].uint8_field() == 254) @@ -520,8 +520,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.bounded_sequence_struct_field()[0].float_field() == 1.0) assert(data.bounded_sequence_struct_field()[0].double_field() == 1200.5) assert(data.bounded_sequence_struct_field()[0].bool_field() == False) - assert(data.bounded_sequence_struct_field()[0].enum_field() == pytest.dds_type.RED) - assert(data.bounded_sequence_struct_field()[0].enum2_field() == pytest.dds_type.STONE) + assert(data.bounded_sequence_struct_field()[0].enum_field() == pytest.dds_type.Color_RED) + assert(data.bounded_sequence_struct_field()[0].enum2_field() == pytest.dds_type.Material_STONE) assert(data.bounded_sequence_struct_field()[1].char_field() == '\x02') assert(data.bounded_sequence_struct_field()[1].uint8_field() == 255) assert(data.bounded_sequence_struct_field()[1].int16_field() == 10) @@ -533,8 +533,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.bounded_sequence_struct_field()[1].float_field() == 2.0) assert(data.bounded_sequence_struct_field()[1].double_field() == 1202.5) assert(data.bounded_sequence_struct_field()[1].bool_field() == True) - assert(data.bounded_sequence_struct_field()[1].enum_field() == pytest.dds_type.BLUE) - assert(data.bounded_sequence_struct_field()[1].enum2_field() == pytest.dds_type.PLASTIC) + assert(data.bounded_sequence_struct_field()[1].enum_field() == pytest.dds_type.Color_BLUE) + assert(data.bounded_sequence_struct_field()[1].enum2_field() == pytest.dds_type.Material_PLASTIC) assert(data.bounded_sequence_struct_field()[2].char_field() == '\x03') assert(data.bounded_sequence_struct_field()[2].uint8_field() == 1) assert(data.bounded_sequence_struct_field()[2].int16_field() == -20) @@ -546,8 +546,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.bounded_sequence_struct_field()[2].float_field() == 3.0) assert(data.bounded_sequence_struct_field()[2].double_field() == 3.5) assert(data.bounded_sequence_struct_field()[2].bool_field() == False) - assert(data.bounded_sequence_struct_field()[2].enum_field() == pytest.dds_type.MAGENTA) - assert(data.bounded_sequence_struct_field()[2].enum2_field() == pytest.dds_type.METAL) + assert(data.bounded_sequence_struct_field()[2].enum_field() == pytest.dds_type.Color_MAGENTA) + assert(data.bounded_sequence_struct_field()[2].enum2_field() == pytest.dds_type.Material_METAL) assert(data.unbounded_sequence_char_field().size() == 3) assert(data.unbounded_sequence_char_field()[0] == '\x01') assert(data.unbounded_sequence_char_field()[1] == '\x02') @@ -593,13 +593,13 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.unbounded_sequence_bool_field()[1] == True) assert(data.unbounded_sequence_bool_field()[2] == False) assert(data.unbounded_sequence_enum_field().size() == 3) - assert(data.unbounded_sequence_enum_field()[0] == pytest.dds_type.RED) - assert(data.unbounded_sequence_enum_field()[1] == pytest.dds_type.BLUE) - assert(data.unbounded_sequence_enum_field()[2] == pytest.dds_type.MAGENTA) + assert(data.unbounded_sequence_enum_field()[0] == pytest.dds_type.Color_RED) + assert(data.unbounded_sequence_enum_field()[1] == pytest.dds_type.Color_BLUE) + assert(data.unbounded_sequence_enum_field()[2] == pytest.dds_type.Color_MAGENTA) assert(data.unbounded_sequence_enum2_field().size() == 3) - assert(data.unbounded_sequence_enum2_field()[0] == pytest.dds_type.METAL) - assert(data.unbounded_sequence_enum2_field()[1] == pytest.dds_type.STONE) - assert(data.unbounded_sequence_enum2_field()[2] == pytest.dds_type.PLASTIC) + assert(data.unbounded_sequence_enum2_field()[0] == pytest.dds_type.Material_METAL) + assert(data.unbounded_sequence_enum2_field()[1] == pytest.dds_type.Material_STONE) + assert(data.unbounded_sequence_enum2_field()[2] == pytest.dds_type.Material_PLASTIC) assert(data.unbounded_sequence_struct_field().size() == 3) assert(data.unbounded_sequence_struct_field()[0].char_field() == '\x01') assert(data.unbounded_sequence_struct_field()[0].uint8_field() == 254) @@ -612,8 +612,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.unbounded_sequence_struct_field()[0].float_field() == 1.0) assert(data.unbounded_sequence_struct_field()[0].double_field() == 1200.5) assert(data.unbounded_sequence_struct_field()[0].bool_field() == False) - assert(data.unbounded_sequence_struct_field()[0].enum_field() == pytest.dds_type.RED) - assert(data.unbounded_sequence_struct_field()[0].enum2_field() == pytest.dds_type.STONE) + assert(data.unbounded_sequence_struct_field()[0].enum_field() == pytest.dds_type.Color_RED) + assert(data.unbounded_sequence_struct_field()[0].enum2_field() == pytest.dds_type.Material_STONE) assert(data.unbounded_sequence_struct_field()[1].char_field() == '\x02') assert(data.unbounded_sequence_struct_field()[1].uint8_field() == 255) assert(data.unbounded_sequence_struct_field()[1].int16_field() == 10) @@ -625,8 +625,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.unbounded_sequence_struct_field()[1].float_field() == 2.0) assert(data.unbounded_sequence_struct_field()[1].double_field() == 1202.5) assert(data.unbounded_sequence_struct_field()[1].bool_field() == True) - assert(data.unbounded_sequence_struct_field()[1].enum_field() == pytest.dds_type.BLUE) - assert(data.unbounded_sequence_struct_field()[1].enum2_field() == pytest.dds_type.PLASTIC) + assert(data.unbounded_sequence_struct_field()[1].enum_field() == pytest.dds_type.Color_BLUE) + assert(data.unbounded_sequence_struct_field()[1].enum2_field() == pytest.dds_type.Material_PLASTIC) assert(data.unbounded_sequence_struct_field()[2].char_field() == '\x03') assert(data.unbounded_sequence_struct_field()[2].uint8_field() == 1) assert(data.unbounded_sequence_struct_field()[2].int16_field() == -20) @@ -638,8 +638,8 @@ def check_keyed_complete_test_type(data, cdr_version): assert(data.unbounded_sequence_struct_field()[2].float_field() == 3.0) assert(data.unbounded_sequence_struct_field()[2].double_field() == 3.5) assert(data.unbounded_sequence_struct_field()[2].bool_field() == False) - assert(data.unbounded_sequence_struct_field()[2].enum_field() == pytest.dds_type.MAGENTA) - assert(data.unbounded_sequence_struct_field()[2].enum2_field() == pytest.dds_type.METAL) + assert(data.unbounded_sequence_struct_field()[2].enum_field() == pytest.dds_type.Color_MAGENTA) + assert(data.unbounded_sequence_struct_field()[2].enum2_field() == pytest.dds_type.Material_METAL) def test_create_querycondition(datareader): @@ -656,7 +656,7 @@ def test_create_querycondition(datareader): querycondition = datareader.create_querycondition( sv, vv, iv, "", qp) assert(querycondition is None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.delete_contained_entities()) @@ -673,7 +673,7 @@ def test_create_readcondition(datareader): readcondition = datareader.create_readcondition( sv, vv, iv) assert(readcondition is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.delete_readcondition(readcondition)) @@ -684,7 +684,7 @@ def test_get_first_untaken(transient_datareader_qos, datareader, - DataReader::get_first_untaken_info """ info = fastdds.SampleInfo() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.get_first_untaken_info(info)) qos = datareader.get_qos() assert(fastdds.TRANSIENT_LOCAL_DURABILITY_QOS == qos.durability().kind) @@ -697,7 +697,7 @@ def test_get_first_untaken(transient_datareader_qos, datareader, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_first_untaken_info(info)) assert(info.valid_data) @@ -728,7 +728,7 @@ def test_get_key_value(test_keyed_type, datareader): sample = pytest.dds_type.KeyedCompleteTestType() sample.id(255) ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == datareader.get_key_value(sample, ih)) assert(fastdds.c_InstanceHandle_Unknown == ih) @@ -745,7 +745,7 @@ def test_get_set_listener(datareader): # Overload 1 listener = DataReaderListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.set_listener(listener)) assert(datareader.get_listener() == listener) assert(fastdds.StatusMask.all() == @@ -757,13 +757,13 @@ def test(status_mask_1, status_mask_2): """ listener = DataReaderListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.set_listener(listener, status_mask_2)) assert(datareader.get_listener() == listener) assert(status_mask_2 == datareader.get_status_mask()) @@ -835,7 +835,7 @@ def test_get_listening_locators(datareader): - DataReader::get_listening_locators """ locator_list = fastdds.LocatorList() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_listening_locators(locator_list)) assert(0 < locator_list.size()) @@ -846,7 +846,7 @@ def test_get_liveliness_changed_status(datareader): - DataReader::get_liveliness_changed_status """ status = fastdds.LivelinessChangedStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_liveliness_changed_status(status)) assert(0 == status.alive_count) assert(0 == status.alive_count_change) @@ -862,7 +862,7 @@ def test_get_matched_publication_data(datareader): """ pub_data = fastdds.PublicationBuiltinTopicData() ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == datareader.get_matched_publication_data(pub_data, ih)) @@ -872,7 +872,7 @@ def test_get_matched_publications(datareader): - DataReader::get_matched_publications """ ihs = fastdds.InstanceHandleVector() - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == datareader.get_matched_publications(ihs)) @@ -882,7 +882,7 @@ def test_get_requested_deadline_missed_status(datareader): - DataReader::get_requested_deadline_missed_status """ status = fastdds.RequestedDeadlineMissedStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_requested_deadline_missed_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -895,7 +895,7 @@ def test_get_requested_incompatible_qos_status(datareader): - DataReader::get_requested_deadline_missed_status """ status = fastdds.RequestedIncompatibleQosStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_requested_incompatible_qos_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -914,7 +914,7 @@ def test_get_sample_lost_status(datareader): - DataReader::get_sample_lost_status """ status = fastdds.SampleLostStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_sample_lost_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -926,7 +926,7 @@ def test_get_sample_rejected_status(datareader): - DataReader::get_sample_rejected_status """ status = fastdds.SampleRejectedStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_sample_rejected_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -938,7 +938,7 @@ def test_get_subscription_matched_status(datareader): - DataReader::get_subscription_matched_status """ status = fastdds.SubscriptionMatchedStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.get_subscription_matched_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -997,7 +997,7 @@ def test_is_sample_valid(transient_datareader_qos, datareader, fastdds.Duration_t(5, 0))) data = pytest.dds_type.CompleteTestType() info = fastdds.SampleInfo() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.read_next_sample(data, info)) assert(datareader.is_sample_valid(data, info)) assert(sample.int16_field() == data.int16_field()) @@ -1023,7 +1023,7 @@ def test_lookup_instance(transient_datareader_qos, test_keyed_type, datareader, # Test when instance is registered writer_ih = datawriter.register_instance(sample) assert(fastdds.c_InstanceHandle_Unknown != writer_ih) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.write(sample, writer_ih)) assert(datareader.wait_for_unread_message( @@ -1041,7 +1041,7 @@ def test_read(transient_datareader_qos, datareader, """ data_seq = pytest.dds_type.CompleteTestTypeSeq() info_seq = fastdds.SampleInfoSeq() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.read( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1055,7 +1055,7 @@ def test_read(transient_datareader_qos, datareader, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == datareader.read( + assert(fastdds.RETCODE_OK == datareader.read( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, fastdds.ANY_INSTANCE_STATE)) @@ -1066,7 +1066,7 @@ def test_read(transient_datareader_qos, datareader, assert(0 < info_seq[0].reception_timestamp.to_ns()) assert(sample == data_seq[0]) check_keyed_complete_test_type(data_seq[0], cdr_version) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.return_loan(data_seq, info_seq)) @@ -1080,7 +1080,7 @@ def test_read_instance(transient_datareader_qos, test_keyed_type, data_seq = pytest.dds_type.KeyedCompleteTestTypeSeq() info_seq = fastdds.SampleInfoSeq() ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_BAD_PARAMETER == + assert(fastdds.RETCODE_BAD_PARAMETER == datareader.read_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1091,11 +1091,11 @@ def test_read_instance(transient_datareader_qos, test_keyed_type, sample = pytest.dds_type.KeyedCompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) ih = datawriter.register_instance(sample) - assert(datawriter.write(sample, ih)) + assert(fastdds.RETCODE_OK == datawriter.write(sample, ih)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.read_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1107,7 +1107,7 @@ def test_read_instance(transient_datareader_qos, test_keyed_type, assert(0 < info_seq[0].reception_timestamp.to_ns()) assert(sample == data_seq[0]) check_keyed_complete_test_type(data_seq[0], cdr_version) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.return_loan(data_seq, info_seq)) @@ -1121,7 +1121,7 @@ def test_read_next_instance(transient_datareader_qos, test_keyed_type, data_seq = pytest.dds_type.KeyedCompleteTestTypeSeq() info_seq = fastdds.SampleInfoSeq() ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.read_next_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1135,7 +1135,7 @@ def test_read_next_instance(transient_datareader_qos, test_keyed_type, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.read_next_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1147,7 +1147,7 @@ def test_read_next_instance(transient_datareader_qos, test_keyed_type, assert(0 < info_seq[0].reception_timestamp.to_ns()) assert(sample == data_seq[0]) check_keyed_complete_test_type(data_seq[0], cdr_version) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.return_loan(data_seq, info_seq)) @@ -1159,7 +1159,7 @@ def test_read_next_sample(transient_datareader_qos, datareader, """ data = pytest.dds_type.CompleteTestType() info = fastdds.SampleInfo() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.read_next_sample( data, info)) @@ -1169,7 +1169,7 @@ def test_read_next_sample(transient_datareader_qos, datareader, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.read_next_sample(data, info)) assert(info.valid_data) assert(0 < info.source_timestamp.to_ns()) @@ -1187,7 +1187,7 @@ def test_take(transient_datareader_qos, datareader, """ data_seq = pytest.dds_type.CompleteTestTypeSeq() info_seq = fastdds.SampleInfoSeq() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.take( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1201,7 +1201,7 @@ def test_take(transient_datareader_qos, datareader, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == datareader.take( + assert(fastdds.RETCODE_OK == datareader.take( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, fastdds.ANY_INSTANCE_STATE)) @@ -1212,7 +1212,7 @@ def test_take(transient_datareader_qos, datareader, assert(0 < info_seq[0].reception_timestamp.to_ns()) assert(sample == data_seq[0]) check_keyed_complete_test_type(data_seq[0], cdr_version) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.return_loan(data_seq, info_seq)) @@ -1226,7 +1226,7 @@ def test_take_instance(transient_datareader_qos, test_keyed_type, data_seq = pytest.dds_type.KeyedCompleteTestTypeSeq() info_seq = fastdds.SampleInfoSeq() ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_BAD_PARAMETER == + assert(fastdds.RETCODE_BAD_PARAMETER == datareader.take_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1237,11 +1237,11 @@ def test_take_instance(transient_datareader_qos, test_keyed_type, sample = pytest.dds_type.KeyedCompleteTestType() fill_keyed_complete_test_type(sample, cdr_version) ih = datawriter.register_instance(sample) - assert(datawriter.write(sample, ih)) + assert(fastdds.RETCODE_OK == datawriter.write(sample, ih)) assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.take_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1253,7 +1253,7 @@ def test_take_instance(transient_datareader_qos, test_keyed_type, assert(0 < info_seq[0].reception_timestamp.to_ns()) assert(sample == data_seq[0]) check_keyed_complete_test_type(data_seq[0], cdr_version) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.return_loan(data_seq, info_seq)) @@ -1267,7 +1267,7 @@ def test_take_next_instance(transient_datareader_qos, test_keyed_type, data_seq = pytest.dds_type.KeyedCompleteTestTypeSeq() info_seq = fastdds.SampleInfoSeq() ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.take_next_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1281,7 +1281,7 @@ def test_take_next_instance(transient_datareader_qos, test_keyed_type, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.take_next_instance( data_seq, info_seq, fastdds.LENGTH_UNLIMITED, ih, fastdds.ANY_SAMPLE_STATE, fastdds.ANY_VIEW_STATE, @@ -1293,7 +1293,7 @@ def test_take_next_instance(transient_datareader_qos, test_keyed_type, assert(0 < info_seq[0].reception_timestamp.to_ns()) assert(sample == data_seq[0]) check_keyed_complete_test_type(data_seq[0], cdr_version) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.return_loan(data_seq, info_seq)) @@ -1305,7 +1305,7 @@ def test_take_next_sample(transient_datareader_qos, datareader, """ data = pytest.dds_type.CompleteTestType() info = fastdds.SampleInfo() - assert(fastdds.ReturnCode_t.RETCODE_NO_DATA == + assert(fastdds.RETCODE_NO_DATA == datareader.take_next_sample( data, info)) @@ -1315,7 +1315,7 @@ def test_take_next_sample(transient_datareader_qos, datareader, assert(datareader.wait_for_unread_message( fastdds.Duration_t(5, 0))) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.take_next_sample(data, info)) assert(info.valid_data) assert(0 < info.source_timestamp.to_ns()) @@ -1339,7 +1339,7 @@ def test_wait_for_historical_data(datareader): This test checks: - DataReader::wait_for_historical_data """ - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == datareader.wait_for_historical_data( fastdds.Duration_t(0, 100))) @@ -1365,19 +1365,19 @@ def create_datareader(): writer_topic, fastdds.DATAWRITER_QOS_DEFAULT) time.sleep(1) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_topic(writer_topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_publisher(publisher)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(writer_participant)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) diff --git a/fastdds_python/test/api/test_datawriter.py b/fastdds_python/test/api/test_datawriter.py index 457eddc7..1e73dd82 100644 --- a/fastdds_python/test/api/test_datawriter.py +++ b/fastdds_python/test/api/test_datawriter.py @@ -72,14 +72,14 @@ def datawriter(participant, topic, publisher, datawriter_qos): yield datawriter - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -107,7 +107,7 @@ def test_assert_liveliness(manual_liveliness_datawriter_qos, datawriter): This test checks: - DataWriter::assert_liveliness """ - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.assert_liveliness()) @@ -119,7 +119,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.ReturnCode_t.RETCODE_OK, 1] == + assert([fastdds.RETCODE_OK, 1] == datawriter.clear_history()) @@ -140,9 +140,9 @@ def test_dispose(test_keyed_type, datawriter): ih2 = datawriter.register_instance(sample2) assert(fastdds.c_InstanceHandle_Unknown != ih2) assert(ih2 != ih) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.dispose(sample, ih)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.dispose(sample2, ih2)) # Overload 2 @@ -153,7 +153,7 @@ def test_dispose(test_keyed_type, datawriter): timestamp.seconds = now.second ih = datawriter.register_instance_w_timestamp(sample, timestamp) assert(fastdds.c_InstanceHandle_Unknown != ih) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.dispose_w_timestamp(sample, ih, timestamp)) @@ -188,39 +188,39 @@ def test_get_key_value(test_keyed_type, datawriter): # Check wrong handle test_sample = pytest.dds_type.KeyedCompleteTestType() - assert(fastdds.ReturnCode_t.RETCODE_BAD_PARAMETER == + assert(fastdds.RETCODE_BAD_PARAMETER == datawriter.get_key_value(test_sample, fastdds.c_InstanceHandle_Unknown)) # Check wrong sample - assert(fastdds.ReturnCode_t.RETCODE_BAD_PARAMETER == + assert(fastdds.RETCODE_BAD_PARAMETER == datawriter.get_key_value(None, ih)) # Check correct case test_sample = pytest.dds_type.KeyedCompleteTestType() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_key_value(test_sample, ih)) assert(test_sample.id() == sample.id()); # Calling get_key_value on an unregistered instance should fail test_sample = pytest.dds_type.KeyedCompleteTestType() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.unregister_instance(sample, ih)) - assert(fastdds.ReturnCode_t.RETCODE_BAD_PARAMETER == + assert(fastdds.RETCODE_BAD_PARAMETER == datawriter.get_key_value(test_sample, ih)) # Calling get_key_value with a valid instance should work test_sample = pytest.dds_type.KeyedCompleteTestType() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.write(sample, fastdds.c_InstanceHandle_Unknown)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_key_value(test_sample, ih)) assert(test_sample.id() == sample.id()); # Calling get_key_value on a disposed instance should work test_sample = pytest.dds_type.KeyedCompleteTestType() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.dispose(sample, ih)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_key_value(test_sample, ih)) assert(test_sample.id() == sample.id()); @@ -231,7 +231,7 @@ def test_get_sending_locators(datawriter): - DataWriter::get_sending_locators """ locator_list = fastdds.LocatorList() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_sending_locators(locator_list)) assert(0 < locator_list.size()) @@ -248,7 +248,7 @@ def test_get_set_listener(datawriter): # Overload 1 listener = DataWriterListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.set_listener(listener)) assert(datawriter.get_listener() == listener) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) @@ -259,13 +259,13 @@ def test(status_mask_1, status_mask_2): """ listener = DataWriterListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.set_listener(listener, status_mask_2)) assert(datawriter.get_listener() == listener) assert(status_mask_2 == datawriter.get_status_mask()) @@ -337,7 +337,7 @@ def test_get_liveliness_lost_status(datawriter): - DataWriter::get_liveliness_lost_status """ status = fastdds.LivelinessLostStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_liveliness_lost_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -350,7 +350,7 @@ def test_get_matched_subscription_data(datawriter): """ sub_data = fastdds.SubscriptionBuiltinTopicData() ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == datawriter.get_matched_subscription_data(sub_data, ih)) @@ -360,7 +360,7 @@ def test_get_matched_subscriptions(datawriter): - DataWriter::get_matched_subscriptions """ ihs = fastdds.InstanceHandleVector() - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == datawriter.get_matched_subscriptions(ihs)) @@ -370,7 +370,7 @@ def test_get_offered_deadline_missed_status(datawriter): - DataWriter::get_offered_deadline_missed_status """ status = fastdds.OfferedDeadlineMissedStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_offered_deadline_missed_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -383,7 +383,7 @@ def test_get_offered_incompatible_qos_status(datawriter): - DataWriter::get_offered_deadline_missed_status """ status = fastdds.OfferedIncompatibleQosStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_offered_incompatible_qos_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -402,7 +402,7 @@ def test_get_publication_matched_status(datawriter): - DataWriter::get_publication_matched_status """ status = fastdds.PublicationMatchedStatus() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.get_publication_matched_status(status)) assert(0 == status.total_count) assert(0 == status.total_count_change) @@ -469,11 +469,11 @@ def test_register_instance(test_keyed_type, datawriter): ih2 = datawriter.register_instance(sample2) assert(fastdds.c_InstanceHandle_Unknown != ih2) assert(ih2 != ih) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.unregister_instance(sample, ih)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.unregister_instance(sample2, ih2)) - assert(fastdds.ReturnCode_t.RETCODE_PRECONDITION_NOT_MET == + assert(fastdds.RETCODE_PRECONDITION_NOT_MET == datawriter.unregister_instance( sample, fastdds.c_InstanceHandle_Unknown)) @@ -485,7 +485,7 @@ def test_register_instance(test_keyed_type, datawriter): timestamp.seconds = now.second ih = datawriter.register_instance_w_timestamp(sample, timestamp) assert(fastdds.c_InstanceHandle_Unknown != ih) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.unregister_instance_w_timestamp(sample, ih, timestamp)) @@ -498,13 +498,13 @@ def test_wait_for_acknowledgments(test_keyed_type, datawriter): sample = pytest.dds_type.KeyedCompleteTestType() sample.id(3) assert(datawriter.write(sample)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.wait_for_acknowledgments(fastdds.Duration_t(1, 0))) # Overload 2 ih = datawriter.register_instance(sample) assert(fastdds.c_InstanceHandle_Unknown != ih) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.wait_for_acknowledgments( sample, ih, fastdds.Duration_t(1, 0))) @@ -536,11 +536,11 @@ def test_write(test_keyed_type, datawriter): sample = pytest.dds_type.KeyedCompleteTestType() sample.id(1) ih = fastdds.InstanceHandle_t() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.write(sample, ih)) ih = fastdds.InstanceHandle_t() ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) - assert(fastdds.ReturnCode_t.RETCODE_PRECONDITION_NOT_MET == + assert(fastdds.RETCODE_PRECONDITION_NOT_MET == datawriter.write(sample, ih)) # Overload 4 @@ -550,7 +550,7 @@ def test_write(test_keyed_type, datawriter): now = datetime.datetime.now().time() timestamp = fastdds.Time_t() timestamp.seconds = now.second - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datawriter.write_w_timestamp(sample, ih, timestamp)) def test_listener_ownership(participant, reader_participant, topic, @@ -566,19 +566,19 @@ def create_datawriter(): reader_topic, fastdds.DATAREADER_QOS_DEFAULT) time.sleep(1) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == reader_participant.delete_topic(reader_topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == reader_participant.delete_subscriber(subscriber)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(reader_participant)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) diff --git a/fastdds_python/test/api/test_domainparticipant.py b/fastdds_python/test/api/test_domainparticipant.py index 1d8ea006..7e7fa9d8 100644 --- a/fastdds_python/test/api/test_domainparticipant.py +++ b/fastdds_python/test/api/test_domainparticipant.py @@ -58,7 +58,7 @@ def participant(participant_qos): yield participant - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -74,7 +74,7 @@ def test_contains_entity(participant): assert(participant.contains_entity(fastdds.InstanceHandle_t()) is False) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) @@ -95,7 +95,7 @@ def test_create_publisher(participant): assert(publisher is not None) assert(publisher.is_enabled()) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) # Overload 2 @@ -104,7 +104,7 @@ def test_create_publisher(participant): assert(publisher is not None) assert(publisher.is_enabled()) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) def test(status_mask_1, status_mask_2, listnr=None): @@ -116,14 +116,14 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(publisher is not None) assert(publisher.is_enabled()) assert(status_mask_1 == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) # Overload 3: Different status masks @@ -213,7 +213,7 @@ def test_create_publisher_with_profile(participant): qos = publisher.get_qos() assert('partition_name_c' == qos.partition()[0]) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) # Overload 2 @@ -224,7 +224,7 @@ def test_create_publisher_with_profile(participant): qos = publisher.get_qos() assert('partition_name_c' == qos.partition()[0]) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) def test(status_mask_1, status_mask_2, listnr=None): @@ -238,7 +238,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = publisher.get_qos() assert('partition_name_c' == qos.partition()[0]) assert(status_mask_1 == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) publisher = participant.create_publisher_with_profile( 'test_publisher_profile', listnr, status_mask_2) @@ -247,7 +247,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = publisher.get_qos() assert('partition_name_c' == qos.partition()[0]) assert(status_mask_2 == publisher.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) # Overload 3: Different status masks @@ -329,7 +329,7 @@ def test_create_subscriber(participant): assert(subscriber is not None) assert(subscriber.is_enabled()) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) # Overload 2 @@ -338,7 +338,7 @@ def test_create_subscriber(participant): assert(subscriber is not None) assert(subscriber.is_enabled()) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) def test(status_mask_1, status_mask_2, listnr=None): @@ -350,14 +350,14 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(subscriber is not None) assert(subscriber.is_enabled()) assert(status_mask_1 == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) # Overload 3: Different status masks @@ -447,7 +447,7 @@ def test_create_subscriber_with_profile(participant): qos = subscriber.get_qos() assert('partition_name_b' == qos.partition()[0]) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) # Overload 2 @@ -458,7 +458,7 @@ def test_create_subscriber_with_profile(participant): qos = subscriber.get_qos() assert('partition_name_b' == qos.partition()[0]) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) def test(status_mask_1, status_mask_2, listnr=None): @@ -472,7 +472,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = subscriber.get_qos() assert('partition_name_b' == qos.partition()[0]) assert(status_mask_1 == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) subscriber = participant.create_subscriber_with_profile( 'test_subscriber_profile', listnr, status_mask_2) @@ -481,7 +481,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = subscriber.get_qos() assert('partition_name_b' == qos.partition()[0]) assert(status_mask_2 == subscriber.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) # Overload 3: Different status masks @@ -567,7 +567,7 @@ def test_create_and_delete_topic(participant): assert(topic is None) # Now register the type - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.register_type(test_type, test_type.get_type_name())) # Overload 1 - Success @@ -576,7 +576,7 @@ def test_create_and_delete_topic(participant): assert(topic is not None) assert(topic.is_enabled()) assert(fastdds.StatusMask.all() == topic.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) # Overload 2 @@ -586,7 +586,7 @@ def test_create_and_delete_topic(participant): assert(topic is not None) assert(topic.is_enabled()) assert(fastdds.StatusMask.all() == topic.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) def test(status_mask_1, status_mask_2, listnr=None): @@ -599,7 +599,7 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(topic is not None) assert(topic.is_enabled()) assert(status_mask_1 == topic.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) topic = participant.create_topic( "Complete", test_type.get_type_name(), @@ -607,7 +607,7 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(topic is not None) assert(topic.is_enabled()) assert(status_mask_2 == topic.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) # Overload 3: Different status masks @@ -680,7 +680,7 @@ def test_delete_contained_entities(participant): fastdds.SUBSCRIBER_QOS_DEFAULT) assert(subscriber is not None) test_type = fastdds.TypeSupport(pytest.dds_type.CompleteTestTypePubSubType()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.register_type(test_type, test_type.get_type_name())) topic = participant.create_topic( "Complete", test_type.get_type_name(), fastdds.TOPIC_QOS_DEFAULT) @@ -688,10 +688,10 @@ def test_delete_contained_entities(participant): # Cannot delete participant without deleting its contained entities factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_PRECONDITION_NOT_MET == + assert(fastdds.RETCODE_PRECONDITION_NOT_MET == factory.delete_participant(participant)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_contained_entities()) @@ -702,12 +702,12 @@ def test_enable(not_autoenable_factory, participant): - DomainParticipant::is_enabled """ assert(not participant.is_enabled()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.enable()) assert(participant.is_enabled()) factory_qos = fastdds.DomainParticipantFactoryQos() factory_qos.entity_factory().autoenable_created_entities = True - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == not_autoenable_factory.set_qos(factory_qos)) @@ -717,7 +717,7 @@ def test_find_topic(participant): - DomainParticipant::find_topic """ test_type = fastdds.TypeSupport(pytest.dds_type.CompleteTestTypePubSubType()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.register_type(test_type, test_type.get_type_name())) topic = participant.create_topic( @@ -727,10 +727,10 @@ def test_find_topic(participant): topic_copy = participant.find_topic("Complete", fastdds.Duration_t(1, 0)) assert(topic.get_type_name() == topic_copy.get_type_name()) assert(topic.get_name() == topic_copy.get_name()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic_copy)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) @@ -756,10 +756,10 @@ def test_get_discovered_participants(participant): assert(participant2 is not None) ihs = fastdds.InstanceHandleVector() - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == participant.get_discovered_participants(ihs)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant2)) @@ -776,7 +776,7 @@ def test_get_domain_id(): assert(32 == participant.get_domain_id()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -816,7 +816,7 @@ def test_get_set_listener(participant): # Overload 1 listener = DomainParticipantListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.set_listener(listener)) assert(participant.get_listener() == listener) assert(fastdds.StatusMask.all() == participant.get_status_mask()) @@ -827,13 +827,13 @@ def test(status_mask_1, status_mask_2): """ listener = DomainParticipantListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.set_listener(listener, status_mask_2)) assert(participant.get_listener() == listener) assert(status_mask_2 == participant.get_status_mask()) @@ -915,16 +915,16 @@ def test_get_set_qos(participant): - DomainParticipant::set_qos """ qos = fastdds.DomainParticipantQos() - assert(fastdds.ReturnCode_t.RETCODE_OK == participant.get_qos(qos)) + assert(fastdds.RETCODE_OK == participant.get_qos(qos)) qos.user_data().push_back(1) qos.user_data().push_back(2) assert(2 == len(qos.user_data())) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.set_qos(qos)) qos2 = fastdds.DomainParticipantQos() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.get_qos(qos2)) assert(2 == len(qos2.user_data())) assert(1 == qos2.user_data()[0]) @@ -938,7 +938,7 @@ def test_ignore_participant(participant): """ ih = fastdds.InstanceHandle_t() ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.ignore_participant(ih)) def test_ignore_publication(participant): @@ -948,7 +948,7 @@ def test_ignore_publication(participant): """ ih = fastdds.InstanceHandle_t() ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == participant.ignore_publication(ih)) @@ -959,7 +959,7 @@ def test_ignore_subscription(participant): """ ih = fastdds.InstanceHandle_t() ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == participant.ignore_subscription(ih)) @@ -970,7 +970,7 @@ def test_ignore_topic(participant): """ ih = fastdds.InstanceHandle_t() ih.value = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == participant.ignore_topic(ih)) @@ -980,7 +980,7 @@ def test_lookup_topicdescription(participant): - DomainParticipant::lookup_topicdescription """ test_type = fastdds.TypeSupport(pytest.dds_type.CompleteTestTypePubSubType()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.register_type(test_type, test_type.get_type_name())) topic = participant.create_topic( @@ -992,7 +992,7 @@ def test_lookup_topicdescription(participant): assert(topic.get_type_name() == topic_desc.get_type_name()) assert(topic.get_name() == topic_desc.get_name()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) @@ -1008,7 +1008,7 @@ def second_participant(): participant = factory.create_participant( 0, fastdds.PARTICIPANT_QOS_DEFAULT) time.sleep(1) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant2)) diff --git a/fastdds_python/test/api/test_domainparticipantfactory.py b/fastdds_python/test/api/test_domainparticipantfactory.py index 2ae066eb..501fdbed 100644 --- a/fastdds_python/test/api/test_domainparticipantfactory.py +++ b/fastdds_python/test/api/test_domainparticipantfactory.py @@ -18,7 +18,7 @@ def test_create_participant(): assert(participant.is_enabled()) assert(fastdds.StatusMask.all() == participant.get_status_mask()) assert(participant is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) # Overload 2 @@ -28,7 +28,7 @@ def test_create_participant(): assert(participant is not None) assert(participant.is_enabled()) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) def test(status_mask_1, status_mask_2, listnr=None): @@ -40,14 +40,14 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(participant is not None) assert(participant.is_enabled()) assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) # Overload 3: Different status masks @@ -140,7 +140,7 @@ def test_create_participant_with_profile(): qos = participant.get_qos() assert('test_name' == qos.name()) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) participant = factory.create_participant_with_profile( 0, 'test_participant_profile') @@ -150,7 +150,7 @@ def test_create_participant_with_profile(): qos = participant.get_qos() assert('test_name' == qos.name()) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) # Overload 2 @@ -163,7 +163,7 @@ def test_create_participant_with_profile(): qos = participant.get_qos() assert('test_name' == qos.name()) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) participant = factory.create_participant_with_profile( 0, 'test_participant_profile', listener) @@ -173,7 +173,7 @@ def test_create_participant_with_profile(): qos = participant.get_qos() assert('test_name' == qos.name()) assert(fastdds.StatusMask.all() == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) def test(status_mask_1, status_mask_2, listnr=None): @@ -188,7 +188,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = participant.get_qos() assert('test_name' == qos.name()) assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) participant = factory.create_participant_with_profile( 0, 'test_participant_profile', listnr, status_mask_1) @@ -198,7 +198,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = participant.get_qos() assert('test_name' == qos.name()) assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) participant = factory.create_participant_with_profile( 'test_participant_profile', listnr, status_mask_2) @@ -208,7 +208,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = participant.get_qos() assert('test_name' == qos.name()) assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) participant = factory.create_participant_with_profile( 0, 'test_participant_profile', listnr, status_mask_2) @@ -218,7 +218,7 @@ def test(status_mask_1, status_mask_2, listnr=None): qos = participant.get_qos() assert('test_name' == qos.name()) assert(status_mask_1 == participant.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) # Overload 3: Different status masks diff --git a/fastdds_python/test/api/test_publisher.py b/fastdds_python/test/api/test_publisher.py index 69f01f48..e87b4d05 100644 --- a/fastdds_python/test/api/test_publisher.py +++ b/fastdds_python/test/api/test_publisher.py @@ -43,12 +43,12 @@ def publisher(participant, topic): yield publisher - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -88,9 +88,9 @@ def test_coherent_changes(publisher): - Publisher::begin_coherent_changes - Publisher::end_coherent_changes """ - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == publisher.begin_coherent_changes()) - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == publisher.end_coherent_changes()) @@ -112,7 +112,7 @@ def test_create_datawriter(topic, publisher): assert(datawriter is not None) assert(datawriter.is_enabled()) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) # Overload 2 @@ -121,7 +121,7 @@ def test_create_datawriter(topic, publisher): assert(datawriter is not None) assert(datawriter.is_enabled()) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) def test(status_mask_1, status_mask_2, listnr=None): @@ -133,14 +133,14 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(datawriter is not None) assert(datawriter.is_enabled()) assert(status_mask_1 == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) # Overload 3: Different status masks @@ -231,7 +231,7 @@ def test_create_datawriter_with_profile(topic, publisher): assert(fastdds.VOLATILE_DURABILITY_QOS == qos.durability().kind) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) # Overload 2 @@ -243,7 +243,7 @@ def test_create_datawriter_with_profile(topic, publisher): assert(fastdds.VOLATILE_DURABILITY_QOS == qos.durability().kind) assert(fastdds.StatusMask.all() == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) def test(status_mask_1, status_mask_2, listnr=None): @@ -258,7 +258,7 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(fastdds.VOLATILE_DURABILITY_QOS == qos.durability().kind) assert(status_mask_1 == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) datawriter = publisher.create_datawriter_with_profile( topic, 'test_datawriter_profile', listnr, status_mask_2) @@ -268,7 +268,7 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(fastdds.VOLATILE_DURABILITY_QOS == qos.durability().kind) assert(status_mask_2 == datawriter.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) # Overload 3: Different status masks @@ -343,10 +343,10 @@ def test_deleted_contained_entities(participant, topic, publisher): assert(datawriter is not None) # Cannot delete publisher with datawriters - assert(fastdds.ReturnCode_t.RETCODE_PRECONDITION_NOT_MET == + assert(fastdds.RETCODE_PRECONDITION_NOT_MET == participant.delete_publisher(publisher)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_contained_entities()) assert(publisher.has_datawriters() is False) @@ -358,7 +358,7 @@ def test_enable(not_autoenable_participant_qos, publisher): - Publisher::is_enabled """ assert(not publisher.is_enabled()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.enable()) assert(publisher.is_enabled()) @@ -379,7 +379,7 @@ def test_get_datawriters(topic, publisher): assert(1 == len(datawriters)) assert(datawriter == datawriters[0]) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) @@ -422,11 +422,11 @@ def test_get_set_qos(publisher): qos.partition().push_back('PartitionTest') qos.partition().push_back('PartitionTest2') - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.set_qos(qos)) qos2 = fastdds.PublisherQos() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.get_qos(qos2)) assert(2 == len(qos.partition())) @@ -446,7 +446,7 @@ def test_get_set_listener(publisher): # Overload 1 listener = PublisherListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.set_listener(listener)) assert(publisher.get_listener() == listener) assert(fastdds.StatusMask.all() == publisher.get_status_mask()) @@ -457,13 +457,13 @@ def test(status_mask_1, status_mask_2): """ listener = PublisherListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.set_listener(listener, status_mask_2)) assert(publisher.get_listener() == listener) assert(status_mask_2 == publisher.get_status_mask()) @@ -542,7 +542,7 @@ def test_lookup_datawriter(topic, publisher): assert(datawriter2 is not None) assert(datawriter == datawriter2) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) @@ -552,9 +552,9 @@ def test_suspend_publications(publisher): - Publisher::suspend_publications - Publisher::resume_publications """ - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == publisher.suspend_publications()) - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == publisher.resume_publications()) @@ -563,7 +563,7 @@ def test_wait_for_acknowlegments(publisher): This test checks: - Publisher::wait_for_acknowledgments """ - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.wait_for_acknowledgments(fastdds.Duration_t(3, 0))) # TODO Test a timeout @@ -583,19 +583,19 @@ def create_publisher(): reader_topic, fastdds.DATAREADER_QOS_DEFAULT) time.sleep(1) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == reader_participant.delete_topic(reader_topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == reader_participant.delete_subscriber(subscriber)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(reader_participant)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_publisher(publisher)) - assert(fastdds.ReturnCode_t.RETCODE_OK == - factory.delete_participant(participant)) \ No newline at end of file + assert(fastdds.RETCODE_OK == + factory.delete_participant(participant)) diff --git a/fastdds_python/test/api/test_subscriber.py b/fastdds_python/test/api/test_subscriber.py index c3c7511f..5354d95e 100644 --- a/fastdds_python/test/api/test_subscriber.py +++ b/fastdds_python/test/api/test_subscriber.py @@ -44,14 +44,14 @@ def subscriber(participant, topic): yield subscriber - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_contained_entities()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -91,9 +91,9 @@ def test_access(subscriber): This test checks: - ::resume_publications """ - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == subscriber.begin_access()) - assert(fastdds.ReturnCode_t.RETCODE_UNSUPPORTED == + assert(fastdds.RETCODE_UNSUPPORTED == subscriber.end_access()) @@ -115,7 +115,7 @@ def test_create_datareader(topic, subscriber): assert(datareader is not None) assert(datareader.is_enabled()) assert(fastdds.StatusMask.all() == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) # Overload 2 @@ -124,7 +124,7 @@ def test_create_datareader(topic, subscriber): assert(datareader is not None) assert(datareader.is_enabled()) assert(fastdds.StatusMask.all() == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) def test(status_mask_1, status_mask_2, listnr=None): @@ -136,14 +136,14 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(datareader is not None) assert(datareader.is_enabled()) assert(status_mask_1 == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) # Overload 3: Different status masks @@ -234,7 +234,7 @@ def test_create_datareader_with_profile(topic, subscriber): assert(fastdds.RELIABLE_RELIABILITY_QOS == qos.reliability().kind) assert(fastdds.StatusMask.all() == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) # Overload 2 @@ -246,7 +246,7 @@ def test_create_datareader_with_profile(topic, subscriber): assert(fastdds.RELIABLE_RELIABILITY_QOS == qos.reliability().kind) assert(fastdds.StatusMask.all() == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) def test(status_mask_1, status_mask_2, listnr=None): @@ -261,7 +261,7 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(fastdds.RELIABLE_RELIABILITY_QOS == qos.reliability().kind) assert(status_mask_1 == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) datareader = subscriber.create_datareader_with_profile( topic, 'test_datareader_profile', listnr, status_mask_2) @@ -271,7 +271,7 @@ def test(status_mask_1, status_mask_2, listnr=None): assert(fastdds.RELIABLE_RELIABILITY_QOS == qos.reliability().kind) assert(status_mask_2 == datareader.get_status_mask()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) # Overload 3: Different status masks @@ -346,10 +346,10 @@ def test_delete_contained_entities(participant, topic, subscriber): assert(datareader is not None) # Cannot delete subscriber with datareaders - assert(fastdds.ReturnCode_t.RETCODE_PRECONDITION_NOT_MET == + assert(fastdds.RETCODE_PRECONDITION_NOT_MET == participant.delete_subscriber(subscriber)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_contained_entities()) assert(subscriber.has_datareaders() is False) @@ -362,7 +362,7 @@ def test_enable(not_autoenable_participant_qos, subscriber): - Subscriber::is_enabled """ assert(not subscriber.is_enabled()) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.enable()) assert(subscriber.is_enabled()) @@ -379,11 +379,11 @@ def test_get_datareaders(topic, subscriber): assert(subscriber.has_datareaders()) datareaders = fastdds.DataReaderVector() - assert(subscriber.get_datareaders(datareaders)) + assert(fastdds.RETCODE_OK == subscriber.get_datareaders(datareaders)) assert(1 == len(datareaders)) assert(datareader == datareaders[0]) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) @@ -425,11 +425,11 @@ def test_get_set_qos(subscriber): qos = fastdds.SubscriberQos() qos.partition().push_back('PartitionTest') qos.partition().push_back('PartitionTest2') - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.set_qos(qos)) qos2 = fastdds.SubscriberQos() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.get_qos(qos2)) @@ -445,7 +445,7 @@ def test_get_set_listener(subscriber): # Overload 1 listener = SubscriberListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.set_listener(listener)) assert(subscriber.get_listener() == listener) assert(fastdds.StatusMask.all() == subscriber.get_status_mask()) @@ -456,13 +456,13 @@ def test(status_mask_1, status_mask_2): """ listener = SubscriberListener() assert(listener is not None) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == 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.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.set_listener(listener, status_mask_2)) assert(subscriber.get_listener() == listener) assert(status_mask_2 == subscriber.get_status_mask()) @@ -541,7 +541,7 @@ def test_lookup_datareader(topic, subscriber): assert(datareader2 is not None) assert(datareader == datareader2) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) @@ -560,19 +560,19 @@ def create_subcriber(): writer_topic, fastdds.DATAWRITER_QOS_DEFAULT) time.sleep(1) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_topic(writer_topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_publisher(publisher)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(writer_participant)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) diff --git a/fastdds_python/test/api/test_waitset.py b/fastdds_python/test/api/test_waitset.py index 5a6010d3..584a58c1 100644 --- a/fastdds_python/test/api/test_waitset.py +++ b/fastdds_python/test/api/test_waitset.py @@ -47,14 +47,14 @@ def datareader(participant, topic, subscriber): yield datareader - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == subscriber.delete_datareader(datareader)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_topic(topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == participant.delete_subscriber(subscriber)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(participant)) @@ -87,14 +87,14 @@ def datawriter(writer_participant, writer_topic, publisher): yield datawriter - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == publisher.delete_datawriter(datawriter)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_topic(writer_topic)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == writer_participant.delete_publisher(publisher)) factory = fastdds.DomainParticipantFactory.get_instance() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == factory.delete_participant(writer_participant)) @@ -111,13 +111,13 @@ def test_waitset(datareader, datawriter): attached_conds = fastdds.ConditionSeq() conds = fastdds.ConditionSeq() - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.attach_condition(status_cond)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.attach_condition(guard_cond)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.attach_condition(read_cond)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.get_conditions(attached_conds)) assert(3 == len(attached_conds)) for c in attached_conds: @@ -152,7 +152,7 @@ def test_waitset(datareader, datawriter): attached_read_cond = c.to_read_condition() assert(read_cond == attached_read_cond) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.wait(conds, fastdds.Duration_t(1, 0))) assert(1 == len(conds)) @@ -165,12 +165,12 @@ def test_waitset(datareader, datawriter): assert(changed_statuses.is_active( fastdds.StatusMask.requested_incompatible_qos())) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.detach_condition(status_cond)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.detach_condition(guard_cond)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == waitset.detach_condition(read_cond)) - assert(fastdds.ReturnCode_t.RETCODE_OK == + assert(fastdds.RETCODE_OK == datareader.delete_readcondition(read_cond))