#include "MQTTClient.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 | Options |
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 | 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,...) |
START_TIME_TYPE | start_clock (void) |
int | test1 (struct Options options) |
void | test1_sendAndReceive (MQTTClient *c, int qos, char *test_topic) |
int | test2 (struct Options options) |
void | test2_deliveryComplete (void *context, MQTTClient_deliveryToken dt) |
int | test2_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message) |
void | test2_sendAndReceive (MQTTClient *c, int qos, char *test_topic) |
int | test3 (struct Options options) |
int | test4 (struct Options options) |
int | test4_run (int qos, int start_mqtt_version, int restore_mqtt_version) |
int | test5 (struct Options options) |
int | test6 (struct Options options) |
void | test6_connectionLost (void *context, char *cause) |
void | test6_deliveryComplete (void *context, MQTTClient_deliveryToken token) |
int | test6_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *m) |
int | test6a (struct Options options) |
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] |
volatile int | test2_arrivedcount = 0 |
int | test2_deliveryCompleted = 0 |
MQTTClient_message | test2_pubmsg = MQTTClient_message_initializer |
MQTTClient | test6_c1 |
MQTTClient | test6_c2 |
volatile int | test6_connection_lost_called = 0 |
char * | test6_will_message = "will message from Client-1" |
volatile int | test6_will_message_arrived = 0 |
char * | test6_will_topic = "C Test 2: will topic" |
int | tests = 0 |
FILE * | xml |
Tests for the MQTT C client
Definition in file test15.c.
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 | ) |
void test1_sendAndReceive | ( | MQTTClient * | c, |
int | qos, | ||
char * | test_topic | ||
) |
void test2_deliveryComplete | ( | void * | context, |
MQTTClient_deliveryToken | dt | ||
) |
int test2_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTClient_message * | message | ||
) |
void test2_sendAndReceive | ( | MQTTClient * | c, |
int | qos, | ||
char * | test_topic | ||
) |
int test4_run | ( | int | qos, |
int | start_mqtt_version, | ||
int | restore_mqtt_version | ||
) |
void test6_connectionLost | ( | void * | context, |
char * | cause | ||
) |
void test6_deliveryComplete | ( | void * | context, |
MQTTClient_deliveryToken | token | ||
) |
int test6_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTClient_message * | m | ||
) |
START_TIME_TYPE global_start_time |
struct Options options |
MQTTClient_message test2_pubmsg = MQTTClient_message_initializer |
MQTTClient test6_c1 |
MQTTClient test6_c2 |