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

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
 

Enumerations

enum  msgTypes {
  CONNECT = 1, CONNACK, PUBLISH, PUBACK,
  PUBREC, PUBREL, PUBCOMP, SUBSCRIBE,
  SUBACK, UNSUBSCRIBE, UNSUBACK, PINGREQ,
  PINGRESP, DISCONNECT, AUTH, CONNECT,
  PUBLISH, SUBSCRIBE, SUBSCRIBE_MANY, UNSUBSCRIBE,
  CONNECT = 1, CONNACK, PUBLISH, PUBACK,
  PUBREC, PUBREL, PUBCOMP, SUBSCRIBE,
  SUBACK, UNSUBSCRIBE, UNSUBACK, PINGREQ,
  PINGRESP, DISCONNECT, AUTH
}
 

Functions

void disconnected (void *context, MQTTProperties *props, enum MQTTReasonCodes rc)
 
long elapsed (START_TIME_TYPE start_time)
 
void getopts (int argc, char **argv)
 
void logProperties (MQTTProperties *props)
 
int main (int argc, char **argv)
 
int messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
void myassert (char *filename, int lineno, char *description, int value, char *format,...)
 
void MyLog (int LOGA_level, char *format,...)
 
void published (void *context, int msgid, int packet_type, MQTTProperties *props, enum MQTTReasonCodes rc)
 
START_TIME_TYPE start_clock (void)
 
int test2_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
int test_client_topic_aliases (struct Options options)
 
int test_error_reporting (struct Options options)
 
int test_flow_control (struct Options options)
 
int test_flow_control_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
void test_flow_control_trace_callback (enum MQTTCLIENT_TRACE_LEVELS level, char *message)
 
int test_qos_1_2_errors (struct Options options)
 
int test_request_response (struct Options options)
 
int test_request_response_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
int test_server_topic_aliases (struct Options options)
 
int test_shared_subscriptions (struct Options options)
 
int test_shared_subscriptions_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
int test_subscribe_options (struct Options options)
 
int test_subscribe_options_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
int test_subscription_ids (struct Options options)
 
int test_subscription_ids_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *message)
 
void test_trace_callback (enum MQTTCLIENT_TRACE_LEVELS level, char *message)
 
void usage (void)
 
void write_test_result (void)
 

Variables

static int blocking_found = 0
 
MQTTClient c
 
char * cur_output = output
 
MQTTClient d
 
int failures = 0
 
START_TIME_TYPE global_start_time
 
static int messages_arrived = 0
 
struct Options options
 
char output [3000]
 
struct {
   int   packet_type
 
   int   published
 
   enum MQTTReasonCodes   rc
 
test_qos_1_2_errors_globals
 
struct {
   char *   correlation_id
 
   int   messages_arrived
 
   char *   request_topic
 
   char *   response_topic
 
test_request_response_globals
 
struct {
   int   messages_arrived
 
   char *   shared_topic
 
   char *   topic
 
test_shared_subscriptions_globals
 
struct {
   int   messages_arrived
 
