Skip to content

Commit

Permalink
unreferenced params
Browse files Browse the repository at this point in the history
  • Loading branch information
Bret Ambrose committed Oct 7, 2024
1 parent 75b21e1 commit 58416fb
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions tests/MqttRequestResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,17 @@ static TestContext s_CreateClient(
mqtt5Options.WithTlsConnectionOptions(tlsContext.NewConnectionOptions());

mqtt5Options.WithClientConnectionSuccessCallback(
[state](const Aws::Crt::Mqtt5::OnConnectionSuccessEventData &event) { s_updateConnected(state, true); });
mqtt5Options.WithClientDisconnectionCallback([state](const Aws::Crt::Mqtt5::OnDisconnectionEventData &event)
{ s_updateConnected(state, false); });
[state](const Aws::Crt::Mqtt5::OnConnectionSuccessEventData &event)
{
(void)event;
s_updateConnected(state, true);
});
mqtt5Options.WithClientDisconnectionCallback(
[state](const Aws::Crt::Mqtt5::OnDisconnectionEventData &event)
{
(void)event;
s_updateConnected(state, false);
});

context.protocolClient5 = Aws::Crt::Mqtt5::Mqtt5Client::NewMqtt5Client(mqtt5Options, allocator);
context.client = Aws::Iot::RequestResponse::NewClientFrom5(*context.protocolClient5, finalOptions, allocator);
Expand All @@ -287,9 +295,16 @@ static TestContext s_CreateClient(

context.protocolClient311->OnConnectionSuccess =
[state](Aws::Crt::Mqtt::MqttConnection &connection, Aws::Crt::Mqtt::OnConnectionSuccessData *callbackData)
{ s_updateConnected(state, true); };
{
(void)connection;
(void)callbackData;
s_updateConnected(state, true);
};
context.protocolClient311->OnDisconnect = [state](Aws::Crt::Mqtt::MqttConnection &connection)
{ s_updateConnected(state, false); };
{
(void)connection;
s_updateConnected(state, false);
};

context.client =
Aws::Iot::RequestResponse::NewClientFrom311(*context.protocolClient311, finalOptions, allocator);
Expand Down Expand Up @@ -330,7 +345,12 @@ void s_publishToProtocolClient(
AWS_MQTT_QOS_AT_MOST_ONCE,
false,
payloadBuffer,
[](Aws::Crt::Mqtt::MqttConnection &connection, uint16_t packetId, int errorCode) {});
[](Aws::Crt::Mqtt::MqttConnection &connection, uint16_t packetId, int errorCode)
{
(void)connection;
(void)packetId;
(void)errorCode;
});
aws_byte_buf_clean_up(&payloadBuffer);
}
}
Expand Down Expand Up @@ -570,8 +590,6 @@ static int s_SubmitUpdateNamedShadowAcceptedRequest(TestContext &context, TestSt
snprintf(payload, AWS_ARRAY_SIZE(payload), "{\"state\":{\"desired\":%s}}", desiredState);
}

AWS_LOGF_INFO(AWS_LS_MQTT_GENERAL, "***UpdateNamedShadowPayload: %s", payload);

requestOptions.serialized_request = aws_byte_cursor_from_c_str(payload);

requestOptions.response_paths = responsePaths;
Expand Down Expand Up @@ -599,8 +617,6 @@ static int s_SubmitUpdateNamedShadowAcceptedRequest(TestContext &context, TestSt
std::lock_guard<std::mutex> lock(state->lock);
ASSERT_INT_EQUALS(AWS_ERROR_SUCCESS, tracker->errorCode);

AWS_LOGF_INFO(AWS_LS_MQTT_GENERAL, "**Temp-Request-response-test-payload: %s", tracker->payload.c_str());

ASSERT_TRUE(
tracker->topic == Aws::Crt::String((const char *)responsePaths[0].topic.ptr, responsePaths[0].topic.len));
ASSERT_TRUE(tracker->payload.length() > 0);
Expand Down

0 comments on commit 58416fb

Please sign in to comment.