Classes | Macros | Functions | Variables
test_issue373.c File Reference
#include "MQTTAsync.h"
#include <string.h>
#include <stdlib.h>
#include "Thread.h"
#include <sys/time.h>
#include <sys/socket.h>
#include <unistd.h>
#include <errno.h>
#include "Heap.h"
#include <stdarg.h>
#include <time.h>
#include <sys/timeb.h>
Include dependency graph for test_issue373.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 LOGA_DEBUG   0
 
#define LOGA_INFO   1
 

Functions

void getopts (int argc, char **argv)
 
void handleTrace (enum MQTTASYNC_TRACE_LEVELS level, char *message)
 
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)
 
void test1373OnFailure (void *context, MQTTAsync_failureData *response)
 
int test373_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test373_onWriteFailure (void *context, MQTTAsync_failureData *response)
 
void test373_onWriteSuccess (void *context, MQTTAsync_successData *response)
 
void test373ConnectionLost (void *context, char *cause)
 
void test373DeliveryComplete (void *context, MQTTAsync_token token)
 
void test373OnConnect (void *context, MQTTAsync_successData *response)
 
int test373SendPublishMessage (MQTTAsync handle, int id, const unsigned int QoS)
 
int test_373 (struct Options options)
 
void usage (void)
 

Variables

int connectCnt = 0
 
int connected = 0
 
int connecting = 0
 
int failedPublishCnt = 0
 
int failures = 0
 
int goodPublishCnt = 0
 
struct Options options
 
int pendingMessageCnt = 0
 
int pendingMessageCntMax = 0
 
static char test373Payload [] = "No one is interested in this payload"
 
int tests = 0
 
char unique [50]
 

Detailed Description

Test for issues 373, 385: Memory leak and segmentation fault during connection lost and reconnect

Definition in file test_issue373.c.

Macro Definition Documentation

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

Definition at line 43 of file test_issue373.c.

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

Definition at line 154 of file test_issue373.c.

#define LOGA_DEBUG   0

Definition at line 103 of file test_issue373.c.

#define LOGA_INFO   1

Definition at line 104 of file test_issue373.c.

Function Documentation

void getopts ( int  argc,
char **  argv 
)

Definition at line 69 of file test_issue373.c.

void handleTrace ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 374 of file test_issue373.c.

int main ( int  argc,
char **  argv 
)

Definition at line 379 of file test_issue373.c.

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

Definition at line 166 of file test_issue373.c.

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

Definition at line 108 of file test_issue373.c.

void MySleep ( long  milliseconds)

Definition at line 145 of file test_issue373.c.

void test1373OnFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 188 of file test_issue373.c.

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

Definition at line 238 of file test_issue373.c.

void test373_onWriteFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 232 of file test_issue373.c.

void test373_onWriteSuccess ( void *  context,
MQTTAsync_successData response 
)

Definition at line 226 of file test_issue373.c.

void test373ConnectionLost ( void *  context,
char *  cause 
)

Definition at line 216 of file test_issue373.c.

void test373DeliveryComplete ( void *  context,
MQTTAsync_token  token 
)

Definition at line 222 of file test_issue373.c.

void test373OnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 194 of file test_issue373.c.

int test373SendPublishMessage ( MQTTAsync  handle,
int  id,
const unsigned int  QoS 
)

Definition at line 245 of file test_issue373.c.

int test_373 ( struct Options  options)

Definition at line 272 of file test_issue373.c.

void usage ( void  )

Definition at line 45 of file test_issue373.c.

Variable Documentation

int connectCnt = 0

Definition at line 163 of file test_issue373.c.

int connected = 0

Definition at line 158 of file test_issue373.c.

int connecting = 0

Definition at line 164 of file test_issue373.c.

int failedPublishCnt = 0

Definition at line 161 of file test_issue373.c.

int failures = 0

Definition at line 157 of file test_issue373.c.

int goodPublishCnt = 0

Definition at line 162 of file test_issue373.c.

struct Options options
Initial value:
=
{
"localhost:1883",
"localhost:1884",
0,
0,
0,
5
}
int pendingMessageCnt = 0

Definition at line 159 of file test_issue373.c.

int pendingMessageCntMax = 0

Definition at line 160 of file test_issue373.c.

char test373Payload[] = "No one is interested in this payload"
static

Definition at line 243 of file test_issue373.c.

int tests = 0

Definition at line 156 of file test_issue373.c.

char unique[50]

Definition at line 41 of file test_issue373.c.



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