Classes | Macros | Functions | Variables
test5.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 <stdarg.h>
#include <time.h>
#include <sys/timeb.h>
Include dependency graph for test5.c:

Go to the source code of this file.

Classes

struct  AsyncTestClient
 
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 AsyncTestClient_initializer   {NULL, "\0", "\0", 0, {0, 0, 0}, {0, 0, 0}, 0, 0}
 
#define LOGA_DEBUG   0
 
#define LOGA_INFO   1
 
#define MAXMSGS   30;
 
#define mqsleep   sleep
 
#define num_clients   10
 
#define START_TIME_TYPE   struct timeval
 
#define TEST2D_COUNT   1000
 

Functions

int asyncTestMessageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *m)
 
void asyncTestOnConnect (void *context, MQTTAsync_successData *response)
 
void asyncTestOnDeliveryComplete (void *context, MQTTAsync_token token)
 
void asyncTestOnDisconnect (void *context, MQTTAsync_successData *response)
 
void asyncTestOnSend (void *context, MQTTAsync_successData *response)
 
void asyncTestOnSubscribe (void *context, MQTTAsync_successData *response)
 
void asyncTestOnSubscribeFailure (void *context, MQTTAsync_failureData *response)
 
void asyncTestOnUnsubscribe (void *context, MQTTAsync_successData *response)
 
long elapsed (START_TIME_TYPE start_time)
 
void getopts (int argc, char **argv)
 
void handleTrace (enum MQTTASYNC_TRACE_LEVELS level, char *message)
 
int main (int argc, char **argv)
 
void multiThread_deliveryComplete (void *context, MQTTAsync_token dt)
 
int multiThread_messageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *m)
 
void myassert (char *filename, int lineno, char *description, int value, char *format,...)
 
void MyLog (int LOGA_level, char *format,...)
 
static unsigned int onPSKAuth (const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len, void *context)
 
void sendAndReceive (MQTTAsync *c, int qos, char *test_topic)
 
START_TIME_TYPE start_clock (void)
 
int test1 (struct Options options)
 
int test10 (struct Options options)
 
void test10OnConnect (void *context, MQTTAsync_successData *response)
 
void test10OnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test1OnConnect (void *context, MQTTAsync_successData *response)
 
void test1OnFailure (void *context, MQTTAsync_failureData *response)
 
int test2a (struct Options options)
 
void test2aOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test2aOnPublishFailure (void *context, MQTTAsync_failureData *response)
 
int test2b (struct Options options)
 
void test2bOnConnect (void *context, MQTTAsync_successData *response)
 
void test2bOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
int test2c (struct Options options)
 
void test2cOnConnect (void *context, MQTTAsync_successData *response)
 
void test2cOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
int test2d (struct Options options)
 
void test2dOnConnect (void *context, MQTTAsync_successData *response)
 
void test2dOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
int test2e (struct Options options)
 
void test2eOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test2eOnPublishFailure (void *context, MQTTAsync_failureData *response)
 
int test3a (struct Options options)
 
void test3aOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
int test3b (struct Options options)
 
void test3bOnConnect (void *context, MQTTAsync_successData *response)
 
void test3bOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
int test4 (struct Options options)
 
void test4OnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test4OnPublishFailure (void *context, MQTTAsync_failureData *response)
 
int test5a (struct Options options)
 
void test5aOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test5aOnPublishFailure (void *context, MQTTAsync_failureData *response)
 
int test5b (struct Options options)
 
void test5bOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test5bOnPublishFailure (void *context, MQTTAsync_failureData *response)
 
int test5c (struct Options options)
 
void test5cOnConnect (void *context, MQTTAsync_successData *response)
 
void test5cOnConnectFailure (void *context, MQTTAsync_failureData *response)
 
int test6 (struct Options options)
 
void test6OnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test6OnPublishFailure (void *context, MQTTAsync_failureData *response)
 
int test7 (struct Options options)
 
int test7MessageArrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 
void test7OnConnect (void *context, MQTTAsync_successData *response)
 
void test7OnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void test7OnPublishFailure (void *context, MQTTAsync_failureData *response)
 
void test7OnPublishSuccess (void *context, MQTTAsync_successData *response)
 
void test7OnSubscribe (void *context, MQTTAsync_successData *response)
 
void test7OnUnsubscribe (void *context, MQTTAsync_successData *response)
 
int test8 (struct Options options)
 
int test9 (struct Options options)
 
