#include "MQTTClient.h"
#include "Thread.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 |
struct | thread_parms |
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 |
#define | WINAPI |
Functions | |
long | elapsed (START_TIME_TYPE start_time) |
void | getopts (int argc, char **argv) |
void | lock_mutex (mutex_type amutex) |
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_deliveryComplete (void *context, MQTTClient_deliveryToken dt) |
int | test1_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *m) |
thread_return_type WINAPI | test1_sendAndReceive (void *n) |
int | test2 (struct Options options) |
void | test2_deliveryComplete (void *context, MQTTClient_deliveryToken dt) |
int | test2_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *m) |
void | test2_sendAndReceive (MQTTClient *c, int qos, char *test_topic) |
void | unlock_mutex (mutex_type amutex) |
void | usage (void) |
void | write_test_result (void) |
Variables | |
char * | cur_output = output |
mutex_type | deliveryCompleted_mutex = &deliveryCompleted_mutex_store |
pthread_mutex_t | deliveryCompleted_mutex_store = PTHREAD_MUTEX_INITIALIZER |
int | failures = 0 |
START_TIME_TYPE | global_start_time |
static int | iterations = 50 |
struct Options | options |
char | output [3000] |
volatile int | test1_arrivedcount = 0 |
volatile int | test1_arrivedcount_qos [3] = {0, 0, 0} |
volatile int | test1_deliveryCompleted = 0 |
MQTTClient_message | test1_pubmsg_check = MQTTClient_message_initializer |
volatile int | test2_arrivedcount = 0 |
volatile int | test2_deliveryCompleted = 0 |
MQTTClient_message | test2_pubmsg = MQTTClient_message_initializer |
int | tests = 0 |
FILE * | xml |
Multi-threaded tests for the Eclipse Paho MQTT C client
Definition in file test2.c.
long elapsed | ( | START_TIME_TYPE | start_time | ) |
void lock_mutex | ( | mutex_type | amutex | ) |
void myassert | ( | char * | filename, |
int | lineno, | ||
char * | description, | ||
int | value, | ||
char * | format, | ||
... | |||
) |
START_TIME_TYPE start_clock | ( | void | ) |
void test1_deliveryComplete | ( | void * | context, |
MQTTClient_deliveryToken | dt | ||
) |
int test1_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTClient_message * | m | ||
) |
thread_return_type WINAPI test1_sendAndReceive | ( | void * | n | ) |
void test2_deliveryComplete | ( | void * | context, |
MQTTClient_deliveryToken | dt | ||
) |
int test2_messageArrived | ( | void * | context, |
char * | topicName, | ||
int | topicLen, | ||
MQTTClient_message * | m | ||
) |
void test2_sendAndReceive | ( | MQTTClient * | c, |
int | qos, | ||
char * | test_topic | ||
) |
void unlock_mutex | ( | mutex_type | amutex | ) |
mutex_type deliveryCompleted_mutex = &deliveryCompleted_mutex_store |
pthread_mutex_t deliveryCompleted_mutex_store = PTHREAD_MUTEX_INITIALIZER |
START_TIME_TYPE global_start_time |
struct Options options |
MQTTClient_message test1_pubmsg_check = MQTTClient_message_initializer |
MQTTClient_message test2_pubmsg = MQTTClient_message_initializer |