diff --git a/tests/Mqtt5ClientTest.cpp b/tests/Mqtt5ClientTest.cpp index 79d3c9861..b95843bd3 100644 --- a/tests/Mqtt5ClientTest.cpp +++ b/tests/Mqtt5ClientTest.cpp @@ -2084,12 +2084,12 @@ static int s_TestMqtt5SharedSubscriptionTest(Aws::Crt::Allocator *allocator, voi /* Subscribe to test topic */ Mqtt5::Subscription subscription(sharedTopicFilter, Mqtt5::QOS::AWS_MQTT5_QOS_AT_MOST_ONCE, allocator); std::shared_ptr subscribe = std::make_shared(allocator); - subscribe->WithSubscription(subscription); + subscribe->WithSubscription(std::move(subscription)); /* Subscribe to test topic */ Mqtt5::Subscription subscription2(sharedTopicFilter, Mqtt5::QOS::AWS_MQTT5_QOS_AT_MOST_ONCE, allocator); std::shared_ptr subscribe2 = std::make_shared(allocator); - subscribe2->WithSubscription(subscription); + subscribe2->WithSubscription(std::move(subscription2)); std::promise suback; auto onSubAck = [&](int, std::shared_ptr) { suback.set_value(); };