@@ -1502,18 +1502,16 @@ TEST(ParticipantTests, ServerParticipantRemoteServerListConfiguration)
1502
1502
1503
1503
TEST (ParticipantTests, EasyModeParticipantLoadsServiceDataWriterQos)
1504
1504
{
1505
- // Use get_publisher_qos_from_profile to check if the profile is correctly loaded.
1506
- // But we cannot check the actual value of the max_blocking_time from qos because it belongs to the PublisherAttributes
1505
+ // Use get_datawriter_qos_from_profile to check if the profile is correctly loaded.
1507
1506
{
1508
1507
// Default participant
1509
1508
DomainParticipant* participant = DomainParticipantFactory::get_instance ()->create_participant (
1510
1509
(uint32_t )GET_PID () % 230 , PARTICIPANT_QOS_DEFAULT);
1511
1510
ASSERT_NE (nullptr , participant);
1512
1511
Publisher* default_publisher = participant->create_publisher (PUBLISHER_QOS_DEFAULT);
1513
1512
ASSERT_NE (default_publisher, nullptr );
1514
- PublisherQos profile_qos;
1515
- EXPECT_EQ (default_publisher->get_participant ()->get_publisher_qos_from_profile (" service" , profile_qos),
1516
- RETCODE_BAD_PARAMETER);
1513
+ DataWriterQos dw_qos;
1514
+ EXPECT_EQ (default_publisher->get_datawriter_qos_from_profile (" service" , dw_qos), RETCODE_BAD_PARAMETER);
1517
1515
1518
1516
EXPECT_EQ (RETCODE_OK, participant->delete_publisher (default_publisher));
1519
1517
EXPECT_EQ (RETCODE_OK, DomainParticipantFactory::get_instance ()->delete_participant (participant));
@@ -1527,23 +1525,12 @@ TEST(ParticipantTests, EasyModeParticipantLoadsServiceDataWriterQos)
1527
1525
ASSERT_NE (nullptr , participant);
1528
1526
Publisher* easy_mode_publisher = participant->create_publisher (PUBLISHER_QOS_DEFAULT);
1529
1527
ASSERT_NE (easy_mode_publisher, nullptr );
1530
- PublisherQos profile_qos;
1531
- EXPECT_EQ (easy_mode_publisher->get_participant ()->get_publisher_qos_from_profile (" service" , profile_qos),
1532
- RETCODE_OK);
1533
- TypeSupport type (new TopicDataTypeMock ());
1534
- type.register_type (participant, " footype" );
1535
- Topic* topic = participant->create_topic (" footopic" , " footype" , TOPIC_QOS_DEFAULT);
1536
- ASSERT_NE (nullptr , topic);
1537
- DataWriter* data_writer = easy_mode_publisher->create_datawriter_with_profile (topic, " service" );
1538
- ASSERT_NE (nullptr , data_writer);
1539
1528
DataWriterQos dw_qos;
1540
- EXPECT_EQ (data_writer-> get_qos ( dw_qos), RETCODE_OK);
1541
- EXPECT_EQ (dw_qos.reliability ().max_blocking_time .seconds , 1 );
1542
- EXPECT_EQ (dw_qos.reliability ().max_blocking_time .nanosec , 0 );
1529
+ EXPECT_EQ (easy_mode_publisher-> get_datawriter_qos_from_profile ( " service " , dw_qos), RETCODE_OK);
1530
+ EXPECT_EQ (dw_qos.reliability ().max_blocking_time .seconds , 1 ); // Easy Mode value
1531
+ EXPECT_EQ (dw_qos.reliability ().max_blocking_time .nanosec , 0 ); // Easy Mode value
1543
1532
EXPECT_EQ (dw_qos.durability ().kind , TRANSIENT_LOCAL_DURABILITY_QOS); // Default value
1544
1533
1545
- EXPECT_EQ (RETCODE_OK, easy_mode_publisher->delete_datawriter (data_writer));
1546
- EXPECT_EQ (RETCODE_OK, participant->delete_topic (topic));
1547
1534
EXPECT_EQ (RETCODE_OK, participant->delete_publisher (easy_mode_publisher));
1548
1535
EXPECT_EQ (RETCODE_OK, DomainParticipantFactory::get_instance ()->delete_participant (participant));
1549
1536
stop_background_servers ();
@@ -1554,7 +1541,7 @@ TEST(ParticipantTests, EasyModeParticipantDoNotOverwriteCustomDataWriterQos)
1554
1541
{
1555
1542
{
1556
1543
// Easy mode participant with existing profile
1557
- // set XML profile as environment variable: "export FASTDDS_DEFAULT_PROFILES_FILE=test_xml_service_easy_mode.xml"
1544
+ // Set XML profile as environment variable: "export FASTDDS_DEFAULT_PROFILES_FILE=test_xml_service_easy_mode.xml"
1558
1545
eprosima::testing::set_environment_variable (" FASTDDS_DEFAULT_PROFILES_FILE" , " test_xml_service_easy_mode.xml" );
1559
1546
set_easy_mode_environment_variable ();
1560
1547
DomainParticipant* participant = DomainParticipantFactory::get_instance ()->create_participant (
@@ -1565,20 +1552,12 @@ TEST(ParticipantTests, EasyModeParticipantDoNotOverwriteCustomDataWriterQos)
1565
1552
PublisherQos profile_qos;
1566
1553
EXPECT_EQ (easy_mode_publisher->get_participant ()->get_publisher_qos_from_profile (" service" , profile_qos),
1567
1554
RETCODE_OK);
1568
- TypeSupport type (new TopicDataTypeMock ());
1569
- type.register_type (participant, " footype" );
1570
- Topic* topic = participant->create_topic (" footopic" , " footype" , TOPIC_QOS_DEFAULT);
1571
- ASSERT_NE (nullptr , topic);
1572
- DataWriter* data_writer = easy_mode_publisher->create_datawriter_with_profile (topic, " service" );
1573
- ASSERT_NE (nullptr , data_writer);
1574
1555
DataWriterQos dw_qos;
1575
- EXPECT_EQ (data_writer-> get_qos (dw_qos), RETCODE_OK );
1576
- EXPECT_EQ (dw_qos.reliability ().max_blocking_time .seconds , 5 );
1577
- EXPECT_EQ (dw_qos.reliability ().max_blocking_time .nanosec , 0 );
1556
+ easy_mode_publisher-> get_datawriter_qos_from_profile ( " service " , dw_qos );
1557
+ EXPECT_EQ (dw_qos.reliability ().max_blocking_time .seconds , 5 ); // XML value
1558
+ EXPECT_EQ (dw_qos.reliability ().max_blocking_time .nanosec , 0 ); // XML value
1578
1559
EXPECT_EQ (dw_qos.durability ().kind , VOLATILE_DURABILITY_QOS); // XML value
1579
1560
1580
- EXPECT_EQ (RETCODE_OK, easy_mode_publisher->delete_datawriter (data_writer));
1581
- EXPECT_EQ (RETCODE_OK, participant->delete_topic (topic));
1582
1561
EXPECT_EQ (RETCODE_OK, participant->delete_publisher (easy_mode_publisher));
1583
1562
EXPECT_EQ (RETCODE_OK, DomainParticipantFactory::get_instance ()->delete_participant (participant));
1584
1563
stop_background_servers ();
0 commit comments