   char *   topic
 
test_subscribe_options_globals
 
struct {
   int   disconnected
 
test_topic_aliases_globals
 
int tests = 0
 
FILE * xml
 

Detailed Description

MQTT V5 specific tests for the MQTT C client

Definition in file test10.c.

Macro Definition Documentation

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

Definition at line 53 of file test10.c.

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

Definition at line 258 of file test10.c.

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

Definition at line 259 of file test10.c.

#define LOGA_DEBUG   0

Definition at line 158 of file test10.c.

#define LOGA_INFO   1

Definition at line 159 of file test10.c.

#define mqsleep   sleep

Definition at line 219 of file test10.c.

#define START_TIME_TYPE   struct timeval

Definition at line 220 of file test10.c.

Enumeration Type Documentation

enum msgTypes
Enumerator
CONNECT 
CONNACK 
PUBLISH 
PUBACK 
PUBREC 
PUBREL 
PUBCOMP 
SUBSCRIBE 
SUBACK 
UNSUBSCRIBE 
UNSUBACK 
PINGREQ 
PINGRESP 
DISCONNECT 
AUTH 
CONNECT 
PUBLISH 
SUBSCRIBE 
SUBSCRIBE_MANY 
UNSUBSCRIBE 
CONNECT 
CONNACK 
PUBLISH 
PUBACK 
PUBREC 
PUBREL 
PUBCOMP 
SUBSCRIBE 
SUBACK 
UNSUBSCRIBE 
UNSUBACK 
PINGREQ 
PINGRESP 
DISCONNECT 
AUTH 

Definition at line 1139 of file test10.c.

Function Documentation

void disconnected ( void *  context,
MQTTProperties props,
enum MQTTReasonCodes  rc 
)

Definition at line 351 of file test10.c.

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 247 of file test10.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 83 of file test10.c.

void logProperties ( MQTTProperties props)

Definition at line 305 of file test10.c.

int main ( int  argc,
char **  argv 
)

Definition at line 1812 of file test10.c.

int messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 361 of file test10.c.

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

Definition at line 283 of file test10.c.

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

Definition at line 163 of file test10.c.

void published ( void *  context,
int  msgid,
int  packet_type,
MQTTProperties props,
enum MQTTReasonCodes  rc 
)

Definition at line 1119 of file test10.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 222 of file test10.c.

int test2_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 606 of file test10.c.

int test_client_topic_aliases ( struct Options  options)

Definition at line 384 of file test10.c.

int test_error_reporting ( struct Options  options)

Definition at line 1019 of file test10.c.

int test_flow_control ( struct Options  options)

Definition at line 921 of file test10.c.

int test_flow_control_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 891 of file test10.c.

void test_flow_control_trace_callback ( enum MQTTCLIENT_TRACE_LEVELS  level,
char *  message 
)

Definition at line 912 of file test10.c.

int test_qos_1_2_errors ( struct Options  options)

Definition at line 1147 of file test10.c.

int test_request_response ( struct Options  options)

Definition at line 1360 of file test10.c.

int test_request_response_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 1308 of file test10.c.

int test_server_topic_aliases ( struct Options  options)

Definition at line 642 of file test10.c.

int test_shared_subscriptions ( struct Options  options)

Definition at line 1685 of file test10.c.

int test_shared_subscriptions_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 1658 of file test10.c.

int test_subscribe_options ( struct Options  options)

Definition at line 1538 of file test10.c.

int test_subscribe_options_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 1505 of file test10.c.

int test_subscription_ids ( struct Options  options)

Definition at line 782 of file test10.c.

int test_subscription_ids_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message message 
)

Definition at line 749 of file test10.c.

void test_trace_callback ( enum MQTTCLIENT_TRACE_LEVELS  level,
char *  message 
)

Definition at line 1134 of file test10.c.

void usage ( void  )

Definition at line 55 of file test10.c.

void write_test_result ( void  )

Definition at line 269 of file test10.c.

Variable Documentation

int blocking_found = 0
static

Definition at line 910 of file test10.c.

Definition at line 1656 of file test10.c.

char* correlation_id

Definition at line 1298 of file test10.c.

char* cur_output = output

Definition at line 266 of file test10.c.

Definition at line 1656 of file test10.c.

int disconnected

Definition at line 345 of file test10.c.

int failures = 0

Definition at line 262 of file test10.c.

START_TIME_TYPE global_start_time

Definition at line 264 of file test10.c.

int messages_arrived = 0
static

Definition at line 359 of file test10.c.

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

Definition at line 265 of file test10.c.

int packet_type

Definition at line 1111 of file test10.c.

int published

Definition at line 1110 of file test10.c.

enum MQTTReasonCodes rc

Definition at line 1112 of file test10.c.

char* request_topic

Definition at line 1296 of file test10.c.

char* response_topic

Definition at line 1295 of file test10.c.

char* shared_topic

Definition at line 1646 of file test10.c.

struct { ... } test_qos_1_2_errors_globals
struct { ... } test_request_response_globals
Initial value:
=
{
"my response topic",
"my request topic",
0,
"request no 1",
}
struct { ... } test_shared_subscriptions_globals
Initial value:
=
{
"$share/share_test/#",
"a",
0,
}
struct { ... } test_subscribe_options_globals
Initial value:
=
{
"my response topic",
0,
}
struct { ... } test_topic_aliases_globals
Initial value:
=
{
0,
}
int tests = 0

Definition at line 261 of file test10.c.

char* topic

Definition at line 1496 of file test10.c.

FILE* xml

Definition at line 263 of file test10.c.



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