Classes | Macros | Functions | Variables
test1.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 test1.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 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)
 
void test1_sendAndReceive (MQTTClient *c, int qos, char *test_topic)
 
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)
 
int test3 (struct Options options)
 
int test4 (struct Options options)
 
int test4_run (int qos)
 
int test5 (struct Options options)
 
int test6 (struct Options options)
 
void test6_connectionLost (void *context, char *cause)
 
void test6_deliveryComplete (void *context, MQTTClient_deliveryToken token)
 
int test6_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *m)
 
int test6a (struct Options options)
 
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]
 
volatile int test2_arrivedcount = 0
 
int test2_deliveryCompleted = 0
 
MQTTClient_message test2_pubmsg = MQTTClient_message_initializer
 
MQTTClient test6_c1
 
MQTTClient test6_c2
 
volatile int test6_connection_lost_called = 0
 
char * test6_will_message = "will message from Client-1"
 
volatile int test6_will_message_arrived = 0
 
char * test6_will_topic = "C Test 2: will topic"
 
int tests = 0
 
FILE * xml
 

Detailed Description

Tests for the MQ Telemetry MQTT C client

Definition in file test1.c.

Macro Definition Documentation

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

Definition at line 39 of file test1.c.

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

Definition at line 244 of file test1.c.

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

Definition at line 245 of file test1.c.

#define LOGA_DEBUG   0

Definition at line 144 of file test1.c.

#define LOGA_INFO   1

Definition at line 145 of file test1.c.

#define mqsleep   sleep

Definition at line 205 of file test1.c.

#define START_TIME_TYPE   struct timeval

Definition at line 206 of file test1.c.

Function Documentation

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 233 of file test1.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 69 of file test1.c.

int main ( int  argc,
char **  argv 
)

Definition at line 1164 of file test1.c.

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

Definition at line 269 of file test1.c.

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

Definition at line 149 of file test1.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 208 of file test1.c.

int test1 ( struct Options  options)

Definition at line 358 of file test1.c.

void test1_sendAndReceive ( MQTTClient c,
int  qos,
char *  test_topic 
)

Definition at line 296 of file test1.c.

int test2 ( struct Options  options)

Definition at line 533 of file test1.c.

void test2_deliveryComplete ( void *  context,
MQTTClient_deliveryToken  dt 
)

Definition at line 444 of file test1.c.

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

Definition at line 449 of file test1.c.

void test2_sendAndReceive ( MQTTClient c,
int  qos,
char *  test_topic 
)

Definition at line 466 of file test1.c.

int test3 ( struct Options  options)

Definition at line 609 of file test1.c.

int test4 ( struct Options  options)

Definition at line 826 of file test1.c.

int test4_run ( int  qos)

Definition at line 681 of file test1.c.

int test5 ( struct Options  options)

Definition at line 848 of file test1.c.

int test6 ( struct Options  options)

Definition at line 950 of file test1.c.

void test6_connectionLost ( void *  context,
char *  cause 
)

Definition at line 922 of file test1.c.

void test6_deliveryComplete ( void *  context,
MQTTClient_deliveryToken  token 
)

Definition at line 929 of file test1.c.

int test6_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTClient_message m 
)

Definition at line 937 of file test1.c.

int test6a ( struct Options  options)

Definition at line 1057 of file test1.c.

void usage ( void  )

Definition at line 41 of file test1.c.

void write_test_result ( void  )

Definition at line 255 of file test1.c.

Variable Documentation

char* cur_output = output

Definition at line 252 of file test1.c.

int failures = 0

Definition at line 248 of file test1.c.

START_TIME_TYPE global_start_time

Definition at line 250 of file test1.c.

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

Definition at line 251 of file test1.c.

volatile int test2_arrivedcount = 0

Definition at line 440 of file test1.c.

int test2_deliveryCompleted = 0

Definition at line 441 of file test1.c.

Definition at line 442 of file test1.c.

MQTTClient test6_c1

Definition at line 918 of file test1.c.

MQTTClient test6_c2

Definition at line 918 of file test1.c.

volatile int test6_connection_lost_called = 0

Definition at line 920 of file test1.c.

char* test6_will_message = "will message from Client-1"

Definition at line 935 of file test1.c.

volatile int test6_will_message_arrived = 0

Definition at line 919 of file test1.c.

char* test6_will_topic = "C Test 2: will topic"

Definition at line 934 of file test1.c.

int tests = 0

Definition at line 247 of file test1.c.

FILE* xml

Definition at line 249 of file test1.c.



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