void test9OnConnectFailure (void *context, MQTTAsync_failureData *response)
 
void usage (void)
 
void write_test_result (void)
 

Variables

char * cur_output = output
 
int failures = 0
 
START_TIME_TYPE global_start_time
 
volatile int multiThread_arrivedcount = 0
 
int multiThread_deliveryCompleted = 0
 
MQTTAsync_message multiThread_pubmsg = MQTTAsync_message_initializer
 
struct Options options
 
char output [3000]
 
int test10Finished
 
int test1Finished = 0
 
int test1OnFailureCalled = 0
 
int test2bFinished
 
int test2cFinished
 
int test2dFinished
 
int test3bFinished
 
int test5cFinished
 
void * test7_payload = NULL
 
int test7_payloadlen = 0
 
int test7OnPublishSuccessCount = 0
 
int test7OnUnsubscribed = 0
 
int tests = 0
 
FILE * xml
 

Detailed Description

SSL tests for the Eclipse Paho Asynchronous MQTT C client

Definition in file test5.c.

Macro Definition Documentation

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

Definition at line 40 of file test5.c.

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

Definition at line 325 of file test5.c.

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

Definition at line 326 of file test5.c.

#define AsyncTestClient_initializer   {NULL, "\0", "\0", 0, {0, 0, 0}, {0, 0, 0}, 0, 0}

Definition at line 107 of file test5.c.

#define LOGA_DEBUG   0

Definition at line 227 of file test5.c.

#define LOGA_INFO   1

Definition at line 228 of file test5.c.

#define MAXMSGS   30;

Definition at line 328 of file test5.c.

#define mqsleep   sleep

Definition at line 288 of file test5.c.

#define num_clients   10
#define START_TIME_TYPE   struct timeval

Definition at line 289 of file test5.c.

#define TEST2D_COUNT   1000

Function Documentation

int asyncTestMessageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message m 
)

Definition at line 566 of file test5.c.

void asyncTestOnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 624 of file test5.c.

void asyncTestOnDeliveryComplete ( void *  context,
MQTTAsync_token  token 
)

Definition at line 619 of file test5.c.

void asyncTestOnDisconnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 492 of file test5.c.

void asyncTestOnSend ( void *  context,
MQTTAsync_successData response 
)

Definition at line 503 of file test5.c.

void asyncTestOnSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 536 of file test5.c.

void asyncTestOnSubscribeFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 514 of file test5.c.

void asyncTestOnUnsubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 523 of file test5.c.

long elapsed ( START_TIME_TYPE  start_time)

Definition at line 315 of file test5.c.

void getopts ( int  argc,
char **  argv 
)

Definition at line 109 of file test5.c.

void handleTrace ( enum MQTTASYNC_TRACE_LEVELS  level,
char *  message 
)

Definition at line 2686 of file test5.c.

int main ( int  argc,
char **  argv 
)

Definition at line 2692 of file test5.c.

void multiThread_deliveryComplete ( void *  context,
MQTTAsync_token  dt 
)

Definition at line 385 of file test5.c.

int multiThread_messageArrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message m 
)

Definition at line 390 of file test5.c.

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

Definition at line 351 of file test5.c.

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

Definition at line 232 of file test5.c.

static unsigned int onPSKAuth ( const char *  hint,
char *  identity,
unsigned int  max_identity_len,
unsigned char *  psk,
unsigned int  max_psk_len,
void *  context 
)
static

Definition at line 2367 of file test5.c.

void sendAndReceive ( MQTTAsync c,
int  qos,
char *  test_topic 
)

Definition at line 409 of file test5.c.

START_TIME_TYPE start_clock ( void  )

Definition at line 291 of file test5.c.

int test1 ( struct Options  options)

Definition at line 668 of file test5.c.

int test10 ( struct Options  options)

Definition at line 2601 of file test5.c.

void test10OnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 2593 of file test5.c.

void test10OnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 2583 of file test5.c.

void test1OnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 658 of file test5.c.

void test1OnFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 650 of file test5.c.

int test2a ( struct Options  options)

Definition at line 769 of file test5.c.

void test2aOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 750 of file test5.c.

void test2aOnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 760 of file test5.c.

int test2b ( struct Options  options)

Definition at line 886 of file test5.c.

void test2bOnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 878 of file test5.c.

void test2bOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 870 of file test5.c.

int test2c ( struct Options  options)

Definition at line 981 of file test5.c.

void test2cOnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 973 of file test5.c.

void test2cOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 965 of file test5.c.

