diff --git a/test/feature/dynamic_types/DynamicTypesDDSTypesTest.cpp b/test/feature/dynamic_types/DynamicTypesDDSTypesTest.cpp index a48c34b2a51..1a180453bc5 100644 --- a/test/feature/dynamic_types/DynamicTypesDDSTypesTest.cpp +++ b/test/feature/dynamic_types/DynamicTypesDDSTypesTest.cpp @@ -319,28679 +319,6 @@ DynamicType::_ref_type DynamicTypesDDSTypesTest::create_inner_bitset_helper_alia return alias_builder->build(); } -// /********* -// * BITSETS -// **********/ -// #pragma region BITSETS - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_BitsetStruct) -// { -// { -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr bitset_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(bitset_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(bitset_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(bitset_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// bitset_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// bitset_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = bitset_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(bitset_type); -// ASSERT_TRUE(data != nullptr); - -// ASSERT_FALSE(data->set_int32_value(10, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->set_string_value("", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(data->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(data->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(data->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(data->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(bitset_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(bitset_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// BitsetStruct wbitset; -// BitsetStructPubSubType wbitsetpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wbitsetpb.deserialize(&dynamic_payload, &wbitset)); - -// uint32_t static_payloadSize = static_cast(wbitsetpb.getSerializedSizeProvider(&wbitset)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wbitsetpb.serialize(&wbitset, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(bitset_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); - -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************** -// * DECLARATIONS -// ***************/ -// #pragma region DECLARATIONS - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_ForwardDeclarationsStruct) -// { -// { -// DynamicTypeBuilder_ptr struct_base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr struct_base_type1 = struct_base_type_builder1->build(); -// ASSERT_TRUE(struct_base_type_builder1 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr struct_base_type2 = struct_base_type_builder2->build(); -// ASSERT_TRUE(struct_base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_base_type_builder->add_member(0, "field1", struct_base_type1) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_base_type_builder->add_member(1, "field2", struct_base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr struct_base_type = struct_base_type_builder->build(); -// ASSERT_TRUE(struct_base_type != nullptr); - - -// DynamicTypeBuilder_ptr union_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr union_base_type = union_base_type_builder->build(); -// ASSERT_TRUE(union_base_type_builder != nullptr); -// ASSERT_TRUE(union_base_type != nullptr); - -// DynamicTypeBuilder_ptr union_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr union_base_type2 = union_base_type_builder2->build(); -// ASSERT_TRUE(union_base_type_builder2 != nullptr); -// ASSERT_TRUE(union_base_type2 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(union_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(union_type_builder->add_member(0, "first", union_base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(union_type_builder->add_member(1, "second", union_base_type2, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// // Create a data of this union -// DynamicType_ptr union_type = union_type_builder->build(); -// ASSERT_TRUE(union_type != nullptr); - -// DynamicTypeBuilder_ptr forward_struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(forward_struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(0, "field1", struct_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(1, "field2", union_type) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr forward_struct_base_type = forward_struct_base_type_builder->build(); -// ASSERT_TRUE(forward_struct_base_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(data != nullptr); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(forward_struct_base_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// ForwardDeclarationsStruct structures; -// ForwardDeclarationsStructPubSubType structurespb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(structurespb.deserialize(&dynamic_payload, &structures)); - -// uint32_t static_payloadSize = static_cast(structurespb.getSerializedSizeProvider(&structures)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(structurespb.serialize(&structures, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_ForwardDeclarationsRecursiveStruct) -// { -// { -// DynamicTypeBuilder_ptr struct_base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr struct_base_type1 = struct_base_type_builder1->build(); -// ASSERT_TRUE(struct_base_type_builder1 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr struct_base_type2 = struct_base_type_builder2->build(); -// ASSERT_TRUE(struct_base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_base_type_builder->add_member(0, "field1", struct_base_type1) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_base_type_builder->add_member(1, "field2", struct_base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr struct_base_type = struct_base_type_builder->build(); -// ASSERT_TRUE(struct_base_type != nullptr); - -// uint32_t sequence_length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// DynamicTypeBuilder_ptr sequence_struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(struct_base_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_struct_base_type = sequence_struct_base_type_builder->build(); -// ASSERT_TRUE(sequence_struct_base_type_builder != nullptr); -// ASSERT_TRUE(sequence_struct_base_type != nullptr); - -// sequence_length = 10; -// DynamicTypeBuilder_ptr sequence_struct_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(struct_base_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_struct_base_type2 = sequence_struct_base_type_builder2->build(); -// ASSERT_TRUE(sequence_struct_base_type_builder2 != nullptr); -// ASSERT_TRUE(sequence_struct_base_type2 != nullptr); - -// DynamicTypeBuilder_ptr union_base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr union_base_type1 = union_base_type_builder1->build(); -// ASSERT_TRUE(union_base_type_builder1!= nullptr); -// ASSERT_TRUE(union_base_type1 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(union_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(union_type_builder->add_member(0, "default", union_base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(union_type_builder->add_member(0, "first", union_base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(union_type_builder->add_member(0, "second", union_base_type1, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// // Create a data of this union -// DynamicType_ptr union_type = union_type_builder->build(); -// ASSERT_TRUE(union_type != nullptr); - -// sequence_length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// DynamicTypeBuilder_ptr sequence_union_base_typetype_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(union_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_union_base_typetype = sequence_union_base_typetype_builder->build(); -// ASSERT_TRUE(sequence_union_base_typetype_builder != nullptr); -// ASSERT_TRUE(sequence_union_base_typetype != nullptr); - -// sequence_length = 10; -// DynamicTypeBuilder_ptr sequence_union_base_typetype_builder2 = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(union_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_union_base_typetype2 = sequence_union_base_typetype_builder2->build(); -// ASSERT_TRUE(sequence_union_base_typetype_builder2 != nullptr); -// ASSERT_TRUE(sequence_union_base_typetype2 != nullptr); - -// DynamicTypeBuilder_ptr forward_struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(forward_struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(0, "field1", sequence_struct_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(1, "field2", sequence_struct_base_type2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(2, "field3", sequence_union_base_typetype) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(3, "field4", sequence_union_base_typetype2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr forward_struct_base_type = forward_struct_base_type_builder->build(); -// ASSERT_TRUE(forward_struct_base_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(data != nullptr); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(forward_struct_base_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// ForwardDeclarationsRecursiveStruct structures; -// ForwardDeclarationsRecursiveStructPubSubType structurespb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(structurespb.deserialize(&dynamic_payload, &structures)); - -// uint32_t static_payloadSize = static_cast(structurespb.getSerializedSizeProvider(&structures)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(structurespb.serialize(&structures, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_ModuledForwardDeclarationsStruct) -// { -// { -// DynamicTypeBuilder_ptr struct_base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr struct_base_type1 = struct_base_type_builder1->build(); -// ASSERT_TRUE(struct_base_type_builder1 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr struct_base_type2 = struct_base_type_builder2->build(); -// ASSERT_TRUE(struct_base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_base_type_builder->add_member(0, "field1", struct_base_type1) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_base_type_builder->add_member(1, "field2", struct_base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr struct_base_type = struct_base_type_builder->build(); -// ASSERT_TRUE(struct_base_type != nullptr); - - -// DynamicTypeBuilder_ptr union_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr union_base_type = union_base_type_builder->build(); -// ASSERT_TRUE(union_base_type_builder != nullptr); -// ASSERT_TRUE(union_base_type != nullptr); - -// DynamicTypeBuilder_ptr union_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr union_base_type2 = union_base_type_builder2->build(); -// ASSERT_TRUE(union_base_type_builder2 != nullptr); -// ASSERT_TRUE(union_base_type2 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(union_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(union_type_builder->add_member(0, "first", union_base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(union_type_builder->add_member(1, "second", union_base_type2, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// // Create a data of this union -// DynamicType_ptr union_type = union_type_builder->build(); -// ASSERT_TRUE(union_type != nullptr); - -// DynamicTypeBuilder_ptr forward_struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(forward_struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(0, "field1", struct_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(1, "field2", union_type) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr forward_struct_base_type = forward_struct_base_type_builder->build(); -// ASSERT_TRUE(forward_struct_base_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(data != nullptr); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(forward_struct_base_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// ModuledForwardDeclarationsStruct structures; -// ModuledForwardDeclarationsStructPubSubType structurespb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(structurespb.deserialize(&dynamic_payload, &structures)); - -// uint32_t static_payloadSize = static_cast(structurespb.getSerializedSizeProvider(&structures)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(structurespb.serialize(&structures, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_ModuledForwardDeclarationsRecursiveStruct) -// { -// { -// DynamicTypeBuilder_ptr struct_base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr struct_base_type1 = struct_base_type_builder1->build(); -// ASSERT_TRUE(struct_base_type_builder1 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr struct_base_type2 = struct_base_type_builder2->build(); -// ASSERT_TRUE(struct_base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_base_type_builder->add_member(0, "field1", struct_base_type1) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_base_type_builder->add_member(1, "field2", struct_base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr struct_base_type = struct_base_type_builder->build(); -// ASSERT_TRUE(struct_base_type != nullptr); - -// uint32_t sequence_length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// DynamicTypeBuilder_ptr sequence_struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(struct_base_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_struct_base_type = sequence_struct_base_type_builder->build(); -// ASSERT_TRUE(sequence_struct_base_type_builder != nullptr); -// ASSERT_TRUE(sequence_struct_base_type != nullptr); - -// sequence_length = 10; -// DynamicTypeBuilder_ptr sequence_struct_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(struct_base_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_struct_base_type2 = sequence_struct_base_type_builder2->build(); -// ASSERT_TRUE(sequence_struct_base_type_builder2 != nullptr); -// ASSERT_TRUE(sequence_struct_base_type2 != nullptr); - -// DynamicTypeBuilder_ptr union_base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr union_base_type1 = union_base_type_builder1->build(); -// ASSERT_TRUE(union_base_type_builder1!= nullptr); -// ASSERT_TRUE(union_base_type1 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr union_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(union_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(union_type_builder->add_member(0, "default", union_base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(union_type_builder->add_member(0, "first", union_base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(union_type_builder->add_member(0, "second", union_base_type1, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(union_type_builder->add_member(0, "third", union_base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// // Create a data of this union -// DynamicType_ptr union_type = union_type_builder->build(); -// ASSERT_TRUE(union_type != nullptr); - -// sequence_length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// DynamicTypeBuilder_ptr sequence_union_base_typetype_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(union_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_union_base_typetype = sequence_union_base_typetype_builder->build(); -// ASSERT_TRUE(sequence_union_base_typetype_builder != nullptr); -// ASSERT_TRUE(sequence_union_base_typetype != nullptr); - -// sequence_length = 10; -// DynamicTypeBuilder_ptr sequence_union_base_typetype_builder2 = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(union_type_builder.get(), sequence_length); -// DynamicType_ptr sequence_union_base_typetype2 = sequence_union_base_typetype_builder2->build(); -// ASSERT_TRUE(sequence_union_base_typetype_builder2 != nullptr); -// ASSERT_TRUE(sequence_union_base_typetype2 != nullptr); - -// DynamicTypeBuilder_ptr forward_struct_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(forward_struct_base_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(0, "field1", sequence_struct_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(1, "field2", sequence_struct_base_type2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(2, "field3", sequence_union_base_typetype) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(forward_struct_base_type_builder->add_member(3, "field4", sequence_union_base_typetype2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr forward_struct_base_type = forward_struct_base_type_builder->build(); -// ASSERT_TRUE(forward_struct_base_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(data != nullptr); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(forward_struct_base_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// ModuledForwardDeclarationsRecursiveStruct structures; -// ModuledForwardDeclarationsRecursiveStructPubSubType structurespb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(structurespb.deserialize(&dynamic_payload, &structures)); - -// uint32_t static_payloadSize = static_cast(structurespb.getSerializedSizeProvider(&structures)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(structurespb.serialize(&structures, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(forward_struct_base_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************** -// * ENUMERATIONS -// ***************/ -// #pragma region ENUMERATIONS - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_Enum) -// { -// { -// DynamicTypeBuilder_ptr created_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// ASSERT_TRUE(created_builder != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(created_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(created_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(created_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(created_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(created_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); -// ASSERT_TRUE(data != nullptr); - -// // Try to set an invalid value. -// ASSERT_FALSE(data->set_enum_value("BAD", MEMBER_ID_INVALID) == ReturnCode_t::RETCODE_OK); - -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1); -// check_get_values(data, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(created_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// EnumStructure wenum; -// EnumStructurePubSubType wenumpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wenumpb.deserialize(&dynamic_payload, &wenum)); - -// uint32_t static_payloadSize = static_cast(wenumpb.getSerializedSizeProvider(&wenum)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wenumpb.serialize(&wenum, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_Bitmask) -// { -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(base_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(base_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(base_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(base_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(base_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(base_type_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(created_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId test_member_id; -// test_member_id = data->get_member_id_by_name("FLAG0"); -// ASSERT_TRUE(test_member_id != MEMBER_ID_INVALID); -// test_member_id = data->get_member_id_by_name("FLAG1"); -// ASSERT_TRUE(test_member_id != MEMBER_ID_INVALID); -// test_member_id = data->get_member_id_by_name("FLAG4"); -// ASSERT_TRUE(test_member_id != MEMBER_ID_INVALID); -// test_member_id= data->get_member_id_by_name("FLAG5"); -// ASSERT_FALSE(test_member_id != MEMBER_ID_INVALID); - -// uint64_t test_bitmask_value_1 = 55;// 00110111 -// uint64_t test_bitmask_value_2; - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(data, expected_types, &test_bitmask_value_1); -// check_get_values(data, expected_types, &test_bitmask_value_2); - -// ASSERT_TRUE(test_bitmask_value_1 == test_bitmask_value_2); -// ASSERT_TRUE(data->get_bool_value("FLAG0")); -// ASSERT_TRUE(data->get_bool_value("FLAG1")); -// ASSERT_TRUE(data->get_bool_value("FLAG4")); - -// // Over the limit -// ASSERT_FALSE(data->set_bool_value(true, limit + 1) == ReturnCode_t::RETCODE_OK); - -// bool test_value_1 = true; -// bool test_value_2 = false; - -// ASSERT_TRUE(data->get_bool_value(test_value_2, 2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_2 == true); -// ASSERT_TRUE(data->get_bool_value(test_value_2, data->get_member_id_by_name("FLAG0")) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_2 == data->get_bool_value("FLAG0")); - -// bool test3 = data->get_bool_value("FLAG0"); -// ASSERT_TRUE(test_value_1 == test3); -// ASSERT_TRUE(data->set_bool_value(true, "FLAG4") == ReturnCode_t::RETCODE_OK); -// bool test4 = data->get_bool_value("FLAG4"); -// ASSERT_TRUE(test4 == true); - -// test_value_1 = false; -// ASSERT_TRUE(data->set_bool_value(test_value_1, data->get_member_id_by_name("FLAG0")) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_bool_value(test_value_2, data->get_member_id_by_name("FLAG0")) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(created_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(created_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// BitMaskStructure wbitmask; -// BitMaskStructurePubSubType wbitmaskpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wbitmaskpb.deserialize(&dynamic_payload, &wbitmask)); - -// uint32_t static_payloadSize = static_cast(wbitmaskpb.getSerializedSizeProvider(&wbitmask)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wbitmaskpb.serialize(&wbitmask, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(created_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************* -// * INHERITANCE -// *************/ -// #pragma region INHERITANCE - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_InnerStructureHelperChild) -// { -// { -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// ASSERT_TRUE(base_type_builder != nullptr); -// auto base_type = base_type_builder->build(); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// auto base_type2 = base_type_builder2->build(); - -// DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_type_builder->add_member(1, "float32", base_type2) == ReturnCode_t::RETCODE_OK); - -// auto struct_type = struct_type_builder->build(); -// ASSERT_TRUE(struct_type != nullptr); - -// // Try to create the child struct without parent -// DynamicTypeBuilder_ptr child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(nullptr); -// ASSERT_FALSE(child_struct_type_builder != nullptr); - -// DynamicTypeBuilder_ptr child_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// ASSERT_TRUE(child_base_type_builder != nullptr); -// auto child_base_type = child_base_type_builder->build(); - -// DynamicTypeBuilder_ptr child_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// ASSERT_TRUE(child_base_type_builder2 != nullptr); -// auto child_base_type2 = child_base_type_builder2->build(); - -// // Create the child struct. -// child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(struct_type_builder.get()); -// ASSERT_TRUE(child_struct_type_builder != nullptr); - -// // Add a new member to the child struct. -// ASSERT_TRUE(child_struct_type_builder->add_member(2, "child_int64", child_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(child_struct_type_builder->add_member(3, "child_uint64", child_base_type2) == ReturnCode_t::RETCODE_OK); - -// // try to add a member to override one of the parent struct. -// ASSERT_FALSE(child_struct_type_builder->add_member(4, "int32", child_base_type) == ReturnCode_t::RETCODE_OK); - -// auto child_struct_type = child_struct_type_builder->build(); -// ASSERT_TRUE(child_struct_type != nullptr); -// auto data = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(data != nullptr); - -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, 0); -// check_get_values(data, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; - -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(data, expected_types2, &test_value_3, 1); -// check_get_values(data, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - - -// int64_t test_value_5 = 123; -// int64_t test_value_6 = 0; - -// std::vector expected_types3 = {ExpectedType::LongLong}; -// check_set_values(data, expected_types3, &test_value_5, 2); -// check_get_values(data, expected_types3, &test_value_6, 2); -// ASSERT_TRUE(test_value_5 == test_value_6); - -// uint64_t test_value_7 = 123; -// uint64_t test_value_8 = 0; - -// std::vector expected_types4 = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types4, &test_value_7, 3); -// check_get_values(data, expected_types4, &test_value_8, 3); -// ASSERT_TRUE(test_value_7 == test_value_8); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(child_struct_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// InnerStructureHelperChild wunion; -// InnerStructureHelperChildPubSubType wunionpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wunionpb.deserialize(&dynamic_payload, &wunion)); - -// uint32_t static_payloadSize = static_cast(wunionpb.getSerializedSizeProvider(&wunion)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wunionpb.serialize(&wunion, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_InnerStructureHelperChildChild) -// { -// { -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// ASSERT_TRUE(base_type_builder != nullptr); -// auto base_type = base_type_builder->build(); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// auto base_type2 = base_type_builder2->build(); - -// DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_type_builder->add_member(1, "float32", base_type2) == ReturnCode_t::RETCODE_OK); - -// auto struct_type = struct_type_builder->build(); -// ASSERT_TRUE(struct_type != nullptr); - -// // Try to create the child struct without parent -// DynamicTypeBuilder_ptr child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(nullptr); -// ASSERT_FALSE(child_struct_type_builder != nullptr); - -// DynamicTypeBuilder_ptr child_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// ASSERT_TRUE(child_base_type_builder != nullptr); -// auto child_base_type = child_base_type_builder->build(); - -// DynamicTypeBuilder_ptr child_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// ASSERT_TRUE(child_base_type_builder2 != nullptr); -// auto child_base_type2 = child_base_type_builder2->build(); - -// // Create the child struct. -// child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(struct_type_builder.get()); -// ASSERT_TRUE(child_struct_type_builder != nullptr); - -// // Add a new member to the child struct. -// ASSERT_TRUE(child_struct_type_builder->add_member(2, "child_int64", child_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(child_struct_type_builder->add_member(3, "child_uint64", child_base_type2) == ReturnCode_t::RETCODE_OK); - -// // try to add a member to override one of the parent struct. -// ASSERT_FALSE(child_struct_type_builder->add_member(4, "int32", child_base_type) == ReturnCode_t::RETCODE_OK); - -// auto child_struct_type = child_struct_type_builder->build(); -// ASSERT_TRUE(child_struct_type != nullptr); - -// DynamicTypeBuilder_ptr child_child_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// ASSERT_TRUE(child_child_base_type_builder != nullptr); -// auto child_child_base_type = child_child_base_type_builder->build(); - -// DynamicTypeBuilder_ptr child_child_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// ASSERT_TRUE(child_child_base_type_builder2 != nullptr); -// auto child_child_base_type2 = child_child_base_type_builder2->build(); - -// // Create the child struct. -// DynamicTypeBuilder_ptr child_child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(child_struct_type_builder.get()); -// ASSERT_TRUE(child_child_struct_type_builder != nullptr); - -// // Add a new member to the child struct. -// ASSERT_TRUE(child_child_struct_type_builder->add_member(4, "child_child_int64", child_child_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(child_child_struct_type_builder->add_member(5, "child_child_uint64", child_child_base_type2) == ReturnCode_t::RETCODE_OK); - -// // try to add a member to override one of the parent struct. -// ASSERT_FALSE(child_child_struct_type_builder->add_member(6, "child_int64", child_child_base_type) == ReturnCode_t::RETCODE_OK); - -// auto child_child_struct_type = child_child_struct_type_builder->build(); -// ASSERT_TRUE(child_child_struct_type != nullptr); - -// auto data = DynamicDataFactory::get_instance()->create_data(child_child_struct_type); -// ASSERT_TRUE(data != nullptr); - -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, 0); -// check_get_values(data, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; - -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(data, expected_types2, &test_value_3, 1); -// check_get_values(data, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - - -// int64_t test_value_5 = 123; -// int64_t test_value_6 = 0; - -// std::vector expected_types3 = {ExpectedType::LongLong}; -// check_set_values(data, expected_types3, &test_value_5, 2); -// check_get_values(data, expected_types3, &test_value_6, 2); -// ASSERT_TRUE(test_value_5 == test_value_6); - -// uint64_t test_value_7 = 123; -// uint64_t test_value_8 = 0; - -// std::vector expected_types4 = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types4, &test_value_7, 3); -// check_get_values(data, expected_types4, &test_value_8, 3); -// ASSERT_TRUE(test_value_7 == test_value_8); - -// int64_t test_value_9 = 123; -// int64_t test_value_10 = 0; - -// std::vector expected_types5 = {ExpectedType::LongLong}; -// check_set_values(data, expected_types5, &test_value_9, 4); -// check_get_values(data, expected_types5, &test_value_10, 4); -// ASSERT_TRUE(test_value_9 == test_value_10); - -// uint64_t test_value_11 = 123; -// uint64_t test_value_12 = 0; - -// std::vector expected_types6 = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types6, &test_value_11, 5); -// check_get_values(data, expected_types6, &test_value_12, 5); -// ASSERT_TRUE(test_value_11 == test_value_12); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(child_struct_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// InnerStructureHelperChildChild wunion; -// InnerStructureHelperChildChildPubSubType wunionpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wunionpb.deserialize(&dynamic_payload, &wunion)); - -// uint32_t static_payloadSize = static_cast(wunionpb.getSerializedSizeProvider(&wunion)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wunionpb.serialize(&wunion, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_InnerStructureHelperEmptyChild) -// { -// { -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// ASSERT_TRUE(base_type_builder != nullptr); -// auto base_type = base_type_builder->build(); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// auto base_type2 = base_type_builder2->build(); - -// DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(struct_type_builder->add_member(0, "int32", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(struct_type_builder->add_member(1, "float32", base_type2) == ReturnCode_t::RETCODE_OK); - -// auto struct_type = struct_type_builder->build(); -// ASSERT_TRUE(struct_type != nullptr); - -// // Try to create the child struct without parent -// DynamicTypeBuilder_ptr child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(nullptr); -// ASSERT_FALSE(child_struct_type_builder != nullptr); - -// // Create the child struct. -// child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(struct_type_builder.get()); -// ASSERT_TRUE(child_struct_type_builder != nullptr); - -// auto child_struct_type = child_struct_type_builder->build(); -// ASSERT_TRUE(child_struct_type != nullptr); -// auto data = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(data != nullptr); - -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, 0); -// check_get_values(data, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; - -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(data, expected_types2, &test_value_3, 1); -// check_get_values(data, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(child_struct_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// InnerStructureHelperEmptyChild wunion; -// InnerStructureHelperEmptyChildPubSubType wunionpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wunionpb.deserialize(&dynamic_payload, &wunion)); - -// uint32_t static_payloadSize = static_cast(wunionpb.getSerializedSizeProvider(&wunion)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wunionpb.serialize(&wunion, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_InnerEmptyStructureHelperChild) -// { -// { -// DynamicTypeBuilder_ptr struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(struct_type_builder != nullptr); - -// auto struct_type = struct_type_builder->build(); -// ASSERT_TRUE(struct_type != nullptr); - -// // Try to create the child struct without parent -// DynamicTypeBuilder_ptr child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(nullptr); -// ASSERT_FALSE(child_struct_type_builder != nullptr); - -// DynamicTypeBuilder_ptr child_base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// ASSERT_TRUE(child_base_type_builder != nullptr); -// auto child_base_type = child_base_type_builder->build(); - -// DynamicTypeBuilder_ptr child_base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// ASSERT_TRUE(child_base_type_builder2 != nullptr); -// auto child_base_type2 = child_base_type_builder2->build(); - -// // Create the child struct. -// child_struct_type_builder = DynamicTypeBuilderFactory::get_instance()->create_child_struct_builder(struct_type_builder.get()); -// ASSERT_TRUE(child_struct_type_builder != nullptr); - -// // Add a new member to the child struct. -// ASSERT_TRUE(child_struct_type_builder->add_member(0, "child_int64", child_base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(child_struct_type_builder->add_member(1, "child_uint64", child_base_type2) == ReturnCode_t::RETCODE_OK); - -// auto child_struct_type = child_struct_type_builder->build(); -// ASSERT_TRUE(child_struct_type != nullptr); -// auto data = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(data != nullptr); - -// int64_t test_value_5 = 123; -// int64_t test_value_6 = 0; - -// std::vector expected_types3 = {ExpectedType::LongLong}; -// check_set_values(data, expected_types3, &test_value_5, 0); -// check_get_values(data, expected_types3, &test_value_6, 0); -// ASSERT_TRUE(test_value_5 == test_value_6); - -// uint64_t test_value_7 = 123; -// uint64_t test_value_8 = 0; - -// std::vector expected_types4 = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types4, &test_value_7, 1); -// check_get_values(data, expected_types4, &test_value_8, 1); -// ASSERT_TRUE(test_value_7 == test_value_8); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(child_struct_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// InnerEmptyStructureHelperChild wunion; -// InnerEmptyStructureHelperChildPubSubType wunionpb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wunionpb.deserialize(&dynamic_payload, &wunion)); - -// uint32_t static_payloadSize = static_cast(wunionpb.getSerializedSizeProvider(&wunion)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wunionpb.serialize(&wunion, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(child_struct_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /****** -// * MAPS -// ******/ -// #pragma region MAPS - -// /*********** -// * KEY_SHORT -// ***********/ -// #pragma region KEY_SHORT - - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortUShort wmap; -// MapShortUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortLong wmap; -// MapShortLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortULong wmap; -// MapShortULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortLongLong wmap; -// MapShortLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortULongLong wmap; -// MapShortULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortFloat wmap; -// MapShortFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortDouble wmap; -// MapShortDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortLongDouble wmap; -// MapShortLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortBoolean wmap; -// MapShortBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortOctet wmap; -// MapShortOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortChar wmap; -// MapShortCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortWChar wmap; -// MapShortWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortString wmap; -// MapShortStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortWString wmap; -// MapShortWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerAliasBoundedStringHelper wmap; -// MapShortInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerAliasBoundedStringHelper wmap; -// MapShortInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerEnumHelper wmap; -// MapShortInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerEnumHelper wmap; -// MapShortInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerAliasHelper wmap; -// MapShortInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerAliasArrayHelper wmap; -// MapShortInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerAliasSequenceHelper wmap; -// MapShortInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerAliasMapHelper wmap; -// MapShortInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerUnionHelper wmap; -// MapShortInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; - -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerStructureHelper wmap; -// MapShortInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapShortInnerBitsetHelper wmap; -// MapShortInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************ -// * KEY_USHORT -// ************/ -// #pragma region KEY_USHORT - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortShort wmap; -// MapUShortShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortUShort wmap; -// MapUShortUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortLong wmap; -// MapUShortLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortULong wmap; -// MapUShortULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortLongLong wmap; -// MapUShortLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortULongLong wmap; -// MapUShortULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortFloat wmap; -// MapUShortFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortDouble wmap; -// MapUShortDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortLongDouble wmap; -// MapUShortLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortBoolean wmap; -// MapUShortBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortOctet wmap; -// MapUShortOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortChar wmap; -// MapUShortCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortWChar wmap; -// MapUShortWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortString wmap; -// MapUShortStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortWString wmap; -// MapUShortWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerAliasBoundedStringHelper wmap; -// MapUShortInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerAliasBoundedStringHelper wmap; -// MapUShortInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerEnumHelper wmap; -// MapUShortInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerEnumHelper wmap; -// MapUShortInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerAliasHelper wmap; -// MapUShortInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerAliasArrayHelper wmap; -// MapUShortInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerAliasSequenceHelper wmap; -// MapUShortInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerAliasMapHelper wmap; -// MapUShortInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerUnionHelper wmap; -// MapUShortInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerStructureHelper wmap; -// MapUShortInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint16_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapUShortInnerBitsetHelper wmap; -// MapUShortInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /********** -// * KEY_LONG -// **********/ -// #pragma region KEY_LONG - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongShort wmap; -// MapLongShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongUShort wmap; -// MapLongUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLong wmap; -// MapLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongULong wmap; -// MapLongULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongKeyLongLongValue) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongKeyLongLongValue wmap; -// MapLongKeyLongLongValuePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongULongLong wmap; -// MapLongULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongFloat wmap; -// MapLongFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongDouble wmap; -// MapLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongKeyLongDoubleValue) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongKeyLongDoubleValue wmap; -// MapLongKeyLongDoubleValuePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongBoolean wmap; -// MapLongBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongOctet wmap; -// MapLongOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongChar wmap; -// MapLongCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongWChar wmap; -// MapLongWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongString wmap; -// MapLongStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongWString wmap; -// MapLongWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerAliasBoundedStringHelper wmap; -// MapLongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerAliasBoundedStringHelper wmap; -// MapLongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerEnumHelper wmap; -// MapLongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerEnumHelper wmap; -// MapLongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerAliasHelper wmap; -// MapLongInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerAliasArrayHelper wmap; -// MapLongInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerAliasSequenceHelper wmap; -// MapLongInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerAliasMapHelper wmap; -// MapLongInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerUnionHelper wmap; -// MapLongInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerStructureHelper wmap; -// MapLongInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongInnerBitsetHelper wmap; -// MapLongInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /*********** -// * KEY_ULONG -// ***********/ -// #pragma region KEY_ULONG - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongShort wmap; -// MapULongShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongUShort wmap; -// MapULongUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLong wmap; -// MapULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongULong wmap; -// MapULongULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongLong wmap; -// MapULongLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongULongLong wmap; -// MapULongULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongFloat wmap; -// MapULongFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongDouble wmap; -// MapULongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapKeyULongValueLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapKeyULongValueLongDouble wmap; -// MapKeyULongValueLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongBoolean wmap; -// MapULongBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongOctet wmap; -// MapULongOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongChar wmap; -// MapULongCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongWChar wmap; -// MapULongWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongString wmap; -// MapULongStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongWString wmap; -// MapULongWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerAliasBoundedStringHelper wmap; -// MapULongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerAliasBoundedStringHelper wmap; -// MapULongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerEnumHelper wmap; -// MapULongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerEnumHelper wmap; -// MapULongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerAliasHelper wmap; -// MapULongInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerAliasArrayHelper wmap; -// MapULongInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerAliasSequenceHelper wmap; -// MapULongInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerAliasMapHelper wmap; -// MapULongInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerUnionHelper wmap; -// MapULongInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerStructureHelper wmap; -// MapULongInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongInnerBitsetHelper wmap; -// MapULongInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************** -// * KEY_LONGLONG -// **************/ -// #pragma region KEY_LONGLONG - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongShort wmap; -// MapLongLongShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongUShort wmap; -// MapLongLongUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongKeyLongValue) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test.. -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongKeyLongValue wmap; -// MapLongLongKeyLongValuePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongULong wmap; -// MapLongLongULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongLongLong wmap; -// MapLongLongLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongULongLong wmap; -// MapLongLongULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongFloat wmap; -// MapLongLongFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongKeyDoubleValue) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongKeyDoubleValue wmap; -// MapLongLongKeyDoubleValuePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongLongDouble wmap; -// MapLongLongLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongBoolean wmap; -// MapLongLongBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongOctet wmap; -// MapLongLongOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongChar wmap; -// MapLongLongCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongWChar wmap; -// MapLongLongWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongString wmap; -// MapLongLongStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongWString wmap; -// MapLongLongWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasBoundedStringHelper wmap; -// MapLongLongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasBoundedStringHelper wmap; -// MapLongLongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerEnumHelper wmap; -// MapLongLongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerEnumHelper wmap; -// MapLongLongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasHelper wmap; -// MapLongLongInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasArrayHelper wmap; -// MapLongLongInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasSequenceHelper wmap; -// MapLongLongInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasMapHelper wmap; -// MapLongLongInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerUnionHelper wmap; -// MapLongLongInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerStructureHelper wmap; -// MapLongLongInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerBitsetHelper wmap; -// MapLongLongInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /*************** -// * KEY_ULONGLONG -// ***************/ -// #pragma region KEY_ULONGLONG - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongShort wmap; -// MapULongLongShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongUShort wmap; -// MapLongLongUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapKeyULongValueLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapKeyULongValueLongLong wmap; -// MapKeyULongValueLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongULong wmap; -// MapLongLongULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongLongLong wmap; -// MapLongLongLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongULongLong wmap; -// MapLongLongULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongFloat wmap; -// MapLongLongFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapKeyULongLongValueDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapKeyULongLongValueDouble wmap; -// MapKeyULongLongValueDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongLongDouble wmap; -// MapLongLongLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongBoolean wmap; -// MapLongLongBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongOctet wmap; -// MapLongLongOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongChar wmap; -// MapLongLongCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongWChar wmap; -// MapLongLongWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongString wmap; -// MapLongLongStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongWString wmap; -// MapLongLongWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasBoundedStringHelper wmap; -// MapLongLongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerAliasBoundedStringHelper wmap; -// MapLongLongInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLongInnerEnumHelper wmap; -// MapLongLongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerEnumHelper wmap; -// MapULongLongInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerAliasHelper wmap; -// MapULongLongInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerAliasArrayHelper wmap; -// MapULongLongInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerAliasSequenceHelper wmap; -// MapULongLongInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerAliasMapHelper wmap; -// MapULongLongInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerUnionHelper wmap; -// MapULongLongInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerStructureHelper wmap; -// MapULongLongInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_uint64_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapULongLongInnerBitsetHelper wmap; -// MapULongLongInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************ -// * KEY_STRING -// ************/ -// #pragma region KEY_STRING - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringShort wmap; -// MapStringShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringUShort wmap; -// MapStringUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringLong wmap; -// MapStringLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringULong wmap; -// MapStringULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringLongLong wmap; -// MapStringLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringULongLong wmap; -// MapStringULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringFloat wmap; -// MapStringFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringDouble wmap; -// MapStringDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringLongDouble wmap; -// MapStringLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringBoolean wmap; -// MapStringBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringOctet wmap; -// MapStringOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringChar wmap; -// MapStringCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringWChar wmap; -// MapStringWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringString wmap; -// MapStringStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringWString wmap; -// MapStringWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasBoundedStringHelper wmap; -// MapStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasBoundedStringHelper wmap; -// MapStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerEnumHelper wmap; -// MapStringInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerEnumHelper wmap; -// MapStringInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasHelper wmap; -// MapStringInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasArrayHelper wmap; -// MapStringInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasSequenceHelper wmap; -// MapStringInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasMapHelper wmap; -// MapStringInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerUnionHelper wmap; -// MapStringInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerStructureHelper wmap; -// MapStringInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerBitsetHelper wmap; -// MapStringInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /************* -// * KEY_WSTRING -// *************/ -// #pragma region KEY_WSTRING - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringShort wmap; -// MapWStringShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringUShort wmap; -// MapWStringUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringLong wmap; -// MapWStringLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringULong wmap; -// MapWStringULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringLongLong wmap; -// MapWStringLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringULongLong wmap; -// MapWStringULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringFloat wmap; -// MapWStringFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringDouble wmap; -// MapWStringDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringLongDouble wmap; -// MapWStringLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringBoolean wmap; -// MapWStringBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringOctet wmap; -// MapWStringOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringChar wmap; -// MapWStringCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringWChar wmap; -// MapWStringWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringString wmap; -// MapWStringStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringWString wmap; -// MapWStringWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasBoundedStringHelper wmap; -// MapWStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasBoundedStringHelper wmap; -// MapWStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerEnumHelper wmap; -// MapWStringInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerEnumHelper wmap; -// MapWStringInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasHelper wmap; -// MapWStringInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasArrayHelper wmap; -// MapWStringInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasSequenceHelper wmap; -// MapWStringInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasMapHelper wmap; -// MapWStringInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerUnionHelper wmap; -// MapWStringInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerStructureHelper wmap; -// MapWStringInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapWStringInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerBitsetHelper wmap; -// MapWStringInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /******************* -// * KEY_BOUNDEDSTRING -// *******************/ -// #pragma region KEY_BOUNDEDSTRING - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringShort wmap; -// MapStringShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringUShort wmap; -// MapStringUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringLong wmap; -// MapStringLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringULong wmap; -// MapStringULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringLongLong wmap; -// MapStringLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringULongLong wmap; -// MapStringULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringFloat wmap; -// MapStringFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringDouble wmap; -// MapStringDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringLongDouble wmap; -// MapStringLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringBoolean wmap; -// MapStringBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringOctet wmap; -// MapStringOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringChar wmap; -// MapStringCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringWChar wmap; -// MapStringWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringString wmap; -// MapStringStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringWString wmap; -// MapStringWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasBoundedStringHelper wmap; -// MapStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerAliasBoundedStringHelper wmap; -// MapStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapStringInnerEnumHelper wmap; -// MapStringInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerBitMaskHelper wmap; -// MapInnerAliasBoundedStringHelperInnerBitMaskHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerAliasHelper wmap; -// MapInnerAliasBoundedStringHelperInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerAliasArrayHelper wmap; -// MapInnerAliasBoundedStringHelperInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerAliasSequenceHelper wmap; -// MapInnerAliasBoundedStringHelperInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerAliasMapHelper wmap; -// MapInnerAliasBoundedStringHelperInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerUnionHelper wmap; -// MapInnerAliasBoundedStringHelperInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerStructureHelper wmap; -// MapInnerAliasBoundedStringHelperInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_string_value("2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedStringHelperInnerBitsetHelper wmap; -// MapInnerAliasBoundedStringHelperInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /******************* -// * KEY_BOUNDEDWSTRING -// *******************/ -// #pragma region KEY_BOUNDEDWSTRING - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringShort wmap; -// MapWStringShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperUShort) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint16_t test_value_1 = 123; -// uint16_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::UShort}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringUShort wmap; -// MapWStringUShortPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringLong wmap; -// MapWStringLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperULong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint32_t test_value_1 = 123; -// uint32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringULong wmap; -// MapWStringULongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperLongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int64_t test_value_1 = 123; -// int64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringLongLong wmap; -// MapWStringLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperULongLong) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_uint64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 123; -// uint64_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_uint64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::ULongLong}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringULongLong wmap; -// MapWStringULongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperFloat) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// float_t test_value_1 = 123.0f; -// float_t test_value_2 = 0.0f; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Float}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringFloat wmap; -// MapWStringFloatPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float64_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// double test_value_1 = 123.0; -// double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float64_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Double}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringDouble wmap; -// MapWStringDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperLongDouble) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_float128_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// long double test_value_1 = 123.0; -// long double test_value_2 = 0.0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_float128_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::LongDouble}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringLongDouble wmap; -// MapWStringLongDoublePubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperBoolean) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bool_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// bool test_value_1 = true; -// bool test_value_2 = false; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_bool_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Boolean}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringBoolean wmap; -// MapWStringBooleanPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperOctet) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// octet test_value_1 = 255; -// octet test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_byte_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Octet}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringOctet wmap; -// MapWStringOctetPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char8_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// char test_value_1 = 'a'; -// char test_value_2 = 'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char8_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Char}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringChar wmap; -// MapWStringCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperWChar) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_char16_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// wchar_t test_value_1 = L'a'; -// wchar_t test_value_2 = L'b'; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_char16_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WChar}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringWChar wmap; -// MapWStringWCharPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "STRING_TEST"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringString wmap; -// MapWStringStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperWString) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"STRING_TEST"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringWString wmap; -// MapWStringWStringPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerAliasBoundedStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_string_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "A"; -// std::string test_value_2 = ""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_string_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::String}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasBoundedStringHelper wmap; -// MapWStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerAliasBoundedWStringHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::wstring test_value_1 = L"A"; -// std::wstring test_value_2 = L""; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_wstring_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::WString}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerAliasBoundedStringHelper wmap; -// MapWStringInnerAliasBoundedStringHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerEnumHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(10); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_enum_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add three members to the enum. -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "DEFAULT") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FIRST") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(2, "SECOND") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name. -// ASSERT_FALSE(value_type_builder->add_empty_member(4, "DEFAULT") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// std::string test_value_1 = "SECOND"; -// std::string test_value_2; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_enum_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Enum}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapWStringInnerEnumHelper wmap; -// MapWStringInnerEnumHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerBitMaskHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// uint32_t limit = 5; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitmask_builder(limit); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// // Add members to the bitmask -// ASSERT_TRUE(value_type_builder->add_empty_member(0, "FLAG0") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(1, "FLAG1") == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_empty_member(4, "FLAG4") == ReturnCode_t::RETCODE_OK); - -// // Try to add a descriptor with the same name -// ASSERT_FALSE(value_type_builder->add_empty_member(1, "FLAG0") == ReturnCode_t::RETCODE_OK); -// // Out of bounds -// ASSERT_FALSE(value_type_builder->add_empty_member(5, "FLAG5") == ReturnCode_t::RETCODE_OK); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t test_value_1 = 55;// 00110111 -// uint64_t test_value_2; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// std::vector expected_types = {ExpectedType::Bitmask}; -// expected_types.push_back(ExpectedType::ULongLong); -// check_set_values(loaned_value1, expected_types, &test_value_1); -// check_get_values(loaned_value1, expected_types, &test_value_2); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerBitMaskHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerBitMaskHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerAliasHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// std::string name = "InnerAliasHelper"; -// DynamicTypeBuilder_ptr alias_builder = DynamicTypeBuilderFactory::get_instance()->create_alias_builder(value_type_builder.get(), name); -// ASSERT_TRUE(alias_builder != nullptr); -// DynamicType_ptr created_type = DynamicTypeBuilderFactory::get_instance()->create_type(alias_builder.get()); -// ASSERT_TRUE(created_type != nullptr); -// ASSERT_TRUE(created_type->get_name() == "InnerAliasHelper"); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), alias_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerAliasHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerAliasHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerAliasArrayHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// std::vector array_length = { 10 }; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_array_builder(base_type_builder.get(), array_length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Get an index in the array. -// std::vector vPosition = { 1 }; -// MemberId testPos(0); -// testPos = loaned_value1->get_array_index(vPosition); -// ASSERT_TRUE(testPos != MEMBER_ID_INVALID); - -// // Invalid input vectors. -// std::vector vPosition2 = { 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition2) != MEMBER_ID_INVALID); -// std::vector vPosition3 = { 1, 1, 1, 1 }; -// ASSERT_FALSE(loaned_value1->get_array_index(vPosition3) != MEMBER_ID_INVALID); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, testPos); -// check_get_values(loaned_value1, expected_types, &test_value_2, testPos); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count before and after remove an element. -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_value(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_array_data(testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Check the clear values method -// ASSERT_TRUE(loaned_value1->set_int16_value(test_value_1, testPos) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == value_type->get_total_bounds()); - -// // Try to set a value out of the array. -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 100) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerAliasArrayHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerAliasArrayHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerAliasSequenceHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_sequence_builder(base_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int16_value(test_value_1, 1) == ReturnCode_t::RETCODE_OK); - -// MemberId newId; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// MemberId newId2; -// ASSERT_TRUE(loaned_value1->insert_sequence_data(newId2) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, newId); -// check_get_values(loaned_value1, expected_types, &test_value_2, newId); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Remove the elements. -// ASSERT_TRUE(loaned_value1->remove_sequence_data(newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // New Insert Methods -// ASSERT_TRUE(loaned_value1->insert_int16_value(test_value_1, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_int16_value(test_value_2, newId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(test_value_1 == test_value_2); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); - -// // Check that the sequence is empty. -// ASSERT_FALSE(loaned_value1->get_int16_value(test_value_2, 0) == ReturnCode_t::RETCODE_OK); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerAliasSequenceHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerAliasSequenceHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerAliasMapHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_key_type = inner_key_type_builder->build(); -// ASSERT_TRUE(inner_key_type_builder != nullptr); -// ASSERT_TRUE(inner_key_type != nullptr); - -// DynamicTypeBuilder_ptr inner_value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr inner_value_type = inner_value_type_builder->build(); -// ASSERT_TRUE(inner_value_type_builder != nullptr); -// ASSERT_TRUE(inner_value_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(inner_key_type_builder.get(), inner_value_type_builder.get(), length); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Try to write on an empty position -// ASSERT_FALSE(loaned_value1->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId; -// MemberId inner_valueId; -// DynamicData* inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(loaned_value1->insert_map_data(inner_key_data, inner_keyId, inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId inner_keyId2; -// MemberId inner_valueId2; -// inner_key_data = DynamicDataFactory::get_instance()->create_data(inner_key_type); -// inner_key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_TRUE(loaned_value1->insert_map_data(inner_key_data, inner_keyId2, inner_valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(inner_key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, inner_valueId); -// check_get_values(loaned_value1, expected_types, &test_value_2, inner_valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_FALSE(loaned_value1->remove_map_data(inner_valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 2); -// ASSERT_TRUE(loaned_value1->remove_map_data(inner_keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 1); -// ASSERT_TRUE(loaned_value1->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(loaned_value1->get_item_count() == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerAliasMapHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerAliasMapHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerUnionHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder1 = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type1 = base_type_builder1->build(); -// ASSERT_TRUE(base_type_builder1!= nullptr); -// ASSERT_TRUE(base_type1 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder3 = DynamicTypeBuilderFactory::get_instance()->create_int16_builder(); -// DynamicType_ptr base_type3 = base_type_builder3->build(); -// ASSERT_TRUE(base_type_builder3 != nullptr); -// ASSERT_TRUE(base_type3 != nullptr); - -// DynamicTypeBuilder_ptr discriminator_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr discriminator_type = discriminator_type_builder->build(); -// ASSERT_TRUE(discriminator_type_builder != nullptr); -// ASSERT_TRUE(discriminator_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_union_builder(discriminator_type_builder.get()); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the union. -// ASSERT_TRUE(value_type_builder->add_member(0, "default", base_type3, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "first", base_type1, "", { 1}, false) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(0, "second", base_type2, "", { 2 }, false) == ReturnCode_t::RETCODE_OK); - -// // Try to add a second "DEFAULT" value to the union -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 0 }, true) == ReturnCode_t::RETCODE_OK); -// // Try to add a second value to the same case label -// ASSERT_FALSE(value_type_builder->add_member(0, "third", base_type1, "", { 1 }, false) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// uint64_t label; -// int16_t test_value_1 = 123; -// int16_t test_value_2 = 0; - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// std::vector expected_types = {ExpectedType::Short}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// ASSERT_TRUE(loaned_value1->get_union_label(label) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(label == 0); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerUnionHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerUnionHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerStructureHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_float32_builder(); -// DynamicType_ptr base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_struct_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "field1", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "field2", base_type2) == ReturnCode_t::RETCODE_OK); - -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(loaned_value1, expected_types, &test_value_1, 0); -// check_get_values(loaned_value1, expected_types, &test_value_2, 0); -// ASSERT_TRUE(test_value_1 == test_value_2); - -// float test_value_3 = 123.0f; -// float test_value_4 = 0.0f; -// std::vector expected_types2 = {ExpectedType::Float}; -// check_set_values(loaned_value1, expected_types2, &test_value_3, 1); -// check_get_values(loaned_value1, expected_types2, &test_value_4, 1); -// ASSERT_TRUE(test_value_3 == test_value_4); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerStructureHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerStructureHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedWStringHelperInnerBitsetHelper) -// { -// uint32_t length = eprosima::fastrtps::types::BOUND_UNLIMITED; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_wstring_builder(1); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder = DynamicTypeBuilderFactory::get_instance()->create_byte_builder(); -// DynamicType_ptr base_type = base_type_builder->build(); -// ASSERT_TRUE(base_type_builder != nullptr); -// ASSERT_TRUE(base_type != nullptr); - -// DynamicTypeBuilder_ptr base_type_builder2 = DynamicTypeBuilderFactory::get_instance()->create_uint32_builder(); -// auto base_type2 = base_type_builder2->build(); -// ASSERT_TRUE(base_type_builder2 != nullptr); -// ASSERT_TRUE(base_type2 != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_bitset_builder(); -// ASSERT_TRUE(value_type_builder != nullptr); - -// // Add members to the struct. -// ASSERT_TRUE(value_type_builder->add_member(0, "a", base_type) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(value_type_builder->add_member(1, "b", base_type2) == ReturnCode_t::RETCODE_OK); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_BIT_BOUND_ID, "value", "2"); -// value_type_builder->apply_annotation_to_member(0, ANNOTATION_POSITION_ID, "value", "0"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_BIT_BOUND_ID, "value", "20"); -// value_type_builder->apply_annotation_to_member(1, ANNOTATION_POSITION_ID, "value", "10"); - -// DynamicType_ptr bitset_type = value_type_builder->build(); -// ASSERT_TRUE(bitset_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_wstring_value(L"2", MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Loan Complex values. -// DynamicData* loaned_value1 = data->loan_value(valueId); -// ASSERT_TRUE(loaned_value1 != nullptr); -// DynamicData* loaned_value2 = data->loan_value(valueId); -// ASSERT_FALSE(loaned_value2 != nullptr); - -// // Set and get the child values. -// octet test1(234); -// ASSERT_TRUE(loaned_value1->set_byte_value(test1, 0) == ReturnCode_t::RETCODE_OK); -// octet test2(0); -// ASSERT_TRUE(loaned_value1->get_byte_value(test2, 0) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test1 == test2); -// // 11101010 -// // 00000010 (two bits) -// ASSERT_TRUE(test2 == 2); -// uint32_t test3(289582314); -// ASSERT_TRUE(loaned_value1->set_uint32_value(test3, 1) == ReturnCode_t::RETCODE_OK); -// uint32_t test4(0); -// ASSERT_TRUE(loaned_value1->get_uint32_value(test4, 1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(test3 == test4); -// // 00000001010000101010110011101010 -// // 00000000000000101010110011101010 (20 bits) -// ASSERT_TRUE(test4 == 175338); - -// // Return the pointer -// ASSERT_TRUE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value1) == ReturnCode_t::RETCODE_OK); -// ASSERT_FALSE(data->return_loaned_value(loaned_value2) == ReturnCode_t::RETCODE_OK); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 2); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapInnerAliasBoundedWStringHelperInnerBitsetHelper wmap; -// MapInnerAliasBoundedWStringHelperInnerBitsetHelperPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// /******************* -// * BOUNDED_MAPS -// *******************/ -// #pragma region BOUNDED_MAPS - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_BoundedSmallMap) -// { -// uint32_t length = 1; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId2; -// MemberId valueId2; -// key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data->set_int32_value(2, MEMBER_ID_INVALID); -// ASSERT_FALSE(data->insert_map_data(key_data, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 1); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLong wmap; -// MapLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_BoundedLargeMap) -// { -// uint32_t length = 41925; //TO LONG FOR TIMEOUT? -// length = 10; -// { -// DynamicTypeBuilder_ptr key_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr key_type = key_type_builder->build(); -// ASSERT_TRUE(key_type_builder != nullptr); -// ASSERT_TRUE(key_type != nullptr); - -// DynamicTypeBuilder_ptr value_type_builder = DynamicTypeBuilderFactory::get_instance()->create_int32_builder(); -// DynamicType_ptr value_type = value_type_builder->build(); -// ASSERT_TRUE(value_type_builder != nullptr); -// ASSERT_TRUE(value_type != nullptr); - -// DynamicTypeBuilder_ptr map_type_builder = DynamicTypeBuilderFactory::get_instance()->create_map_builder(key_type_builder.get(), value_type_builder.get(), length); -// DynamicType_ptr map_type = map_type_builder->build(); -// ASSERT_TRUE(map_type_builder != nullptr); -// ASSERT_TRUE(map_type != nullptr); - -// DynamicData* data = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(data != nullptr); - -// // Set and get a value. -// int32_t test_value_1 = 123; -// int32_t test_value_2 = 0; - -// // Try to write on an empty position -// ASSERT_FALSE(data->set_int32_value(test_value_1, 0) == ReturnCode_t::RETCODE_OK); - -// MemberId keyId; -// MemberId valueId; -// DynamicData* key_data = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_TRUE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); - -// // Try to Add the same key twice. -// ASSERT_FALSE(data->insert_map_data(key_data, keyId, valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data) == ReturnCode_t::RETCODE_OK); - -// // Try to Add one more than the limit -// for(uint32_t i = 1; i < length; i++) -// { -// ASSERT_TRUE(data->get_item_count() == i); -// MemberId keyId2; -// MemberId valueId2; -// DynamicData* key_data2 = DynamicDataFactory::get_instance()->create_data(key_type); -// key_data2->set_int32_value(i, MEMBER_ID_INVALID); -// ASSERT_TRUE(data->insert_map_data(key_data2, keyId2, valueId2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data2) == ReturnCode_t::RETCODE_OK); - -// ASSERT_TRUE(data->get_item_count() == i+1); -// } -// MemberId keyId3; -// MemberId valueId3; -// DynamicData* key_data3 = DynamicDataFactory::get_instance()->create_data(key_type); -// ASSERT_FALSE(data->insert_map_data(key_data3, keyId3, valueId3) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(key_data3) == ReturnCode_t::RETCODE_OK); - -// std::vector expected_types = {ExpectedType::Long}; -// check_set_values(data, expected_types, &test_value_1, valueId); -// check_get_values(data, expected_types, &test_value_2, valueId); - -// ASSERT_TRUE(test_value_1 == test_value_2); - -// // Check items count with removes -// ASSERT_TRUE(data->get_item_count() == length); -// ASSERT_FALSE(data->remove_map_data(valueId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == length); -// ASSERT_TRUE(data->remove_map_data(keyId) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == length -1); -// ASSERT_TRUE(data->clear_all_values() == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(data->get_item_count() == 0); - -// // Serialize <-> Deserialize Test -// DynamicPubSubType pubsubType(map_type); -// uint32_t payloadSize = static_cast(pubsubType.getSerializedSizeProvider(data)()); -// SerializedPayload_t payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &payload)); -// ASSERT_TRUE(payload.length == payloadSize); - -// DynamicData* data2 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&payload, data2)); -// ASSERT_TRUE(data2->equals(data)); - -// // SERIALIZATION TEST -// MapLongLong wmap; -// MapLongLongPubSubType wmappb; - -// SerializedPayload_t dynamic_payload(payloadSize); -// ASSERT_TRUE(pubsubType.serialize(data, &dynamic_payload)); -// ASSERT_TRUE(wmappb.deserialize(&dynamic_payload, &wmap)); - -// uint32_t static_payloadSize = static_cast(wmappb.getSerializedSizeProvider(&wmap)()); -// SerializedPayload_t static_payload(static_payloadSize); -// ASSERT_TRUE(wmappb.serialize(&wmap, &static_payload)); -// ASSERT_TRUE(static_payload.length == static_payloadSize); -// DynamicData* data3 = DynamicDataFactory::get_instance()->create_data(map_type); -// ASSERT_TRUE(pubsubType.deserialize(&static_payload, data3)); -// ASSERT_TRUE(data3->equals(data)); - -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data2) == ReturnCode_t::RETCODE_OK); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->delete_data(data3) == ReturnCode_t::RETCODE_OK); -// } -// ASSERT_TRUE(DynamicTypeBuilderFactory::get_instance()->is_empty()); -// ASSERT_TRUE(DynamicDataFactory::get_instance()->is_empty()); -// } - -// #pragma endregion - -// #pragma endregion - } // dds } // fastdds } // eprosima diff --git a/test/feature/dynamic_types/DynamicTypesTests.cpp b/test/feature/dynamic_types/DynamicTypesTests.cpp index 567d9f1b56f..31cb7874e68 100644 --- a/test/feature/dynamic_types/DynamicTypesTests.cpp +++ b/test/feature/dynamic_types/DynamicTypesTests.cpp @@ -151,17 +151,6 @@ class DynamicTypesTests : public ::testing::Test return config_file_; } - struct order_member_desc - : public std::binary_function - { - result_type operator ()( - first_argument_type lhs, - second_argument_type rhs ) const - { - return lhs.index() < rhs.index(); - } - - }; }; @@ -10350,7 +10339,7 @@ TEST_F(DynamicTypesTests, DynamicType_array) type_descriptor->key_element_type(nullptr); } - BoundSeq array_dimensions {{ 2, 2, 2 }}; + BoundSeq array_dimensions {2, 2, 2}; DynamicTypeBuilder::_ref_type builder {factory->create_array_type( factory->get_primitive_type( @@ -10650,8 +10639,8 @@ TEST_F(DynamicTypesTests, DynamicType_array_of_arrays) { DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()}; - BoundSeq array_dimensions {{ 2, 2 }}; - BoundSeq inner_array_dimensions {{ 2 }}; + BoundSeq array_dimensions {2, 2}; + BoundSeq inner_array_dimensions {2}; DynamicTypeBuilder::_ref_type builder {factory->create_array_type( factory->get_primitive_type( diff --git a/test/feature/dynamic_types/dds_types_tests/DynamicTypesAliasesDDSTypesTests.cpp b/test/feature/dynamic_types/dds_types_tests/DynamicTypesAliasesDDSTypesTests.cpp index 431aaa665f7..3c246737a07 100644 --- a/test/feature/dynamic_types/dds_types_tests/DynamicTypesAliasesDDSTypesTests.cpp +++ b/test/feature/dynamic_types/dds_types_tests/DynamicTypesAliasesDDSTypesTests.cpp @@ -491,7 +491,7 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_AliasOctet) { TypeDescriptor::_ref_type type_descriptor {traits::make_shared()}; type_descriptor->kind(TK_STRUCTURE); - type_descriptor->name("AliasOctet"); + type_descriptor->name(struct_alias_octet_name); DynamicTypeBuilder::_ref_type type_builder {DynamicTypeBuilderFactory::get_instance()->create_type(type_descriptor)}; ASSERT_TRUE(type_builder); diff --git a/test/feature/dynamic_types/dds_types_tests/DynamicTypesArraysDDSTypesTests.cpp b/test/feature/dynamic_types/dds_types_tests/DynamicTypesArraysDDSTypesTests.cpp index cb8d370af60..9debe24a9e6 100644 --- a/test/feature/dynamic_types/dds_types_tests/DynamicTypesArraysDDSTypesTests.cpp +++ b/test/feature/dynamic_types/dds_types_tests/DynamicTypesArraysDDSTypesTests.cpp @@ -79,7 +79,6 @@ constexpr const char* bounded_wstring_multiarray_struct_name = "ArrayMultiDimens constexpr const char* enum_multiarray_struct_name = "ArrayMultiDimensionEnum"; constexpr const char* bitmask_multiarray_struct_name = "ArrayMultiDimensionBitMask"; constexpr const char* alias_multiarray_struct_name = "ArrayMultiDimensionAlias"; -constexpr const char* array_multiarray_struct_name = "ArrayMultiDimensionShortArray"; constexpr const char* seq_multiarray_struct_name = "ArrayMultiDimensionSequence"; constexpr const char* map_multiarray_struct_name = "ArrayMultiDimensionMap"; constexpr const char* union_multiarray_struct_name = "ArrayMultiDimensionUnion"; diff --git a/test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp b/test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp index 9a9b4b41aec..adbb6bab586 100644 --- a/test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp +++ b/test/feature/dynamic_types/dds_types_tests/DynamicTypesMapsDDSTypesTests.cpp @@ -560,10 +560,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortShort) ASSERT_TRUE(data); const std::unordered_map value { - {100, 1}, - {-100, 2}, - {50, -1}, - {-50, -2} + {std::int16_t(100), std::int16_t(1)}, + {std::int16_t(-100), std::int16_t(2)}, + {std::int16_t(50), std::int16_t(-1)}, + {std::int16_t(-50), std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_short_map)); @@ -625,10 +625,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortUShort) ASSERT_TRUE(data); const std::unordered_map value { - {100, 1u}, - {-100, 2u}, - {50, 100u}, - {-50, 200u} + {std::int16_t(100), std::uint16_t(1)}, + {std::int16_t(-100), std::uint16_t(2)}, + {std::int16_t(50), std::uint16_t(100)}, + {std::int16_t(-50), std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_ushort_map)); @@ -690,10 +690,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortLong) ASSERT_TRUE(data); const std::unordered_map value { - {100, 10000}, - {-100, 20000}, - {50, -10000}, - {-50, -20000} + {std::int16_t(100), 10000}, + {std::int16_t(-100), 20000}, + {std::int16_t(50), -10000}, + {std::int16_t(-50), -20000} }; int32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_long_map)); @@ -755,10 +755,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortULong) ASSERT_TRUE(data); const std::unordered_map value { - {100, 10000u}, - {-100, 20000u}, - {50, 1000000u}, - {-50, 2000000u} + {std::int16_t(100), 10000u}, + {std::int16_t(-100), 20000u}, + {std::int16_t(50), 1000000u}, + {std::int16_t(-50), 2000000u} }; uint32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_ulong_map)); @@ -820,10 +820,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortLongLong) ASSERT_TRUE(data); const std::unordered_map value { - {100, 100000000}, - {-100, 200000000}, - {50, -100000000}, - {-50, -200000000} + {std::int16_t(100), 100000000}, + {std::int16_t(-100), 200000000}, + {std::int16_t(50), -100000000}, + {std::int16_t(-50), -200000000} }; int64_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_longlong_map)); @@ -885,10 +885,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortULongLong) ASSERT_TRUE(data); const std::unordered_map value { - {100, 100000000u}, - {-100, 200000000u}, - {50, 10000000000u}, - {-50, 20000000000u} + {std::int16_t(100), 100000000u}, + {std::int16_t(-100), 200000000u}, + {std::int16_t(50), 10000000000u}, + {std::int16_t(-50), 20000000000u} }; uint64_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_ulonglong_map)); @@ -950,10 +950,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortFloat) ASSERT_TRUE(data); const std::unordered_map value { - {100, 3.1f}, - {-100, 100.1f}, - {50, -100.3f}, - {-50, -200.3f} + {std::int16_t(100), 3.1f}, + {std::int16_t(-100), 100.1f}, + {std::int16_t(50), -100.3f}, + {std::int16_t(-50), -200.3f} }; float test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_float_map)); @@ -1015,10 +1015,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortDouble) ASSERT_TRUE(data); const std::unordered_map value { - {100, 100000000.3}, - {-100, 200000000.3}, - {50, -10000000000.5}, - {-50, -20000000000.5} + {std::int16_t(100), 100000000.3}, + {std::int16_t(-100), 200000000.3}, + {std::int16_t(50), -10000000000.5}, + {std::int16_t(-50), -20000000000.5} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_double_map)); @@ -1080,10 +1080,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortLongDouble) ASSERT_TRUE(data); const std::unordered_map value { - {100, 100000000.3}, - {-100, 200000000.3}, - {50, -10000000000.5}, - {-50, -20000000000.5} + {std::int16_t(100), 100000000.3}, + {std::int16_t(-100), 200000000.3}, + {std::int16_t(50), -10000000000.5}, + {std::int16_t(-50), -20000000000.5} }; long double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_longdouble_map)); @@ -1145,10 +1145,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortBoolean) ASSERT_TRUE(data); const std::unordered_map value { - {100, true}, - {-100, false}, - {50, true}, - {-50, false} + {std::int16_t(100), true}, + {std::int16_t(-100), false}, + {std::int16_t(50), true}, + {std::int16_t(-50), false} }; bool test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_boolean_map)); @@ -1210,10 +1210,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortOctet) ASSERT_TRUE(data); const std::unordered_map value { - {100, 1u}, - {-100, 2u}, - {50, 100u}, - {-50, 200u} + {std::int16_t(100), fastrtps::rtps::octet(1)}, + {std::int16_t(-100), fastrtps::rtps::octet(2)}, + {std::int16_t(50), fastrtps::rtps::octet(100)}, + {std::int16_t(-50), fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_octet_map)); @@ -1275,10 +1275,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortChar) ASSERT_TRUE(data); const std::unordered_map value { - {100, 'a'}, - {-100, 'A'}, - {50, '{'}, - {-50, '}'} + {std::int16_t(100), 'a'}, + {std::int16_t(-100), 'A'}, + {std::int16_t(50), '{'}, + {std::int16_t(-50), '}'} }; char test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_char_map)); @@ -1340,10 +1340,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortWChar) ASSERT_TRUE(data); const std::unordered_map value { - {100, L'a'}, - {-100, L'A'}, - {50, L'{'}, - {-50, L'}'} + {std::int16_t(100), L'a'}, + {std::int16_t(-100), L'A'}, + {std::int16_t(50), L'{'}, + {std::int16_t(-50), L'}'} }; wchar_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_wchar_map)); @@ -1406,10 +1406,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortString) ASSERT_TRUE(data); const std::map value { - {-100, "we"}, - {-50, "are"}, - {50, "testing"}, - {600, "things"} + {std::int16_t(-100), "we"}, + {std::int16_t(-50), "are"}, + {std::int16_t(50), "testing"}, + {std::int16_t(600), "things"} }; std::string test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_string_map)); @@ -1472,10 +1472,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortWString) ASSERT_TRUE(data); const std::map value { - {-100, L"we"}, - {-50, L"are"}, - {50, L"testing"}, - {600, L"things"} + {std::int16_t(-100), L"we"}, + {std::int16_t(-50), L"are"}, + {std::int16_t(50), L"testing"}, + {std::int16_t(600), L"things"} }; std::wstring test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_wstring_map)); @@ -1537,10 +1537,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasBoundedStringHel ASSERT_TRUE(data); const std::map value { - {-100, "we"}, - {-50, "are"}, - {50, "testing"}, - {600, "things"} + {std::int16_t(-100), "we"}, + {std::int16_t(-50), "are"}, + {std::int16_t(50), "testing"}, + {std::int16_t(600), "things"} }; std::string test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_inneraliasboundedstringhelper_map)); @@ -1602,10 +1602,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasBoundedWStringHe ASSERT_TRUE(data); const std::map value { - {-100, L"we"}, - {-50, L"are"}, - {50, L"testing"}, - {600, L"things"} + {std::int16_t(-100), L"we"}, + {std::int16_t(-50), L"are"}, + {std::int16_t(50), L"testing"}, + {std::int16_t(600), L"things"} }; std::wstring test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_inneraliasboundedwstringhelper_map)); @@ -1667,10 +1667,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerEnumHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, InnerEnumHelper::ENUM_VALUE_2}, - {50, InnerEnumHelper::ENUM_VALUE_1}, - {600, InnerEnumHelper::ENUM_VALUE_3}, - {-50, InnerEnumHelper::ENUM_VALUE_2} + {std::int16_t(-100), InnerEnumHelper::ENUM_VALUE_2}, + {std::int16_t(50), InnerEnumHelper::ENUM_VALUE_1}, + {std::int16_t(600), InnerEnumHelper::ENUM_VALUE_3}, + {std::int16_t(-50), InnerEnumHelper::ENUM_VALUE_2} }; uint32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_innerenumhelper_map)); @@ -1732,10 +1732,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerBitMaskHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, InnerBitMaskHelperBits::flag0}, - {50, 0u}, - {600, InnerBitMaskHelperBits::flag6 | InnerBitMaskHelperBits::flag0}, - {-50, InnerBitMaskHelperBits::flag4} + {std::int16_t(-100), InnerBitMaskHelperBits::flag0}, + {std::int16_t(50), 0u}, + {std::int16_t(600), InnerBitMaskHelperBits::flag6 | InnerBitMaskHelperBits::flag0}, + {std::int16_t(-50), InnerBitMaskHelperBits::flag4} }; uint32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_innerbitmaskhelper_map)); @@ -1797,10 +1797,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 102}, - {50, 1}, - {600, -32}, - {-50, 43} + {std::int16_t(-100), 102}, + {std::int16_t(50), 1}, + {std::int16_t(600), -32}, + {std::int16_t(-50), 43} }; int32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_inneraliashelper_map)); @@ -1862,10 +1862,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, {{102, -102}} }, - {50, {{1, -1}} }, - {600, {{-32, 32}} }, - {-50, {{43, -43}} } + {std::int16_t(-100), {102, -102} }, + {std::int16_t(50), {1, -1} }, + {std::int16_t(600), {-32, 32} }, + {std::int16_t(-50), {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_inneraliasarrayhelper_map)); @@ -1927,10 +1927,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasSequenceHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, {{102, -102, 304, -304}} }, - {50, {{}} }, - {600, {{-32}} }, - {-50, {{43, -43}} } + {std::int16_t(-100), {102, -102, 304, -304} }, + {std::int16_t(50), {} }, + {std::int16_t(600), {-32} }, + {std::int16_t(-50), {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_inneraliassequencehelper_map)); @@ -1992,18 +1992,18 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerAliasMapHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-100, { + {std::int16_t(-100), { {1000, -102}, {2000, -103}, {-100, 1000} }}, - {50, { + {std::int16_t(50), { }}, - {600, { + {std::int16_t(600), { {-1000, 102}, {-2000, 103} }}, - {-50, { + {std::int16_t(-50), { {-3000, 302}, }} }; @@ -2082,10 +2082,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-100, {union_long_member_name, 32}}, - {50, {union_float_member_name, -12}}, - {600, {union_short_member_name, 1}}, - {-50, {union_long_member_name, -32}} + {std::int16_t(-100), {union_long_member_name, std::int16_t(32)}}, + {std::int16_t(50), {union_float_member_name, std::int16_t(-12)}}, + {std::int16_t(600), {union_short_member_name, std::int16_t(1)}}, + {std::int16_t(-50), {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_short_innerunionhelper_map)); @@ -2167,10 +2167,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerStructureHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-100, {32, 1.0f}}, - {50, {-12, -1.0f}}, - {600, {1, -10.1f}}, - {-50, {-32, 100.3f}} + {std::int16_t(-100), {32, 1.0f}}, + {std::int16_t(50), {-12, -1.0f}}, + {std::int16_t(600), {1, -10.1f}}, + {std::int16_t(-50), {-32, 100.3f}} }; int32_t test_value1; float test_value2; @@ -2249,9 +2249,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapShortInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-100, {5u, true, 1000u, 2000}}, - {50, {7u, false, 555u, 20}}, - {600, {0u, true, 0u, 0}} + {std::int16_t(-100), {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {std::int16_t(50), {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {std::int16_t(600), {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -2350,10 +2350,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortShort) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1}, - {200u, 2}, - {50u, -1}, - {70u, -2} + {std::uint16_t(100), std::int16_t(1)}, + {std::uint16_t(200), std::int16_t(2)}, + {std::uint16_t(50), std::int16_t(-1)}, + {std::uint16_t(70), std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_short_map)); @@ -2415,10 +2415,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortUShort) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1u}, - {200u, 2u}, - {50u, 100u}, - {70u, 200u} + {std::uint16_t(100), std::uint16_t(1)}, + {std::uint16_t(200), std::uint16_t(2)}, + {std::uint16_t(50), std::uint16_t(100)}, + {std::uint16_t(70), std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_ushort_map)); @@ -2480,10 +2480,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortLong) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 10000}, - {200u, 20000}, - {50u, -10000}, - {70u, -20000} + {std::uint16_t(100), 10000}, + {std::uint16_t(200), 20000}, + {std::uint16_t(50), -10000}, + {std::uint16_t(70), -20000} }; int32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_long_map)); @@ -2545,10 +2545,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortULong) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 10000u}, - {200u, 20000u}, - {50u, 1000000u}, - {70u, 2000000u} + {std::uint16_t(100), 10000u}, + {std::uint16_t(200), 20000u}, + {std::uint16_t(50), 1000000u}, + {std::uint16_t(70), 2000000u} }; uint32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_ulong_map)); @@ -2610,10 +2610,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortLongLong) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 100000000}, - {200u, 200000000}, - {50u, -100000000}, - {70u, -200000000} + {std::uint16_t(100), 100000000}, + {std::uint16_t(200), 200000000}, + {std::uint16_t(50), -100000000}, + {std::uint16_t(70), -200000000} }; int64_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_longlong_map)); @@ -2675,10 +2675,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortULongLong) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 100000000u}, - {200u, 200000000u}, - {50u, 10000000000u}, - {70u, 20000000000u} + {std::uint16_t(100), 100000000u}, + {std::uint16_t(200), 200000000u}, + {std::uint16_t(50), 10000000000u}, + {std::uint16_t(70), 20000000000u} }; uint64_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_ulonglong_map)); @@ -2740,10 +2740,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortFloat) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 3.1f}, - {200u, 100.1f}, - {50u, -100.3f}, - {70u, -200.3f} + {std::uint16_t(100), 3.1f}, + {std::uint16_t(200), 100.1f}, + {std::uint16_t(50), -100.3f}, + {std::uint16_t(70), -200.3f} }; float test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_float_map)); @@ -2805,10 +2805,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortDouble) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 100000000.3}, - {200u, 200000000.3}, - {50u, -10000000000.5}, - {70u, -20000000000.5} + {std::uint16_t(100), 100000000.3}, + {std::uint16_t(200), 200000000.3}, + {std::uint16_t(50), -10000000000.5}, + {std::uint16_t(70), -20000000000.5} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_double_map)); @@ -2870,10 +2870,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortLongDouble) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 100000000.3}, - {200u, 200000000.3}, - {50u, -10000000000.5}, - {70u, -20000000000.5} + {std::uint16_t(100), 100000000.3}, + {std::uint16_t(200), 200000000.3}, + {std::uint16_t(50), -10000000000.5}, + {std::uint16_t(70), -20000000000.5} }; long double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_longdouble_map)); @@ -2935,10 +2935,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortBoolean) ASSERT_TRUE(data); const std::unordered_map value { - {100u, true}, - {200u, false}, - {50u, true}, - {70u, false} + {std::uint16_t(100), true}, + {std::uint16_t(200), false}, + {std::uint16_t(50), true}, + {std::uint16_t(70), false} }; bool test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_boolean_map)); @@ -3000,10 +3000,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortOctet) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1u}, - {200u, 2u}, - {50u, 100u}, - {70u, 200u} + {std::uint16_t(100), fastrtps::rtps::octet(1)}, + {std::uint16_t(200), fastrtps::rtps::octet(2)}, + {std::uint16_t(50), fastrtps::rtps::octet(100)}, + {std::uint16_t(70), fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_octet_map)); @@ -3065,10 +3065,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortChar) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 'a'}, - {200u, 'A'}, - {50u, '{'}, - {70u, '}'} + {std::uint16_t(100), 'a'}, + {std::uint16_t(200), 'A'}, + {std::uint16_t(50), '{'}, + {std::uint16_t(70), '}'} }; char test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_char_map)); @@ -3130,10 +3130,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortWChar) ASSERT_TRUE(data); const std::unordered_map value { - {100u, L'a'}, - {200u, L'A'}, - {50u, L'{'}, - {70u, L'}'} + {std::uint16_t(100), L'a'}, + {std::uint16_t(200), L'A'}, + {std::uint16_t(50), L'{'}, + {std::uint16_t(70), L'}'} }; wchar_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_wchar_map)); @@ -3196,10 +3196,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortString) ASSERT_TRUE(data); const std::map value { - {10, "we"}, - {40, "are"}, - {50, "testing"}, - {600, "things"} + {std::uint16_t(10), "we"}, + {std::uint16_t(40), "are"}, + {std::uint16_t(50), "testing"}, + {std::uint16_t(600), "things"} }; std::string test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_string_map)); @@ -3262,10 +3262,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortWString) ASSERT_TRUE(data); const std::map value { - {10, L"we"}, - {40, L"are"}, - {50, L"testing"}, - {600, L"things"} + {std::uint16_t(1), L"we"}, + {std::uint16_t(4), L"are"}, + {std::uint16_t(5), L"testing"}, + {std::uint16_t(60), L"things"} }; std::wstring test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_wstring_map)); @@ -3327,10 +3327,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasBoundedStringHe ASSERT_TRUE(data); const std::map value { - {10, "we"}, - {40, "are"}, - {50, "testing"}, - {600, "things"} + {std::uint16_t(10), "we"}, + {std::uint16_t(40), "are"}, + {std::uint16_t(50), "testing"}, + {std::uint16_t(600), "things"} }; std::string test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_inneraliasboundedstringhelper_map)); @@ -3392,10 +3392,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasBoundedWStringH ASSERT_TRUE(data); const std::map value { - {10, L"we"}, - {40, L"are"}, - {50, L"testing"}, - {600, L"things"} + {std::uint16_t(10), L"we"}, + {std::uint16_t(40), L"are"}, + {std::uint16_t(50), L"testing"}, + {std::uint16_t(600), L"things"} }; std::wstring test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_inneraliasboundedwstringhelper_map)); @@ -3457,10 +3457,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerEnumHelper) ASSERT_TRUE(data); const std::unordered_map value { - {100u, InnerEnumHelper::ENUM_VALUE_2}, - {50u, InnerEnumHelper::ENUM_VALUE_1}, - {600u, InnerEnumHelper::ENUM_VALUE_3}, - {70u, InnerEnumHelper::ENUM_VALUE_2} + {std::uint16_t(100), InnerEnumHelper::ENUM_VALUE_2}, + {std::uint16_t(50), InnerEnumHelper::ENUM_VALUE_1}, + {std::uint16_t(600), InnerEnumHelper::ENUM_VALUE_3}, + {std::uint16_t(70), InnerEnumHelper::ENUM_VALUE_2} }; uint32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_innerenumhelper_map)); @@ -3523,10 +3523,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerBitMaskHelper) ASSERT_TRUE(data); const std::unordered_map value { - {100u, InnerBitMaskHelperBits::flag0}, - {50u, 0}, - {600u, InnerBitMaskHelperBits::flag6 | InnerBitMaskHelperBits::flag0}, - {70u, InnerBitMaskHelperBits::flag4} + {std::uint16_t(100), InnerBitMaskHelperBits::flag0}, + {std::uint16_t(50), 0}, + {std::uint16_t(600), InnerBitMaskHelperBits::flag6 | InnerBitMaskHelperBits::flag0}, + {std::uint16_t(70), InnerBitMaskHelperBits::flag4} }; uint32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_innerbitmaskhelper_map)); @@ -3588,10 +3588,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasHelper) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 102}, - {50u, 1}, - {600u, -32}, - {70u, 43} + {std::uint16_t(100), 102}, + {std::uint16_t(50), 1}, + {std::uint16_t(600), -32}, + {std::uint16_t(70), 43} }; int32_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_inneraliashelper_map)); @@ -3653,10 +3653,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {100u, {{102, -102}} }, - {50u, {{1, -1}} }, - {600u, {{-32, 32}} }, - {70u, {{43, -43}} } + {std::uint16_t(100), {102, -102} }, + {std::uint16_t(50), {1, -1} }, + {std::uint16_t(600), {-32, 32} }, + {std::uint16_t(70), {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_inneraliasarrayhelper_map)); @@ -3718,10 +3718,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasSequenceHelper) ASSERT_TRUE(data); const std::unordered_map value { - {10u, {{102, -102, 304, -304}} }, - {50u, {{}} }, - {60u, {{-32}} }, - {70u, {{43, -43}} } + {std::uint16_t(10), {102, -102, 304, -304} }, + {std::uint16_t(50), {} }, + {std::uint16_t(60), {-32} }, + {std::uint16_t(70), {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_inneraliassequencehelper_map)); @@ -3783,18 +3783,18 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerAliasMapHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {100u, { + {std::uint16_t(100), { {1000, -102}, {2000, -103}, {-100, 1000} }}, - {50u, { + {std::uint16_t(50), { }}, - {600u, { + {std::uint16_t(600), { {-1000, 102}, {-2000, 103} }}, - {70u, { + {std::uint16_t(70), { {-3000, 302}, }} }; @@ -3873,10 +3873,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {10u, {union_long_member_name, 32}}, - {50u, {union_float_member_name, -12}}, - {60u, {union_short_member_name, 1}}, - {70u, {union_long_member_name, -32}} + {std::uint16_t(10), {union_long_member_name, std::int16_t(32)}}, + {std::uint16_t(50), {union_float_member_name, std::int16_t(-12)}}, + {std::uint16_t(60), {union_short_member_name, std::int16_t(1)}}, + {std::uint16_t(70), {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ushort_innerunionhelper_map)); @@ -3958,10 +3958,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerStructureHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {100u, {32, 1.0f}}, - {50u, {-12, -1.0f}}, - {600u, {1, -10.1f}}, - {70u, {-32, 100.3f}} + {std::uint16_t(100), {32, 1.0f}}, + {std::uint16_t(50), {-12, -1.0f}}, + {std::uint16_t(600), {1, -10.1f}}, + {std::uint16_t(70), {-32, 100.3f}} }; int32_t test_value1; float test_value2; @@ -4040,9 +4040,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapUShortInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {100u, {5u, true, 1000u, 2000}}, - {50u, {7u, false, 555u, 20}}, - {600u, {0u, true, 0u, 0}} + {std::uint16_t(100), {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {std::uint16_t(50), {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {std::uint16_t(600), {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -4141,10 +4141,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongShort) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 1}, - {200, 2}, - {-50, -1}, - {70, -2} + {-100, std::int16_t(1)}, + {200, std::int16_t(2)}, + {-50, std::int16_t(-1)}, + {70, std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_long_short_map)); @@ -4206,10 +4206,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongUShort) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 1u}, - {200, 2u}, - {-50, 100u}, - {70, 200u} + {-100, std::uint16_t(1)}, + {200, std::uint16_t(2)}, + {-50, std::uint16_t(100)}, + {70, std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_long_ushort_map)); @@ -4791,10 +4791,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongOctet) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 1u}, - {200, 2u}, - {-50, 100u}, - {70, 200u} + {-100, fastrtps::rtps::octet(1)}, + {200, fastrtps::rtps::octet(2)}, + {-50, fastrtps::rtps::octet(100)}, + {70, fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_long_octet_map)); @@ -5443,10 +5443,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, {{102, -102}} }, - {50, {{1, -1}} }, - {-600, {{-32, 32}} }, - {70, {{43, -43}} } + {-100, {102, -102} }, + {50, {1, -1} }, + {-600, {-32, 32} }, + {70, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_long_inneraliasarrayhelper_map)); @@ -5508,10 +5508,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerAliasSequenceHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-10, {{102, -102, 304, -304}} }, - {-50, {{}} }, - {60, {{-32}} }, - {70, {{43, -43}} } + {-10, {102, -102, 304, -304} }, + {-50, {} }, + {60, {-32} }, + {70, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_long_inneraliassequencehelper_map)); @@ -5663,10 +5663,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-10, {union_long_member_name, 32}}, - {-50, {union_float_member_name, -12}}, - {60, {union_short_member_name, 1}}, - {70, {union_long_member_name, -32}} + {-10, {union_long_member_name, std::int16_t(32)}}, + {-50, {union_float_member_name, std::int16_t(-12)}}, + {60, {union_short_member_name, std::int16_t(1)}}, + {70, {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_long_innerunionhelper_map)); @@ -5830,9 +5830,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-100, {5u, true, 1000u, 2000}}, - {50, {7u, false, 555u, 20}}, - {600, {0u, true, 0u, 0}} + {-100, {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {50, {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {600, {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -5931,10 +5931,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongShort) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1}, - {200u, 2}, - {50u, -1}, - {70u, -2} + {100u, std::int16_t(1)}, + {200u, std::int16_t(2)}, + {50u, std::int16_t(-1)}, + {70u, std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulong_short_map)); @@ -5996,10 +5996,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongUShort) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1u}, - {200u, 2u}, - {50u, 100u}, - {70u, 200u} + {100u, std::uint16_t(1)}, + {200u, std::uint16_t(2)}, + {50u, std::uint16_t(100)}, + {70u, std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulong_ushort_map)); @@ -6581,10 +6581,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongOctet) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1u}, - {200u, 2u}, - {50u, 100u}, - {70u, 200u} + {100u, fastrtps::rtps::octet(1)}, + {200u, fastrtps::rtps::octet(2)}, + {50u, fastrtps::rtps::octet(100)}, + {70u, fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulong_octet_map)); @@ -7233,10 +7233,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {100u, {{102, -102}} }, - {50u, {{1, -1}} }, - {600u, {{-32, 32}} }, - {70u, {{43, -43}} } + {100u, {102, -102} }, + {50u, {1, -1} }, + {600u, {-32, 32} }, + {70u, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulong_inneraliasarrayhelper_map)); @@ -7298,10 +7298,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerAliasSequenceHelper) ASSERT_TRUE(data); const std::unordered_map value { - {10u, {{102, -102, 304, -304}} }, - {50u, {{}} }, - {60u, {{-32}} }, - {70u, {{43, -43}} } + {10u, {102, -102, 304, -304} }, + {50u, {} }, + {60u, {-32} }, + {70u, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulong_inneraliassequencehelper_map)); @@ -7453,10 +7453,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {10u, {union_long_member_name, 32}}, - {50u, {union_float_member_name, -12}}, - {60u, {union_short_member_name, 1}}, - {70u, {union_long_member_name, -32}} + {10u, {union_long_member_name, std::int16_t(32)}}, + {50u, {union_float_member_name, std::int16_t(-12)}}, + {60u, {union_short_member_name, std::int16_t(1)}}, + {70u, {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulong_innerunionhelper_map)); @@ -7620,9 +7620,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {100u, {5u, true, 1000u, 2000}}, - {50u, {7u, false, 555u, 20}}, - {600u, {0u, true, 0u, 0}} + {100u, {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {50u, {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {600u, {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -7721,10 +7721,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongShort) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 1}, - {200, 2}, - {-50, -1}, - {70, -2} + {-100, std::int16_t(1)}, + {200, std::int16_t(2)}, + {-50, std::int16_t(-1)}, + {70, std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_longlong_short_map)); @@ -7786,10 +7786,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongUShort) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 1u}, - {200, 2u}, - {-50, 100u}, - {70, 200u} + {-100, std::uint16_t(1)}, + {200, std::uint16_t(2)}, + {-50, std::uint16_t(100)}, + {70, std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_longlong_ushort_map)); @@ -8371,10 +8371,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongOctet) ASSERT_TRUE(data); const std::unordered_map value { - {-100, 1u}, - {200, 2u}, - {-50, 100u}, - {70, 200u} + {-100, fastrtps::rtps::octet(1)}, + {200, fastrtps::rtps::octet(2)}, + {-50, fastrtps::rtps::octet(100)}, + {70, fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_longlong_octet_map)); @@ -9023,10 +9023,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {-100, {{102, -102}} }, - {50, {{1, -1}} }, - {-600, {{-32, 32}} }, - {70, {{43, -43}} } + {-100, {102, -102} }, + {50, {1, -1} }, + {-600, {-32, 32} }, + {70, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_longlong_inneraliasarrayhelper_map)); @@ -9088,10 +9088,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerAliasSequenceHelpe ASSERT_TRUE(data); const std::unordered_map value { - {-10, {{102, -102, 304, -304}} }, - {-50, {{}} }, - {60, {{-32}} }, - {70, {{43, -43}} } + {-10, {102, -102, 304, -304} }, + {-50, {} }, + {60, {-32} }, + {70, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_longlong_inneraliassequencehelper_map)); @@ -9243,10 +9243,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-10, {union_long_member_name, 32}}, - {-50, {union_float_member_name, -12}}, - {60, {union_short_member_name, 1}}, - {70, {union_long_member_name, -32}} + {-10, {union_long_member_name, std::int16_t(32)}}, + {-50, {union_float_member_name, std::int16_t(-12)}}, + {60, {union_short_member_name, std::int16_t(1)}}, + {70, {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_longlong_innerunionhelper_map)); @@ -9410,9 +9410,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapLongLongInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {-100, {5u, true, 1000u, 2000}}, - {50, {7u, false, 555u, 20}}, - {600, {0u, true, 0u, 0}} + {-100, {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {50, {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {600, {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -9511,10 +9511,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongShort) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1}, - {200u, 2}, - {50u, -1}, - {70u, -2} + {100u, std::int16_t(1)}, + {200u, std::int16_t(2)}, + {50u, std::int16_t(-1)}, + {70u, std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulonglong_short_map)); @@ -9576,10 +9576,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongUShort) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1u}, - {200u, 2u}, - {50u, 100u}, - {70u, 200u} + {100u, std::uint16_t(1)}, + {200u, std::uint16_t(2)}, + {50u, std::uint16_t(100)}, + {70u, std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulonglong_ushort_map)); @@ -10161,10 +10161,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongOctet) ASSERT_TRUE(data); const std::unordered_map value { - {100u, 1u}, - {200u, 2u}, - {50u, 100u}, - {70u, 200u} + {100u, fastrtps::rtps::octet(1)}, + {200u, fastrtps::rtps::octet(2)}, + {50u, fastrtps::rtps::octet(100)}, + {70u, fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulonglong_octet_map)); @@ -10813,10 +10813,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {100u, {{102, -102}} }, - {50u, {{1, -1}} }, - {600u, {{-32, 32}} }, - {70u, {{43, -43}} } + {100u, {102, -102} }, + {50u, {1, -1} }, + {600u, {-32, 32} }, + {70u, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulonglong_inneraliasarrayhelper_map)); @@ -10878,10 +10878,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerAliasSequenceHelp ASSERT_TRUE(data); const std::unordered_map value { - {10u, {{102, -102, 304, -304}} }, - {50u, {{}} }, - {60u, {{-32}} }, - {70u, {{43, -43}} } + {10u, {102, -102, 304, -304} }, + {50u, {} }, + {60u, {-32} }, + {70u, {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulonglong_inneraliassequencehelper_map)); @@ -11033,10 +11033,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {10u, {union_long_member_name, 32}}, - {50u, {union_float_member_name, -12}}, - {60u, {union_short_member_name, 1}}, - {70u, {union_long_member_name, -32}} + {10u, {union_long_member_name, std::int16_t(32)}}, + {50u, {union_float_member_name, std::int16_t(-12)}}, + {60u, {union_short_member_name, std::int16_t(1)}}, + {70u, {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_ulonglong_innerunionhelper_map)); @@ -11200,9 +11200,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapULongLongInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {100u, {5u, true, 1000u, 2000}}, - {50u, {7u, false, 555u, 20}}, - {600u, {0u, true, 0u, 0}} + {100u, {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {50u, {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {600u, {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -11302,10 +11302,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringShort) ASSERT_TRUE(data); const std::unordered_map value { - {"we", 1}, - {"are", 2}, - {"testing", -1}, - {"things", -2} + {"we", std::int16_t(1)}, + {"are", std::int16_t(2)}, + {"testing", std::int16_t(-1)}, + {"things", std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_string_short_map)); @@ -11367,10 +11367,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringUShort) ASSERT_TRUE(data); const std::unordered_map value { - {"we", 1u}, - {"are", 2u}, - {"testing", 100u}, - {"things", 200u} + {"we", std::uint16_t(1)}, + {"are", std::uint16_t(2)}, + {"testing", std::uint16_t(100)}, + {"things", std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_string_ushort_map)); @@ -11952,10 +11952,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringOctet) ASSERT_TRUE(data); const std::unordered_map value { - {"we", 1u}, - {"are", 2u}, - {"testing", 100u}, - {"things", 200u} + {"we", fastrtps::rtps::octet(1)}, + {"are", fastrtps::rtps::octet(2)}, + {"testing", fastrtps::rtps::octet(100)}, + {"things", fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_string_octet_map)); @@ -12604,10 +12604,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasArrayHelper) ASSERT_TRUE(data); const std::unordered_map value { - {"we", {{102, -102}} }, - {"are", {{1, -1}} }, - {"testing", {{-32, 32}} }, - {"things", {{43, -43}} } + {"we", {102, -102} }, + {"are", {1, -1} }, + {"testing", {-32, 32} }, + {"things", {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_string_inneraliasarrayhelper_map)); @@ -12669,10 +12669,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerAliasSequenceHelper) ASSERT_TRUE(data); const std::unordered_map value { - {"we", {{102, -102, 304, -304}} }, - {"are", {{}} }, - {"testing", {{-32}} }, - {"things", {{43, -43}} } + {"we", {102, -102, 304, -304} }, + {"are", {} }, + {"testing", {-32} }, + {"things", {43, -43} } }; Int16Seq test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_string_inneraliassequencehelper_map)); @@ -12825,10 +12825,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerUnionHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {"we", {union_long_member_name, 32}}, - {"are", {union_float_member_name, -12}}, - {"testing", {union_short_member_name, 1}}, - {"things", {union_long_member_name, -32}} + {"we", {union_long_member_name, std::int16_t(32)}}, + {"are", {union_float_member_name, std::int16_t(-12)}}, + {"testing", {union_short_member_name, std::int16_t(1)}}, + {"things", {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_string_innerunionhelper_map)); @@ -12994,9 +12994,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapStringInnerBitsetHelper) ASSERT_TRUE(data); const std::unordered_map> value { - {"we", {5u, true, 1000u, 2000}}, - {"are", {7u, false, 555u, 20}}, - {"testing", {0u, true, 0u, 0}} + {"we", {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {"are", {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {"testing", {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; @@ -13097,10 +13097,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperSh ASSERT_TRUE(data); const std::unordered_map value { - {"we", 1}, - {"are", 2}, - {"testing", -1}, - {"things", -2} + {"we", std::int16_t(1)}, + {"are", std::int16_t(2)}, + {"testing", std::int16_t(-1)}, + {"things", std::int16_t(-2)} }; int16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_inneraliasboundedstringhelper_short_map)); @@ -13161,10 +13161,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperUS ASSERT_TRUE(data); const std::unordered_map value { - {"we", 1u}, - {"are", 2u}, - {"testing", 100u}, - {"things", 200u} + {"we", std::uint16_t(1)}, + {"are", std::uint16_t(2)}, + {"testing", std::uint16_t(100)}, + {"things", std::uint16_t(200)} }; uint16_t test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_inneraliasboundedstringhelper_ushort_map)); @@ -13737,10 +13737,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperOc ASSERT_TRUE(data); const std::unordered_map value { - {"we", 1u}, - {"are", 2u}, - {"testing", 100u}, - {"things", 200u} + {"we", fastrtps::rtps::octet(1)}, + {"are", fastrtps::rtps::octet(2)}, + {"testing", fastrtps::rtps::octet(100)}, + {"things", fastrtps::rtps::octet(200)} }; fastrtps::rtps::octet test_value; auto map_data = data->loan_value(data->get_member_id_by_name(var_inneraliasboundedstringhelper_octet_map)); @@ -14391,10 +14391,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperIn ASSERT_TRUE(data); const std::unordered_map value { - {"we", {{102, -102}} }, - {"are", {{1, -1}} }, - {"testing", {{-32, 32}} }, - {"things", {{43, -43}} } + {"we", {102, -102} }, + {"are", {1, -1} }, + {"testing", {-32, 32} }, + {"things", {43, -43} } }; Int16Seq test_value; auto map_data = @@ -14457,10 +14457,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperIn ASSERT_TRUE(data); const std::unordered_map value { - {"we", {{102, -102, 304, -304}} }, - {"are", {{}} }, - {"testing", {{-32}} }, - {"things", {{43, -43}} } + {"we", {102, -102, 304, -304} }, + {"are", {} }, + {"testing", {-32} }, + {"things", {43, -43} } }; Int16Seq test_value; auto map_data = @@ -14616,10 +14616,10 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperIn ASSERT_TRUE(data); const std::unordered_map> value { - {"we", {union_long_member_name, 32}}, - {"are", {union_float_member_name, -12}}, - {"testing", {union_short_member_name, 1}}, - {"things", {union_long_member_name, -32}} + {"we", {union_long_member_name, std::int16_t(32)}}, + {"are", {union_float_member_name, std::int16_t(-12)}}, + {"testing", {union_short_member_name, std::int16_t(1)}}, + {"things", {union_long_member_name, std::int16_t(-32)}} }; double test_value; auto map_data = @@ -14786,9 +14786,9 @@ TEST_F(DynamicTypesDDSTypesTest, DDSTypesTest_MapInnerAliasBoundedStringHelperIn ASSERT_TRUE(data); const std::unordered_map> value { - {"we", {5u, true, 1000u, 2000}}, - {"are", {7u, false, 555u, 20}}, - {"testing", {0u, true, 0u, 0}} + {"we", {std::uint8_t(5), true, std::uint16_t(1000), std::int16_t(2000)}}, + {"are", {std::uint8_t(7), false, std::uint16_t(555), std::int16_t(20)}}, + {"testing", {std::uint8_t(0), true, std::uint16_t(0), std::int16_t(0)}} }; uint8_t test_value1; bool test_value2; diff --git a/thirdparty/fastcdr b/thirdparty/fastcdr index e8c88ed38ef..8ceade3fa45 160000 --- a/thirdparty/fastcdr +++ b/thirdparty/fastcdr @@ -1 +1 @@ -Subproject commit e8c88ed38ef22e62f2febbf7d285bb93607ce7db +Subproject commit 8ceade3fa45c2bf4bd536a8dab5f1e27aeab7c69