Commit dfe40601 authored by Juergen Kosel's avatar Juergen Kosel

Fix Windows build of test_issue373 and increase number of iterations

The functions implemented in Heap.c are not usable for Windows builds.
Therefore use only for none MSVC builds.

Increase the workload and number of connect/disconnects.
Signed-off-by: 's avatarJuergen Kosel <juergen.kosel@softing.com>
parent 07924786
......@@ -286,15 +286,17 @@ int test_373(struct Options options)
goto exit;
}
MQTTAsync_setTraceLevel(MQTTASYNC_TRACE_ERROR);
while (connectCnt < 5)
while (connectCnt < 10)
{
MyLog(LOGA_INFO, "Connected %d connectCnt %d\n",connected,connectCnt);
mqtt_mem = Heap_get_info();
MyLog(LOGA_INFO, "PublishCnt %d, FailedCnt %d, Pending %d maxPending %d",
goodPublishCnt,failedPublishCnt,pendingMessageCnt,pendingMessageCntMax);
MyLog(LOGA_INFO, "MQTT mem current %ld, max %ld",mqtt_mem->current_size,mqtt_mem->max_size);
if (!connected)
{
MyLog(LOGA_INFO, "Connected %d connectCnt %d\n",connected,connectCnt);
MyLog(LOGA_INFO, "PublishCnt %d, FailedCnt %d, Pending %d maxPending %d",
goodPublishCnt,failedPublishCnt,pendingMessageCnt,pendingMessageCntMax);
#if !defined(_WINDOWS)
mqtt_mem = Heap_get_info();
MyLog(LOGA_INFO, "MQTT mem current %ld, max %ld",mqtt_mem->current_size,mqtt_mem->max_size);
#endif
/* (re)connect to the broker */
if (connecting)
{
......@@ -320,20 +322,24 @@ int test_373(struct Options options)
rc = test373SendPublishMessage(mqttasyncContext,topicId);
if (rc != MQTTASYNC_SUCCESS) break;
}
MySleep(1000);
MySleep(100);
}
}
MySleep(5000);
MyLog(LOGA_INFO, "PublishCnt %d, FailedCnt %d, Pending %d maxPending %d",
goodPublishCnt,failedPublishCnt,pendingMessageCnt,pendingMessageCntMax);
#if !defined(_WINDOWS)
mqtt_mem = Heap_get_info();
MyLog(LOGA_INFO, "MQTT mem current %ld, max %ld",mqtt_mem->current_size,mqtt_mem->max_size);
#endif
MQTTAsync_disconnect(mqttasyncContext, NULL);
mqtt_mem = Heap_get_info();
MyLog(LOGA_INFO, "PublishCnt %d, FailedCnt %d, Pending %d maxPending %d",
goodPublishCnt,failedPublishCnt,pendingMessageCnt,pendingMessageCntMax);
#if !defined(_WINDOWS)
mqtt_mem = Heap_get_info();
MyLog(LOGA_INFO, "MQTT mem current %ld, max %ld",mqtt_mem->current_size,mqtt_mem->max_size);
if (mqtt_mem->current_size > 0) failures++; /* consider any not freed memory as failure */
#endif
exit:
MQTTAsync_destroy(&mqttasyncContext);
return failures;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment