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

Functions

long elapsed (START_TIME_TYPE start_time)
 
void flow_control_trace_callback (enum MQTTASYNC_TRACE_LEVELS level, char *message)
 
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)
 
void test1_onDisconnect (void *context, MQTTAsync_successData *response)
 
int test_client_topic_aliases (struct Options options)
 
void test_client_topic_aliases_disconnected (void *context, MQTTProperties *props, enum MQTTReasonCodes rc)
 
int test_client_topic_aliases_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_client_topic_aliases_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_client_topic_aliases_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_error_reporting (struct Options options)
 
void test_error_reporting_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_error_reporting_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
void test_error_reporting_onUnsubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_flow_control (struct Options options)
 
int test_flow_control_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_flow_control_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_flow_control_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_qos_1_2_errors (struct Options options)
 
void test_qos_1_2_errors_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_qos_1_2_errors_onPublishFailure (void *context, MQTTAsync_failureData5 *response)
 
void test_qos_1_2_errors_onPublishFailure2 (void *context, MQTTAsync_failureData5 *response)
 
void test_qos_1_2_errors_onPublishFailure3 (void *context, MQTTAsync_failureData5 *response)
 
void test_qos_1_2_errors_onPublishSuccess (void *context, MQTTAsync_successData5 *response)
 
int test_request_response (struct Options options)
 
int test_request_response_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_request_response_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_request_response_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_server_topic_aliases (struct Options options)
 
int test_server_topic_aliases_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_server_topic_aliases_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_server_topic_aliases_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_shared_subscriptions (struct Options options)
 
int test_shared_subscriptions_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_shared_subscriptions_onConnectc (void *context, MQTTAsync_successData5 *response)
 
void test_shared_subscriptions_onConnectd (void *context, MQTTAsync_successData5 *response)
 
void test_shared_subscriptions_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_subscribeOptions (struct Options options)
 
int test_subscribeOptions_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_subscribeOptions_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_subscribeOptions_onSubscribe (void *context, MQTTAsync_successData5 *response)
 
int test_subscription_ids (struct Options options)
 
int test_subscription_ids_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test_subscription_ids_onConnect (void *context, MQTTAsync_successData5 *response)
 
void test_subscription_ids_onSubscribe (void *context, MQTTAsync_successData5 *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]
 
struct {
   int   disconnected
 
   int   test_finished
 
   char *   test_topic
 
test_client_topic_aliases_globals
 
struct {
   int   messages_arrived
 
   int   test_finished
 
   char *   test_topic
 
test_error_reporting_globals
 
struct {
   int   blocking_found
 
   int   messages_arrived
 
   int   receive_maximum
 
   int   test_finished
 
   char *   test_topic
 
test_flow_control_globals
 
struct {
   int   test_finished
 
   char *   test_topic
 
test_qos_1_2_errors_globals
 
struct {
   char *   correlation_id
 
   int   messages_arrived
 
   char *   request_topic
 
   char *   response_topic
 
   int   test_finished
 
test_request_response_globals
 
struct {
   int   messages_arrived
 
   int   msg_count
 
   int   test_finished
 
   char *   test_topic
 
test_server_topic_aliases_globals
 
struct {
   int   message_count
 
   int   messages_arrived
 
   char *   shared_topic
 
   int   test_finished
 
   char *   topic
 
test_shared_subscriptions_globals
 
struct {
   int   messages_arrived
 
   int   test_finished
 
   char *   topic1
 
   char *   topic2
 
test_subscribeOptions_globals
 
struct {
   int   messages_arrived
 
   int   test_finished
 
