Classes | Macros | Functions | Variables
test45.c File Reference
#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>
Include dependency graph for test45.c:

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
 

Detailed Description

Tests for the Paho Asynchronous MQTT C client

Definition in file test45.c.

Macro Definition Documentation

#define ARRAY_SIZE (   a)    (sizeof(a) / sizeof(a[0]))

Definition at line 40 of file test45.c.

#define assert (   a,
  b,
  c,
  d 
)    myassert(__FILE__, __LINE__, a, b, c, d)

Definition at line 223 of file test45.c.

#define assert1 (   a,
  b,
  c,
  d,
 
)    myassert(__FILE__, __LINE__, a, b, c, d, e)

Definition at line 224 of file test45.c.

#define LOGA_DEBUG   0

Definition at line 117 of file test45.c.

#define LOGA_INFO   1

Definition at line 118 of file test45.c.

#define min (   a,
 
)    ((a < b) ? a : b)

Definition at line 983 of file test45.c.

#define num_clients   10
#define START_TIME_TYPE   struct timeval

Definition at line 186 of file test45.c.

Function Documentation

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 213 of file test45.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 66 of file test45.c.

void logProperties ( MQTTProperties props)

Definition at line 268 of file test45.c.

int main ( int  argc,
char **  argv 
)

Definition at line 2045 of file test45.c.

void myassert ( char *  filename,
int  lineno,
char *  description,
int  value,
char *  format,
  ... 
)

Definition at line 246 of file test45.c.

void MyLog ( int  LOGA_level,
char *  format,
  ... 
)

Definition at line 122 of file test45.c.

void MySleep ( long  milliseconds)

Definition at line 160 of file test45.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 188 of file test45.c.

int test1 ( struct Options  options)

Definition at line 512 of file test45.c.

int test1_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message message 
)

Definition at line 372 of file test45.c.

void test1_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 473 of file test45.c.

void test1_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 337 of file test45.c.

void test1_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 439 of file test45.c.

void test1_onUnsubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 345 of file test45.c.

int test2 ( struct Options  options)

Definition at line 617 of file test45.c.

void test2_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 602 of file test45.c.

void test2_onFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 593 of file test45.c.

int test3 ( struct Options  options)

Definition at line 825 of file test45.c.

int test3_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message message 
)

Definition at line 725 of file test45.c.

void test3_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 789 of file test45.c.

void test3_onDisconnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 695 of file test45.c.

void test3_onFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 806 of file test45.c.

void test3_onPublish ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 703 of file test45.c.

void test3_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 771 of file test45.c.

void test3_onUnsubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 710 of file test45.c.

int test4 ( struct Options  options)

Definition at line 1034 of file test45.c.

int test4_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message message 
)

Definition at line 904 of file test45.c.

void test4_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1010 of file test45.c.

void test4_onPublish ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 897 of file test45.c.

void test4_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 986 of file test45.c.

int test5 ( struct Options  options)

Definition at line 1125 of file test45.c.

void test5_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1109 of file test45.c.

void test5_onConnectFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1096 of file test45.c.

int test6 ( struct Options  options)

Definition at line 1223 of file test45.c.

void test6_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1197 of file test45.c.

void test6_onConnectFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1182 of file test45.c.

void test6_onDisconnect5 ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1209 of file test45.c.

int test7 ( struct Options  options)

Definition at line 1736 of file test45.c.

int test7_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message message 
)

Definition at line 1382 of file test45.c.

void test7_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1423 of file test45.c.

void test7_onConnect5 ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1447 of file test45.c.

void test7_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1336 of file test45.c.

void test7_onDisconnect5 ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1344 of file test45.c.

void test7_onDisconnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1314 of file test45.c.

void test7_onDisconnectFailure5 ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1325 of file test45.c.

void test7_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1411 of file test45.c.

void test7_onSubscribe5 ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1401 of file test45.c.

void test7_onUnsubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1352 of file test45.c.

void test7_onUnsubscribe5 ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1367 of file test45.c.

int test7_run ( int  qos,
int  start_mqtt_version,
int  restore_mqtt_version 
)

Definition at line 1476 of file test45.c.

int test8 ( struct Options  options)

Definition at line 1851 of file test45.c.

int test8_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message message 
)

Definition at line 1835 of file test45.c.

void test8_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1819 of file test45.c.

void test8_onDisconnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1801 of file test45.c.

void test8_onDisconnectFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1790 of file test45.c.

void test8_onPublish ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1770 of file test45.c.

void test8_onPublishFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1778 of file test45.c.

void test8_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1809 of file test45.c.

void trace_callback ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 2037 of file test45.c.

void usage ( void  )

Definition at line 42 of file test45.c.

void waitForNoPendingTokens ( MQTTAsync  c)

Definition at line 307 of file test45.c.

void write_test_result ( void  )

Definition at line 233 of file test45.c.

Variable Documentation

char* cur_output = output

Definition at line 231 of file test45.c.

int failures = 0

Definition at line 227 of file test45.c.

START_TIME_TYPE global_start_time

Definition at line 229 of file test45.c.

struct Options options
Initial value:
=
{
"localhost:1883",
0,
-1,
10000,
1,
}
#define MQTTVERSION_5
Definition: MQTTAsync.h:207
char output[3000]

Definition at line 230 of file test45.c.

int test2_onFailure_called = 0

Definition at line 591 of file test45.c.

int test4_packet_size = 10000

Definition at line 980 of file test45.c.

void* test4_payload = NULL

Definition at line 894 of file test45.c.

int test4_payloadlen = 0

Definition at line 895 of file test45.c.

int test7_just_connect = 0
static

Definition at line 1421 of file test45.c.

int test7_messageCount = 0

Definition at line 1311 of file test45.c.

int test7_subscribed = 0
static

Definition at line 1399 of file test45.c.

char* test7_topic = "C client test7"

Definition at line 1310 of file test45.c.

int test8_messageCount = 0

Definition at line 1766 of file test45.c.

int test8_publishFailures = 0

Definition at line 1768 of file test45.c.

int test8_subscribed = 0

Definition at line 1767 of file test45.c.

char* test8_topic = "C client test8"

Definition at line 1765 of file test45.c.

volatile int test_finished = 0

Definition at line 332 of file test45.c.

char* test_topic = "async test topic"

Definition at line 334 of file test45.c.

int tests = 0

Definition at line 226 of file test45.c.

FILE* xml

Definition at line 228 of file test45.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49