From 17fd7a8446f9065049168215ad6cd107c1394e52 Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Thu, 30 Jun 2022 19:31:24 +0100 Subject: [PATCH] Add some assertions to test5 --- test/test5.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test5.c b/test/test5.c index 4e188c48..a51041ae 100644 --- a/test/test5.c +++ b/test/test5.c @@ -2178,6 +2178,7 @@ int test7MessageArrived(void* context, char* topicName, int topicLen, opts.context = tc; rc = MQTTAsync_sendMessage(tc->client, tc->topic, &pubmsg, &opts); + assert("Publish successful", rc == MQTTASYNC_SUCCESS, "rc was %d", rc); } else if (message_count < options.message_count) { @@ -2192,6 +2193,7 @@ int test7MessageArrived(void* context, char* topicName, int topicLen, opts.onFailure = test7OnPublishFailure; opts.context = tc; rc = MQTTAsync_sendMessage(tc->client, tc->topic, &pubmsg, &opts); + assert("Publish successful", rc == MQTTASYNC_SUCCESS, "rc was %d", rc); } else { @@ -2237,6 +2239,7 @@ void test7OnSubscribe(void* context, MQTTAsync_successData* response) rc = MQTTAsync_send(tc->client, tc->topic, pubmsg.payloadlen, pubmsg.payload, pubmsg.qos, pubmsg.retained, &opts); + assert("Publish successful", rc == MQTTASYNC_SUCCESS, "rc was %d", rc); } void test7OnConnect(void* context, MQTTAsync_successData* response)