From bc7fca4227b1fe361b57a2a6385fcf354f53f2b8 Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Fri, 7 Sep 2018 11:44:41 +0100 Subject: [PATCH] Final persistence test #534 --- test/test45.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/test45.c b/test/test45.c index 3866bbc4..c702564f 100644 --- a/test/test45.c +++ b/test/test45.c @@ -1618,10 +1618,14 @@ int test7_run(int qos, int start_mqtt_version, int restore_mqtt_version) createOpts.MQTTVersion = restore_mqtt_version; rc = MQTTAsync_createWithOptions(&c, options.connection, "async_test7", MQTTCLIENT_PERSISTENCE_DEFAULT, NULL, &createOpts); - assert("good rc from create", rc == MQTTASYNC_SUCCESS, "rc was %d\n", rc); + + if (start_mqtt_version == MQTTVERSION_5 && restore_mqtt_version == MQTTVERSION_3_1_1) + assert("Persistence error from create", rc == MQTTASYNC_PERSISTENCE_ERROR, "rc was %d", rc); + else + assert("Good rc from create", rc == MQTTASYNC_SUCCESS, "rc was %d", rc); if (rc != MQTTASYNC_SUCCESS) { - MQTTAsync_destroy(&c); + //MQTTAsync_destroy(&c); goto exit; } @@ -1717,8 +1721,8 @@ int test7(struct Options options) global_start_time = start_clock(); rc = test7_run(1, MQTTVERSION_5, MQTTVERSION_5) + test7_run(2, MQTTVERSION_5, MQTTVERSION_5) + - test7_run(2, MQTTVERSION_3_1_1, MQTTVERSION_5) /*+ - test7_run(2, MQTTVERSION_5, MQTTVERSION_3_1_1)*/; + test7_run(2, MQTTVERSION_3_1_1, MQTTVERSION_5) + + test7_run(2, MQTTVERSION_5, MQTTVERSION_3_1_1); fprintf(xml, " time=\"%ld\" >\n", elapsed(global_start_time) / 1000); if (cur_output != output) {