diff --git a/rcl/test/rcl/test_get_actual_qos.cpp b/rcl/test/rcl/test_get_actual_qos.cpp index 8e7044780..9d3bb5bc1 100644 --- a/rcl/test/rcl/test_get_actual_qos.cpp +++ b/rcl/test/rcl/test_get_actual_qos.cpp @@ -171,9 +171,9 @@ TEST_P_RMW(TestPublisherGetActualQoS, test_publisher_get_qos_settings) EXPECT_EQ( qos->history, parameters.qos_expected.history); - EXPECT_EQ( - qos->depth, - parameters.qos_expected.depth); + if (parameters.qos_expected.history == RMW_QOS_POLICY_HISTORY_KEEP_LAST) { + EXPECT_EQ(qos->depth, parameters.qos_expected.depth); + } EXPECT_EQ( qos->reliability, parameters.qos_expected.reliability); @@ -226,9 +226,9 @@ TEST_P_RMW(TestSubscriptionGetActualQoS, test_subscription_get_qos_settings) EXPECT_EQ( qos->history, parameters.qos_expected.history); - EXPECT_EQ( - qos->depth, - parameters.qos_expected.depth); + if (parameters.qos_expected.history == RMW_QOS_POLICY_HISTORY_KEEP_LAST) { + EXPECT_EQ(qos->depth, parameters.qos_expected.depth); + } EXPECT_EQ( qos->reliability, parameters.qos_expected.reliability);