Skip to content

Commit

Permalink
fix test rule
Browse files Browse the repository at this point in the history
  • Loading branch information
alfred2g committed Dec 20, 2023
1 parent 27a1f14 commit a25d9cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/Mqtt5ClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2136,19 +2136,21 @@ static int s_TestMqtt5SharedSubscriptionTest(Aws::Crt::Allocator *allocator, voi
fprintf(stderr, "all packets received =========\n");

Vector<String> unsubList;
unsubList.clear();
std::shared_ptr<Mqtt5::UnsubscribePacket> unsubscribe_client1 = std::make_shared<Mqtt5::UnsubscribePacket>(allocator);
unsubList.push_back(TEST_TOPIC);
std::shared_ptr<Mqtt5::UnsubscribePacket> unsubscribe_client1 =
std::make_shared<Mqtt5::UnsubscribePacket>(allocator);
unsubscribe_client1->WithTopicFilters(unsubList);
ASSERT_FALSE(mqtt5Client->Unsubscribe(unsubscribe_client1));

std::shared_ptr<Mqtt5::UnsubscribePacket> unsubscribe_client2 = std::make_shared<Mqtt5::UnsubscribePacket>(allocator);
std::shared_ptr<Mqtt5::UnsubscribePacket> unsubscribe_client2 =
std::make_shared<Mqtt5::UnsubscribePacket>(allocator);
unsubscribe_client2->WithTopicFilters(unsubList);
ASSERT_FALSE(mqtt5Client->Unsubscribe(unsubscribe_client2));

client_received = std::promise<void>();

/* makes sure messages are distrubuted evenly between the two clients*/
ASSERT_INT_EQUALS(10, client_messages);
ASSERT_INT_EQUALS(11, client_messages); /* We are adding one at the end, so 10 messages received */
ASSERT_TRUE(client1_received);
ASSERT_TRUE(client2_received);

Expand Down

0 comments on commit a25d9cf

Please sign in to comment.