   char *   test_topic
 
test_subscription_ids_globals
 
int tests = 0
 
FILE * xml
 

Detailed Description

Tests for the Paho Asynchronous MQTT C client

Definition in file test11.c.

Macro Definition Documentation

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

Definition at line 40 of file test11.c.

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

Definition at line 220 of file test11.c.

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

Definition at line 221 of file test11.c.

#define LOGA_DEBUG   0

Definition at line 120 of file test11.c.

#define LOGA_INFO   1

Definition at line 121 of file test11.c.

#define mqsleep   sleep

Definition at line 182 of file test11.c.

#define START_TIME_TYPE   struct timeval

Definition at line 183 of file test11.c.

Function Documentation

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 210 of file test11.c.

void flow_control_trace_callback ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 1008 of file test11.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 66 of file test11.c.

void logProperties ( MQTTProperties props)

Definition at line 265 of file test11.c.

int main ( int  argc,
char **  argv 
)

Definition at line 2091 of file test11.c.

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

Definition at line 243 of file test11.c.

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

Definition at line 125 of file test11.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 185 of file test11.c.

void test1_onDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 315 of file test11.c.

int test_client_topic_aliases ( struct Options  options)

Definition at line 454 of file test11.c.

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

Definition at line 391 of file test11.c.

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

Definition at line 323 of file test11.c.

void test_client_topic_aliases_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 400 of file test11.c.

void test_client_topic_aliases_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 354 of file test11.c.

int test_error_reporting ( struct Options  options)

Definition at line 1194 of file test11.c.

void test_error_reporting_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1154 of file test11.c.

void test_error_reporting_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1111 of file test11.c.

void test_error_reporting_onUnsubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1085 of file test11.c.

int test_flow_control ( struct Options  options)

Definition at line 1017 of file test11.c.

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

Definition at line 928 of file test11.c.

void test_flow_control_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 979 of file test11.c.

void test_flow_control_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 952 of file test11.c.

int test_qos_1_2_errors ( struct Options  options)

Definition at line 1399 of file test11.c.

void test_qos_1_2_errors_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1358 of file test11.c.

void test_qos_1_2_errors_onPublishFailure ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1320 of file test11.c.

void test_qos_1_2_errors_onPublishFailure2 ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1282 of file test11.c.

void test_qos_1_2_errors_onPublishFailure3 ( void *  context,
MQTTAsync_failureData5 response 
)

Definition at line 1268 of file test11.c.

void test_qos_1_2_errors_onPublishSuccess ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1256 of file test11.c.

int test_request_response ( struct Options  options)

Definition at line 1636 of file test11.c.

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

Definition at line 1467 of file test11.c.

void test_request_response_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1610 of file test11.c.

void test_request_response_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1558 of file test11.c.

int test_server_topic_aliases ( struct Options  options)

Definition at line 668 of file test11.c.

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

Definition at line 566 of file test11.c.

void test_server_topic_aliases_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 640 of file test11.c.

void test_server_topic_aliases_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 612 of file test11.c.

int test_shared_subscriptions ( struct Options  options)

Definition at line 2002 of file test11.c.

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

Definition at line 1892 of file test11.c.

void test_shared_subscriptions_onConnectc ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1982 of file test11.c.

void test_shared_subscriptions_onConnectd ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1962 of file test11.c.

void test_shared_subscriptions_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1916 of file test11.c.

int test_subscribeOptions ( struct Options  options)

Definition at line 1823 of file test11.c.

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

Definition at line 1703 of file test11.c.

void test_subscribeOptions_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1792 of file test11.c.

void test_subscribeOptions_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 1737 of file test11.c.

int test_subscription_ids ( struct Options  options)

Definition at line 858 of file test11.c.

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

Definition at line 749 of file test11.c.

void test_subscription_ids_onConnect ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 827 of file test11.c.

void test_subscription_ids_onSubscribe ( void *  context,
MQTTAsync_successData5 response 
)

Definition at line 783 of file test11.c.

void trace_callback ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 2085 of file test11.c.

void usage ( void  )

Definition at line 42 of file test11.c.

void write_test_result ( void  )

Definition at line 230 of file test11.c.

Variable Documentation

int blocking_found

Definition at line 921 of file test11.c.

char* correlation_id

Definition at line 1455 of file test11.c.

char* cur_output = output

Definition at line 228 of file test11.c.

int disconnected

Definition at line 306 of file test11.c.

int failures = 0

Definition at line 224 of file test11.c.

START_TIME_TYPE global_start_time

Definition at line 226 of file test11.c.

int message_count

Definition at line 1881 of file test11.c.

int messages_arrived

Definition at line 558 of file test11.c.

int msg_count

Definition at line 559 of file test11.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 227 of file test11.c.

int receive_maximum

Definition at line 920 of file test11.c.

char* request_topic

Definition at line 1454 of file test11.c.

char* response_topic

Definition at line 1453 of file test11.c.

char* shared_topic

Definition at line 1877 of file test11.c.

struct { ... } test_client_topic_aliases_globals
Initial value:
=
{
0, "client topic aliases topic", 0
}
struct { ... } test_error_reporting_globals
Initial value:
=
{
"error reporting topic", 0, 0
}
int test_finished

Definition at line 308 of file test11.c.

struct { ... } test_flow_control_globals
Initial value:
=
{
"flow control topic", 0, 0, 65535, 0
}
struct { ... } test_qos_1_2_errors_globals
Initial value:
=
{
0, "test_qos_1_2_errors"
}
struct { ... } test_request_response_globals
Initial value:
=
{
0,
"test_7_request",
"test_7_response",
"test_7_correlation_id",
0
}
struct { ... } test_server_topic_aliases_globals
Initial value:
=
{
"server topic aliases topic", 0, 0, 3
}
struct { ... } test_shared_subscriptions_globals
Initial value:
=
{
"$share/share_test/any",
"any",
0,
0,
10,
}
struct { ... } test_subscribeOptions_globals
Initial value:
=
{
0,
"subscribe options topic",
"+",
0
}
struct { ... } test_subscription_ids_globals
Initial value:
=
{
"server subscription ids topic", 0, 0
}
char test_topic

Definition at line 307 of file test11.c.

int tests = 0

Definition at line 223 of file test11.c.

char* topic

Definition at line 1878 of file test11.c.

char* topic1

Definition at line 1691 of file test11.c.

char* topic2

Definition at line 1692 of file test11.c.

FILE* xml

Definition at line 225 of file test11.c.



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