int test2d ( struct Options  options)

Definition at line 1080 of file test5.c.

void test2dOnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1072 of file test5.c.

void test2dOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1064 of file test5.c.

int test2e ( struct Options  options)

Definition at line 1195 of file test5.c.

void test2eOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1176 of file test5.c.

void test2eOnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1186 of file test5.c.

int test3a ( struct Options  options)

Definition at line 1306 of file test5.c.

void test3aOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1297 of file test5.c.

int test3b ( struct Options  options)

Definition at line 1439 of file test5.c.

void test3bOnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1431 of file test5.c.

void test3bOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1423 of file test5.c.

int test4 ( struct Options  options)

Definition at line 1528 of file test5.c.

void test4OnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1512 of file test5.c.

void test4OnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1521 of file test5.c.

int test5a ( struct Options  options)

Definition at line 1638 of file test5.c.

void test5aOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1622 of file test5.c.

void test5aOnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1631 of file test5.c.

int test5b ( struct Options  options)

Definition at line 1771 of file test5.c.

void test5bOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1755 of file test5.c.

void test5bOnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1764 of file test5.c.

int test5c ( struct Options  options)

Definition at line 1906 of file test5.c.

void test5cOnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 1898 of file test5.c.

void test5cOnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1890 of file test5.c.

int test6 ( struct Options  options)

Definition at line 1995 of file test5.c.

void test6OnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1979 of file test5.c.

void test6OnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 1988 of file test5.c.

int test7 ( struct Options  options)

Definition at line 2257 of file test5.c.

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

Definition at line 2144 of file test5.c.

void test7OnConnect ( void *  context,
MQTTAsync_successData response 
)

Definition at line 2241 of file test5.c.

void test7OnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 2102 of file test5.c.

void test7OnPublishFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 2124 of file test5.c.

void test7OnPublishSuccess ( void *  context,
MQTTAsync_successData response 
)

Definition at line 2114 of file test5.c.

void test7OnSubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 2212 of file test5.c.

void test7OnUnsubscribe ( void *  context,
MQTTAsync_successData response 
)

Definition at line 2133 of file test5.c.

int test8 ( struct Options  options)

Definition at line 2385 of file test5.c.

int test9 ( struct Options  options)

Definition at line 2482 of file test5.c.

void test9OnConnectFailure ( void *  context,
MQTTAsync_failureData response 
)

Definition at line 2472 of file test5.c.

void usage ( void  )

Definition at line 42 of file test5.c.

void write_test_result ( void  )

Definition at line 338 of file test5.c.

Variable Documentation

char* cur_output = output

Definition at line 335 of file test5.c.

int failures = 0

Definition at line 331 of file test5.c.

START_TIME_TYPE global_start_time

Definition at line 333 of file test5.c.

volatile int multiThread_arrivedcount = 0

Definition at line 381 of file test5.c.

int multiThread_deliveryCompleted = 0

Definition at line 382 of file test5.c.

Definition at line 383 of file test5.c.

struct Options options
Initial value:
=
{
"ssl://m2m.eclipse.org:18883",
"ssl://m2m.eclipse.org:18884",
"ssl://m2m.eclipse.org:18887",
"ssl://m2m.eclipse.org:18885",
"ssl://m2m.eclipse.org:18886",
"ssl://m2m.eclipse.org:18888",
NULL,
NULL,
NULL,
NULL,
NULL,
0,
0,
5000000,
0,
3,
18883,
}
char output[3000]

Definition at line 334 of file test5.c.

int test10Finished

Definition at line 2581 of file test5.c.

int test1Finished = 0

Definition at line 646 of file test5.c.

int test1OnFailureCalled = 0

Definition at line 648 of file test5.c.

int test2bFinished

Definition at line 868 of file test5.c.

int test2cFinished

Definition at line 963 of file test5.c.

int test2dFinished

Definition at line 1062 of file test5.c.

int test3bFinished

Definition at line 1421 of file test5.c.

int test5cFinished

Definition at line 1888 of file test5.c.

void* test7_payload = NULL

Definition at line 2099 of file test5.c.

int test7_payloadlen = 0

Definition at line 2100 of file test5.c.

int test7OnPublishSuccessCount = 0

Definition at line 2111 of file test5.c.

int test7OnUnsubscribed = 0

Definition at line 2112 of file test5.c.

int tests = 0

Definition at line 330 of file test5.c.

FILE* xml

Definition at line 332 of file test5.c.



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