Classes | Macros | Functions | Variables
test4.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 test4.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 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
 

Detailed Description

Tests for the Paho Asynchronous MQTT C client

Definition in file test4.c.

Macro Definition Documentation

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

Definition at line 39 of file test4.c.

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

Definition at line 214 of file test4.c.

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

Definition at line 215 of file test4.c.

#define LOGA_DEBUG   0

Definition at line 115 of file test4.c.

#define LOGA_INFO   1

Definition at line 116 of file test4.c.

#define mqsleep   sleep

Definition at line 176 of file test4.c.

#define num_clients   10
#define START_TIME_TYPE   struct timeval

Definition at line 177 of file test4.c.

Function Documentation

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 204 of file test4.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 65 of file test4.c.

int main ( int  argc,
char **  argv 
)

Definition at line 1751 of file test4.c.

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

Definition at line 237 of file test4.c.

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

Definition at line 120 of file test4.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 179 of file test4.c.

int test1 ( struct Options  options)

Definition at line 361 of file test4.c.

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

Definition at line 286 of file test4.c.

void test1_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 339 of file test4.c.

void test1_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 263 of file test4.c.

void test1_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 321 of file test4.c.

void test1_onUnsubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 271 of file test4.c.

int test2 ( struct Options  options)

Definition at line 451 of file test4.c.

void test2_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 436 of file test4.c.

void test2_onFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 427 of file test4.c.

int test3 ( struct Options  options)

Definition at line 663 of file test4.c.

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

Definition at line 563 of file test4.c.

void test3_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 627 of file test4.c.

void test3_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 533 of file test4.c.

void test3_onFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 644 of file test4.c.

void test3_onPublish ( void *  context,
MQTTAsync_successData response 
)

Definition at line 541 of file test4.c.

void test3_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 609 of file test4.c.

void test3_onUnsubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 548 of file test4.c.

int test4 ( struct Options  options)

Definition at line 854 of file test4.c.

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

Definition at line 745 of file test4.c.

void test4_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 832 of file test4.c.

void test4_onPublish ( void *  context,
MQTTAsync_successData response 
)

Definition at line 738 of file test4.c.

void test4_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 810 of file test4.c.

int test5 ( struct Options  options)

Definition at line 949 of file test4.c.

void test5_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 933 of file test4.c.

void test5_onConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 920 of file test4.c.

int test6 ( struct Options  options)

Definition at line 1050 of file test4.c.

void test6_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1024 of file test4.c.

void test6_onConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1009 of file test4.c.

void test6_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1036 of file test4.c.

int test7 ( struct Options  options)

Definition at line 1253 of file test4.c.

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

Definition at line 1185 of file test4.c.

void test7_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1213 of file test4.c.

void test7_onConnectOnly ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1230 of file test4.c.

void test7_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1162 of file test4.c.

void test7_onDisconnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1152 of file test4.c.

void test7_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1203 of file test4.c.

void test7_onUnsubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1170 of file test4.c.

int test8 ( struct Options  options)

Definition at line 1541 of file test4.c.

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

Definition at line 1525 of file test4.c.

void test8_onConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1509 of file test4.c.

void test8_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1491 of file test4.c.

void test8_onDisconnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1480 of file test4.c.

void test8_onPublish ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1460 of file test4.c.

void test8_onPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1468 of file test4.c.

void test8_onSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1499 of file test4.c.

void trace_callback ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 1743 of file test4.c.

void usage ( void  )

Definition at line 41 of file test4.c.

void write_test_result ( void  )

Definition at line 224 of file test4.c.

Variable Documentation

char* cur_output = output

Definition at line 222 of file test4.c.

int failures = 0

Definition at line 218 of file test4.c.

START_TIME_TYPE global_start_time

Definition at line 220 of file test4.c.

struct Options options
Initial value:
=
{
"mqtt.eclipse.org:1883",
0,
-1,
10000,
1,
}
#define MQTTVERSION_DEFAULT
Definition: MQTTAsync.h:195
char output[3000]

Definition at line 221 of file test4.c.

int test2_onFailure_called = 0

Definition at line 425 of file test4.c.

void* test4_payload = NULL

Definition at line 735 of file test4.c.

int test4_payloadlen = 0

Definition at line 736 of file test4.c.

int test7_messageCount = 0

Definition at line 1150 of file test4.c.

int test7_subscribed = 0
static

Definition at line 1201 of file test4.c.

char* test7_topic = "C client test7"

Definition at line 1149 of file test4.c.

int test8_messageCount = 0

Definition at line 1456 of file test4.c.

int test8_publishFailures = 0

Definition at line 1458 of file test4.c.

int test8_subscribed = 0

Definition at line 1457 of file test4.c.

char* test8_topic = "C client test8"

Definition at line 1455 of file test4.c.

volatile int test_finished = 0

Definition at line 258 of file test4.c.

char* test_topic = "async test topic"

Definition at line 260 of file test4.c.

int tests = 0

Definition at line 217 of file test4.c.

FILE* xml

Definition at line 219 of file test4.c.



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