#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 | min(a, b) ((a < b) ? a : b) |
#define | num_clients 10 |
#define | START_TIME_TYPE struct timeval |
Functions | |
long | elapsed (START_TIME_TYPE start_time) |
void | getopts (int argc, char **argv) |
void | logProperties (MQTTProperties *props) |
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,...) |
void | MySleep (long milliseconds) |
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_successData5 *response) |
void | test1_onDisconnect (void *context, MQTTAsync_successData *response) |
void | test1_onSubscribe (void *context, MQTTAsync_successData5 *response) |
void | test1_onUnsubscribe (void *context, MQTTAsync_successData5 *response) |
int | test2 (struct Options options) |
void | test2_onConnect (void *context, MQTTAsync_successData5 *response) |
void | test2_onFailure (void *context, MQTTAsync_failureData5 *response) |
int | test3 (struct Options options) |
int | test3_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
void | test3_onConnect (void *context, MQTTAsync_successData5 *response) |
void | test3_onDisconnect (void *context, MQTTAsync_successData5 *response) |
void | test3_onFailure (void *context, MQTTAsync_failureData5 *response) |
void | test3_onPublish (void *context, MQTTAsync_successData5 *response) |
void | test3_onSubscribe (void *context, MQTTAsync_successData5 *response) |
void | test3_onUnsubscribe (void *context, MQTTAsync_successData5 *response) |
int | test4 (struct Options options) |
int | test4_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
void | test4_onConnect (void *context, MQTTAsync_successData5 *response) |
void | test4_onPublish (void *context, MQTTAsync_successData5 *response) |
void | test4_onSubscribe (void *context, MQTTAsync_successData5 *response) |
int | test5 (struct Options options) |
void | test5_onConnect (void *context, MQTTAsync_successData5 *response) |
void | test5_onConnectFailure (void *context, MQTTAsync_failureData5 *response) |
int | test6 (struct Options options) |
void | test6_onConnect (void *context, MQTTAsync_successData5 *response) |
void | test6_onConnectFailure (void *context, MQTTAsync_failureData5 *response) |
void | test6_onDisconnect5 (void *context, MQTTAsync_successData5 *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_onConnect5 (void *context, MQTTAsync_successData5 *response) |
void | test7_onDisconnect (void *context, MQTTAsync_successData *response) |
void | test7_onDisconnect5 (void *context, MQTTAsync_successData5 *response) |
void | test7_onDisconnectFailure (void *context, MQTTAsync_failureData *response) |
void | test7_onDisconnectFailure5 (void *context, MQTTAsync_failureData5 *response) |
void | test7_onSubscribe (void *context, MQTTAsync_successData *response) |
void | test7_onSubscribe5 (void *context, MQTTAsync_successData5 *response) |
void | test7_onUnsubscribe (void *context, MQTTAsync_successData *response) |
void | test7_onUnsubscribe5 (void *context, MQTTAsync_successData5 *response) |
int | test7_run (int qos, int start_mqtt_version, int restore_mqtt_version) |
int | test8 (struct Options options) |
int | test8_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message) |
void | test8_onConnect (void *context, MQTTAsync_successData5 *response) |
void | test8_onDisconnect (void *context, MQTTAsync_successData5 *response) |
void | test8_onDisconnectFailure (void *context, MQTTAsync_failureData5 *response) |
void | test8_onPublish (void *context, MQTTAsync_successData5 *response) |
void | test8_onPublishFailure (void *context, MQTTAsync_failureData5 *response) |
void | test8_onSubscribe (void *context, MQTTAsync_successData5 *response) |
void | trace_callback (enum MQTTASYNC_TRACE_LEVELS level, char *message) |
void | usage (void) |
void | waitForNoPendingTokens (MQTTAsync c) |
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 |
int | test4_packet_size = 10000 |
void * | test4_payload = NULL |
int | test4_payloadlen = 0 |
static int | test7_just_connect = 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 test45.c.
#define num_clients 10 |
long elapsed | ( | START_TIME_TYPE | start_time | ) |
void logProperties | ( | MQTTProperties * | props | ) |
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_successData5 * | response | ||
) |
void test1_onDisconnect | ( | void * | context, |
MQTTAsync_successData * | response | ||
) |
void test1_onSubscribe | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test1_onUnsubscribe | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test2_onConnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test2_onFailure | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
int test3_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTAsync_message * | message | ||
) |
void test3_onConnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test3_onDisconnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test3_onFailure | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
void test3_onPublish | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test3_onSubscribe | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test3_onUnsubscribe | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
int test4_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTAsync_message * | message | ||
) |
void test4_onConnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test4_onPublish | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test4_onSubscribe | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test5_onConnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test5_onConnectFailure | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
void test6_onConnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test6_onConnectFailure | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
void test6_onDisconnect5 | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
int test7_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTAsync_message * | message | ||
) |
void test7_onConnect | ( | void * | context, |
MQTTAsync_successData * | response | ||
) |
void test7_onConnect5 | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test7_onDisconnect | ( | void * | context, |
MQTTAsync_successData * | response | ||
) |
void test7_onDisconnect5 | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test7_onDisconnectFailure | ( | void * | context, |
MQTTAsync_failureData * | response | ||
) |
void test7_onDisconnectFailure5 | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
void test7_onSubscribe | ( | void * | context, |
MQTTAsync_successData * | response | ||
) |
void test7_onSubscribe5 | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test7_onUnsubscribe | ( | void * | context, |
MQTTAsync_successData * | response | ||
) |
void test7_onUnsubscribe5 | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
int test7_run | ( | int | qos, |
int | start_mqtt_version, | ||
int | restore_mqtt_version | ||
) |
int test8_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTAsync_message * | message | ||
) |
void test8_onConnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test8_onDisconnect | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test8_onDisconnectFailure | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
void test8_onPublish | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void test8_onPublishFailure | ( | void * | context, |
MQTTAsync_failureData5 * | response | ||
) |
void test8_onSubscribe | ( | void * | context, |
MQTTAsync_successData5 * | response | ||
) |
void trace_callback | ( | enum MQTTASYNC_TRACE_LEVELS | level, |
char * | message | ||
) |
START_TIME_TYPE global_start_time |
struct Options options |