Skip to content

Commit

Permalink
Refs #20401: Fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
  • Loading branch information
JesusPoderoso authored and EduPonz committed Feb 24, 2024
1 parent 8532126 commit a36b900
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 65 deletions.
30 changes: 2 additions & 28 deletions src/cpp/fastdds/publisher/DataWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,45 +1701,19 @@ ReturnCode_t DataWriterImpl::check_qos(
(qos.endpoint().history_memory_policy != PREALLOCATED_MEMORY_MODE &&
qos.endpoint().history_memory_policy != PREALLOCATED_WITH_REALLOC_MEMORY_MODE))
{
<<<<<<< HEAD
logError(RTPS_QOS_CHECK, "DATA_SHARING cannot be used with memory policies other than PREALLOCATED.");
=======
EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "DATA_SHARING cannot be used with memory policies other than PREALLOCATED.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth <= 0)
{
EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "HISTORY DEPTH must be higher than 0 if HISTORY KIND is KEEP_LAST.");
logError(RTPS_QOS_CHECK, "HISTORY DEPTH must be higher than 0 if HISTORY KIND is KEEP_LAST.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth > 0 &&
qos.resource_limits().max_samples_per_instance > 0 &&
qos.history().depth > qos.resource_limits().max_samples_per_instance)
{
EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK,
"HISTORY DEPTH must be lower or equal to the max_samples_per_instance value.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
return ReturnCode_t::RETCODE_OK;
}

ReturnCode_t DataWriterImpl::check_allocation_consistency(
const DataWriterQos& qos)
{
if ((qos.resource_limits().max_samples > 0) &&
(qos.resource_limits().max_samples <
(qos.resource_limits().max_instances * qos.resource_limits().max_samples_per_instance)))
{
EPROSIMA_LOG_ERROR(DDS_QOS_CHECK,
"max_samples should be greater than max_instances * max_samples_per_instance");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) &&
(qos.resource_limits().max_samples > 0))
{
EPROSIMA_LOG_ERROR(DDS_QOS_CHECK,
"max_samples should be infinite when max_instances or max_samples_per_instance are infinite");
>>>>>>> 68acb5a6c (Check History QoS inconsistencies (#4375))
logError(RTPS_QOS_CHECK,"HISTORY DEPTH must be lower or equal to the max_samples_per_instance value.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
return ReturnCode_t::RETCODE_OK;
Expand Down
30 changes: 2 additions & 28 deletions src/cpp/fastdds/subscriber/DataReaderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,45 +1318,19 @@ ReturnCode_t DataReaderImpl::check_qos (
}
if (qos_has_unique_network_request(qos) && qos_has_specific_locators(qos))
{
<<<<<<< HEAD
logError(DDS_QOS_CHECK, "unique_network_request cannot be set along specific locators");
=======
EPROSIMA_LOG_ERROR(DDS_QOS_CHECK, "unique_network_request cannot be set along specific locators");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth <= 0)
{
EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK, "HISTORY DEPTH must be higher than 0 if HISTORY KIND is KEEP_LAST.");
logError(RTPS_QOS_CHECK, "HISTORY DEPTH must be higher than 0 if HISTORY KIND is KEEP_LAST.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if (qos.history().kind == KEEP_LAST_HISTORY_QOS && qos.history().depth > 0 &&
qos.resource_limits().max_samples_per_instance > 0 &&
qos.history().depth > qos.resource_limits().max_samples_per_instance)
{
EPROSIMA_LOG_ERROR(RTPS_QOS_CHECK,
"HISTORY DEPTH must be lower or equal to the max_samples_per_instance value.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
return ReturnCode_t::RETCODE_OK;
}

ReturnCode_t DataReaderImpl::check_allocation_consistency(
const DataReaderQos& qos)
{
if ((qos.resource_limits().max_samples > 0) &&
(qos.resource_limits().max_samples <
(qos.resource_limits().max_instances * qos.resource_limits().max_samples_per_instance)))
{
EPROSIMA_LOG_ERROR(DDS_QOS_CHECK,
"max_samples should be greater than max_instances * max_samples_per_instance");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if ((qos.resource_limits().max_instances <= 0 || qos.resource_limits().max_samples_per_instance <= 0) &&
(qos.resource_limits().max_samples > 0))
{
EPROSIMA_LOG_ERROR(DDS_QOS_CHECK,
"max_samples should be infinite when max_instances or max_samples_per_instance are infinite");
>>>>>>> 68acb5a6c (Check History QoS inconsistencies (#4375))
logError(RTPS_QOS_CHECK, "HISTORY DEPTH must be lower or equal to the max_samples_per_instance value.");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
return ReturnCode_t::RETCODE_OK;
Expand Down
12 changes: 3 additions & 9 deletions test/unittest/dds/profiles/test_xml_profiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
<name>default_name</name>
</rtps>
</participant>

<publisher profile_name="test_publisher_profile">
<topic>
<kind>NO_KEY</kind>
Expand Down Expand Up @@ -480,16 +480,10 @@
<maximum>10</maximum>
<increment>0</increment>
</matchedSubscribersAllocation>
<<<<<<< HEAD:test/unittest/dds/profiles/test_xml_profiles.xml
</publisher>

<subscriber profile_name="test_subscriber_profile">
=======
</data_writer>

<!-- This profile has been updated to ensure that HistoryQoS and ResourceLimitQoS constraints are met (#20401) -->
<data_reader profile_name="test_subscriber_profile">
>>>>>>> 68acb5a6c (Check History QoS inconsistencies (#4375)):test/unittest/dds/profiles/test_xml_profile.xml
<subscriber profile_name="test_subscriber_profile">
<topic>
<kind>NO_KEY</kind>
<name>otherSamplePubSubTopic</name>
Expand Down Expand Up @@ -585,7 +579,7 @@
<increment>5</increment>
</matchedPublishersAllocation>
</subscriber>

<subscriber profile_name="test_default_subscriber_profile" is_default_profile="true">
<topic>
<kind>WITH_KEY</kind>
Expand Down

0 comments on commit a36b900

Please sign in to comment.