Fix test8 and remove debug printfs

This commit is contained in:
Ian Craggs 2022-02-09 10:49:39 +00:00
parent f3c5df6376
commit 7004cb8a28
2 changed files with 6 additions and 7 deletions

View File

@ -1094,13 +1094,10 @@ void MQTTAsync_writeComplete(SOCKET socket, int rc)
if (cur_response) /* we found a response */
{
printf("writeComplete: cur_response\n");
if (command->type == PUBLISH)
{
printf("writeComplete: PUBLISH %d %d\n", rc, command->details.pub.qos);
if (rc == 1 && command->details.pub.qos == 0)
{
printf("writeComplete: rc 1 onSuccess %p\n", command->onSuccess);
if (command->onSuccess)
{
MQTTAsync_successData data;

View File

@ -1265,6 +1265,7 @@ int test6(struct Options options)
int rc = 0;
char* test_topic = "C client test8 - test6";
int messages_sent = 0;
int count = 0;
failures = 0;
test_finished = 0;
@ -1349,10 +1350,10 @@ int test6(struct Options options)
dopts.timeout = 1000;
dopts.context = d;
rc = MQTTAsync_disconnect(d, &dopts);
test6_disconnected = 0;
rc = MQTTAsync_disconnect(d, &dopts);
assert("Disconnect start successful", rc == MQTTASYNC_SUCCESS, "rc was %d", rc);
while (test6_disconnected == 0)
while (test6_disconnected == 0 && ++count < 5)
{
#if defined(_WIN32)
Sleep(1000);
@ -1362,10 +1363,11 @@ int test6(struct Options options)
}
dopts.context = c;
rc = MQTTAsync_disconnect(c, &dopts);
test6_disconnected = 0;
rc = MQTTAsync_disconnect(c, &dopts);
assert("Disconnect start successful", rc == MQTTASYNC_SUCCESS, "rc was %d", rc);
while (test6_disconnected == 0)
count = 0;
while (test6_disconnected == 0 && ++count < 5)
{
#if defined(_WIN32)
Sleep(1000);