#include "MQTTAsync.h"#include <string.h>#include <stdlib.h>#include <sys/time.h>#include <sys/socket.h>#include <unistd.h>#include <errno.h>#include <stdarg.h>#include <time.h>#include <sys/timeb.h>
Go to the source code of this file.
Classes | |
| struct | client_data |
| struct | Options |
| struct | test6_client_info |
Macros | |
| #define | ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) |
| #define | assert(a, b, c, d) myassert(__FILE__, __LINE__, a, b, c, d) |
| #define | assert1(a, b, c, d, e) myassert(__FILE__, __LINE__, a, b, c, d, e) |
| #define | LOGA_DEBUG 0 |
| #define | LOGA_INFO 1 |
| #define | mqsleep sleep |
| #define | num_clients 10 |
| #define | START_TIME_TYPE struct timeval |
Functions | |
| long | elapsed (START_TIME_TYPE start_time) |
| void | getopts (int argc, char **argv) |
| int | main (int argc, char **argv) |
| void | myassert (char *filename, int lineno, char *description, int value, char *format,...) |
| void | MyLog (int LOGA_level, char *format,...) |
| START_TIME_TYPE | start_clock (void) |
| int | test1 (struct Options options) |
| int | test1_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
| void | test1_onConnect (void *context, MQTTAsync_successData *response) |
| void | test1_onDisconnect (void *context, MQTTAsync_successData *response) |
| void | test1_onSubscribe (void *context, MQTTAsync_successData *response) |
| void | test1_onUnsubscribe (void *context, MQTTAsync_successData *response) |
| int | test2 (struct Options options) |
| void | test2_onConnect (void *context, MQTTAsync_successData *response) |
| void | test2_onFailure (void *context, MQTTAsync_failureData *response) |
| int | test3 (struct Options options) |
| int | test3_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
| void | test3_onConnect (void *context, MQTTAsync_successData *response) |
| void | test3_onDisconnect (void *context, MQTTAsync_successData *response) |
| void | test3_onFailure (void *context, MQTTAsync_failureData *response) |
| void | test3_onPublish (void *context, MQTTAsync_successData *response) |
| void | test3_onSubscribe (void *context, MQTTAsync_successData *response) |
| void | test3_onUnsubscribe (void *context, MQTTAsync_successData *response) |
| int | test4 (struct Options options) |
| int | test4_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
| void | test4_onConnect (void *context, MQTTAsync_successData *response) |
| void | test4_onPublish (void *context, MQTTAsync_successData *response) |
| void | test4_onSubscribe (void *context, MQTTAsync_successData *response) |
| int | test5 (struct Options options) |
| void | test5_onConnect (void *context, MQTTAsync_successData *response) |
| void | test5_onConnectFailure (void *context, MQTTAsync_failureData *response) |
| int | test6 (struct Options options) |
| void | test6_onConnect (void *context, MQTTAsync_successData *response) |
| void | test6_onConnectFailure (void *context, MQTTAsync_failureData *response) |
| void | test6_onDisconnect (void *context, MQTTAsync_successData *response) |
| int | test7 (struct Options options) |
| int | test7_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
| void | test7_onConnect (void *context, MQTTAsync_successData *response) |
| void | test7_onConnectOnly (void *context, MQTTAsync_successData *response) |
| void | test7_onDisconnect (void *context, MQTTAsync_successData *response) |
| void | test7_onDisconnectFailure (void *context, MQTTAsync_failureData *response) |
| void | test7_onSubscribe (void *context, MQTTAsync_successData *response) |
| void | test7_onUnsubscribe (void *context, MQTTAsync_successData *response) |
| int | test8 (struct Options options) |
| int | test8_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
| void | test8_onConnect (void *context, MQTTAsync_successData *response) |
| void | test8_onDisconnect (void *context, MQTTAsync_successData *response) |
| void | test8_onDisconnectFailure (void *context, MQTTAsync_failureData *response) |
| void | test8_onPublish (void *context, MQTTAsync_successData *response) |
| void | test8_onPublishFailure (void *context, MQTTAsync_failureData *response) |
| void | test8_onSubscribe (void *context, MQTTAsync_successData *response) |
| void | trace_callback (enum MQTTASYNC_TRACE_LEVELS level, char *message) |
| void | usage (void) |
| void | write_test_result (void) |
Variables | |
| char * | cur_output = output |
| int | failures = 0 |
| START_TIME_TYPE | global_start_time |
| struct Options | options |
| char | output [3000] |
| int | test2_onFailure_called = 0 |
| void * | test4_payload = NULL |
| int | test4_payloadlen = 0 |
| int | test7_messageCount = 0 |
| static int | test7_subscribed = 0 |
| char * | test7_topic = "C client test7" |
| int | test8_messageCount = 0 |
| int | test8_publishFailures = 0 |
| int | test8_subscribed = 0 |
| char * | test8_topic = "C client test8" |
| volatile int | test_finished = 0 |
| char * | test_topic = "async test topic" |
| int | tests = 0 |
| FILE * | xml |
Tests for the Paho Asynchronous MQTT C client
Definition in file test4.c.
| #define num_clients 10 |
| long elapsed | ( | START_TIME_TYPE | start_time | ) |
| void myassert | ( | char * | filename, |
| int | lineno, | ||
| char * | description, | ||
| int | value, | ||
| char * | format, | ||
| ... | |||
| ) |
| START_TIME_TYPE start_clock | ( | void | ) |
| int test1_messageArrived | ( | void * | context, |
| char * | topicName, | ||
| int | topicLen, | ||
| MQTTAsync_message * | message | ||
| ) |
| void test1_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test1_onDisconnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test1_onSubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test1_onUnsubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test2_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test2_onFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| int test3_messageArrived | ( | void * | context, |
| char * | topicName, | ||
| int | topicLen, | ||
| MQTTAsync_message * | message | ||
| ) |
| void test3_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test3_onDisconnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test3_onFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| void test3_onPublish | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test3_onSubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test3_onUnsubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| int test4_messageArrived | ( | void * | context, |
| char * | topicName, | ||
| int | topicLen, | ||
| MQTTAsync_message * | message | ||
| ) |
| void test4_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test4_onPublish | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test4_onSubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test5_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test5_onConnectFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| void test6_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test6_onConnectFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| void test6_onDisconnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| int test7_messageArrived | ( | void * | context, |
| char * | topicName, | ||
| int | topicLen, | ||
| MQTTAsync_message * | message | ||
| ) |
| void test7_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test7_onConnectOnly | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test7_onDisconnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test7_onDisconnectFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| void test7_onSubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test7_onUnsubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| int test8_messageArrived | ( | void * | context, |
| char * | topicName, | ||
| int | topicLen, | ||
| MQTTAsync_message * | message | ||
| ) |
| void test8_onConnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test8_onDisconnect | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test8_onDisconnectFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| void test8_onPublish | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void test8_onPublishFailure | ( | void * | context, |
| MQTTAsync_failureData * | response | ||
| ) |
| void test8_onSubscribe | ( | void * | context, |
| MQTTAsync_successData * | response | ||
| ) |
| void trace_callback | ( | enum MQTTASYNC_TRACE_LEVELS | level, |
| char * | message | ||
| ) |
| START_TIME_TYPE global_start_time |
| struct Options options |