Classes | Macros | Functions | Variables
test2.c File Reference
#include "MQTTClient.h"
#include "Thread.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 test2.c:

Go to the source code of this file.

Classes

struct  Options
 
struct  thread_parms
 

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
 
#define WINAPI
 

Functions

long elapsed (START_TIME_TYPE start_time)
 
void getopts (int argc, char **argv)
 
void lock_mutex (mutex_type amutex)
 
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_deliveryComplete (void *context, MQTTClient_deliveryToken dt)
 
int test1_messageArrived (void *context, char *topicName, int topicLen, MQTTClient_message *m)
 
thread_return_type WINAPI test1_sendAndReceive (void *n)
 
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)
 
void unlock_mutex (mutex_type amutex)
 
void usage (void)
 
void write_test_result (void)
 

Variables

char * cur_output = output
 
mutex_type deliveryCompleted_mutex = &deliveryCompleted_mutex_store
 
pthread_mutex_t deliveryCompleted_mutex_store = PTHREAD_MUTEX_INITIALIZER
 
int failures = 0
 
START_TIME_TYPE global_start_time
 
static int iterations = 50
 
struct Options options
 
char output [3000]
 
volatile int test1_arrivedcount = 0
 
volatile int test1_arrivedcount_qos [3] = {0, 0, 0}
 
volatile int test1_deliveryCompleted = 0
 
MQTTClient_message test1_pubmsg_check = MQTTClient_message_initializer
 
volatile int test2_arrivedcount = 0
 
volatile int test2_deliveryCompleted = 0
 
MQTTClient_message test2_pubmsg = MQTTClient_message_initializer
 
int tests = 0
 
FILE * xml
 

Detailed Description

Multi-threaded tests for the Eclipse Paho MQTT C client

Definition in file test2.c.

Macro Definition Documentation

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

Definition at line 39 of file test2.c.

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

Definition at line 235 of file test2.c.

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

Definition at line 236 of file test2.c.

#define LOGA_DEBUG   0

Definition at line 135 of file test2.c.

#define LOGA_INFO   1

Definition at line 136 of file test2.c.

#define mqsleep   sleep

Definition at line 196 of file test2.c.

#define START_TIME_TYPE   struct timeval

Definition at line 197 of file test2.c.

#define WINAPI

Definition at line 33 of file test2.c.

Function Documentation

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 224 of file test2.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 67 of file test2.c.

void lock_mutex ( mutex_type  amutex)

Definition at line 289 of file test2.c.

int main ( int  argc,
char **  argv 
)

Definition at line 676 of file test2.c.

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

Definition at line 260 of file test2.c.

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

Definition at line 140 of file test2.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 199 of file test2.c.

int test1 ( struct Options  options)

Definition at line 411 of file test2.c.

void test1_deliveryComplete ( void *  context,
MQTTClient_deliveryToken  dt 
)

Definition at line 315 of file test2.c.

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

Definition at line 323 of file test2.c.

thread_return_type WINAPI test1_sendAndReceive ( void *  n)

Definition at line 351 of file test2.c.

int test2 ( struct Options  options)

Definition at line 617 of file test2.c.

void test2_deliveryComplete ( void *  context,
MQTTClient_deliveryToken  dt 
)

Definition at line 525 of file test2.c.

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

Definition at line 533 of file test2.c.

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

Definition at line 550 of file test2.c.

void unlock_mutex ( mutex_type  amutex)

Definition at line 296 of file test2.c.

void usage ( void  )

Definition at line 41 of file test2.c.

void write_test_result ( void  )

Definition at line 246 of file test2.c.

Variable Documentation

char* cur_output = output

Definition at line 243 of file test2.c.

mutex_type deliveryCompleted_mutex = &deliveryCompleted_mutex_store

Definition at line 286 of file test2.c.

pthread_mutex_t deliveryCompleted_mutex_store = PTHREAD_MUTEX_INITIALIZER

Definition at line 285 of file test2.c.

int failures = 0

Definition at line 239 of file test2.c.

START_TIME_TYPE global_start_time

Definition at line 241 of file test2.c.

int iterations = 50
static

Definition at line 349 of file test2.c.

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

Definition at line 242 of file test2.c.

volatile int test1_arrivedcount = 0

Definition at line 309 of file test2.c.

volatile int test1_arrivedcount_qos[3] = {0, 0, 0}

Definition at line 310 of file test2.c.

volatile int test1_deliveryCompleted = 0

Definition at line 311 of file test2.c.

Definition at line 312 of file test2.c.

volatile int test2_arrivedcount = 0

Definition at line 519 of file test2.c.

volatile int test2_deliveryCompleted = 0

Definition at line 521 of file test2.c.

Definition at line 523 of file test2.c.

int tests = 0

Definition at line 238 of file test2.c.

FILE* xml

Definition at line 240 of file test2.c.



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