31 #define MAXHOSTNAMELEN 256 32 #define snprintf _snprintf 35 #include <sys/socket.h> 40 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) 45 printf(
"\t--test_no <test_no> - Run test number <test_no>\n");
46 printf(
"\t--hostname <hostname> - Connect to <hostname> for tests\n");
47 printf(
"\t--client_key <key_file> - Use <key_file> as the client certificate for SSL authentication\n");
48 printf(
"\t--client_key_pass <password> - Use <password> to access the private key in the client certificate\n");
49 printf(
"\t--server_key <key_file> - Use <key_file> as the trusted certificate for server\n");
50 printf(
"\t--verbose - Enable verbose output \n");
51 printf(
"\t--help - This help output\n");
76 "ssl://m2m.eclipse.org:18883",
77 "ssl://m2m.eclipse.org:18884",
78 "ssl://m2m.eclipse.org:18887",
79 "ssl://m2m.eclipse.org:18885",
80 "ssl://m2m.eclipse.org:18886",
81 "ssl://m2m.eclipse.org:18888",
107 #define AsyncTestClient_initializer {NULL, "\0", "\0", 0, {0, 0, 0}, {0, 0, 0}, 0, 0} 115 if (strcmp(argv[count],
"--help") == 0)
119 else if (strcmp(argv[count],
"--test_no") == 0)
126 else if (strcmp(argv[count],
"--client_key") == 0)
133 else if (strcmp(argv[count],
"--client_key_pass") == 0)
140 else if (strcmp(argv[count],
"--server_key") == 0)
147 else if (strcmp(argv[count],
"--capath") == 0)
154 else if (strcmp(argv[count],
"--verbose") == 0)
157 printf(
"\nSetting verbose on\n");
159 else if (strcmp(argv[count],
"--hostname") == 0)
173 printf(
"Setting nocert_mutual_auth_connection to %s\n",
188 else if (strcmp(argv[count],
"--ws") == 0)
191 printf(
"\nSetting websockets on\n");
193 else if (strcmp(argv[count],
"--size") == 0)
202 else if (strcmp(argv[count],
"--port") == 0)
211 else if (strcmp(argv[count],
"--count") == 0)
221 printf(
"Unrecognized option %s\n", argv[count]);
231 #include <sys/timeb.h> 236 #if defined(_WIN32) || defined(_WINDOWS) 246 #if defined(_WIN32) || defined(_WINDOWS) 250 gettimeofday(&ts, NULL);
251 localtime_r(&ts.tv_sec, &timeinfo);
253 strftime(msg_buf, 80,
"%Y%m%d %H%M%S", &timeinfo);
255 #if defined(_WIN32) || defined(_WINDOWS) 256 sprintf(&msg_buf[strlen(msg_buf)],
".%.3hu ", ts.millitm);
258 sprintf(&msg_buf[strlen(msg_buf)],
".%.3lu ", ts.tv_usec / 1000);
261 va_start(args, format);
262 vsnprintf(&msg_buf[strlen(msg_buf)],
sizeof(msg_buf) - strlen(msg_buf), format, args);
265 printf(
"%s\n", msg_buf);
270 #if defined(_WIN32) || defined(_WINDOWS) 271 #define mqsleep(A) Sleep(1000*A) 272 #define START_TIME_TYPE DWORD 273 static DWORD start_time = 0;
276 return GetTickCount();
279 #define mqsleep sleep 280 #define START_TIME_TYPE struct timespec 283 static struct timespec start;
284 clock_gettime(CLOCK_REALTIME, &start);
288 #define mqsleep sleep 289 #define START_TIME_TYPE struct timeval 293 struct timeval start_time;
294 gettimeofday(&start_time, NULL);
302 return GetTickCount() - start_time;
306 long elapsed(
struct timespec start)
308 struct timespec now, res;
310 clock_gettime(CLOCK_REALTIME, &now);
311 ntimersub(now, start, res);
312 return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L;
317 struct timeval now, res;
319 gettimeofday(&now, NULL);
320 timersub(&now, &start_time, &res);
321 return (res.tv_sec) * 1000 + (res.tv_usec) / 1000;
325 #define assert(a, b, c, d) myassert(__FILE__, __LINE__, a, b, c, d) 326 #define assert1(a, b, c, d, e) myassert(__FILE__, __LINE__, a, b, c, d, e) 342 fprintf(
xml,
" time=\"%ld.%.3ld\" >\n", duration / 1000, duration % 1000);
348 fprintf(
xml,
"</testcase>\n");
360 printf(
"Assertion failed, file %s, line %d, description: %s", filename,
361 lineno, description);
363 va_start(args, format);
364 vprintf(format, args);
368 description, filename, lineno);
372 "Assertion succeeded, file %s, line %d, description: %s",
373 filename, lineno, description);
394 MyLog(
LOGA_DEBUG,
"Callback: %d message received on topic %s is %.*s.",
415 int wait_seconds = 0;
422 =
"a much longer message that we can shorten to the extent that we need to";
424 multiThread_pubmsg.
qos =
qos;
431 multiThread_pubmsg.
payload, multiThread_pubmsg.
qos,
455 assert(
"Message Arrived", wait_seconds > 0,
456 "Time out waiting for message %d\n", i );
476 assert(
"All Deliveries Complete", wait_seconds > 0,
477 "Number of deliveryCompleted callbacks was %d\n",
520 assert(
"There should be no failures in this test. ", 0,
"asyncTestOnSubscribeFailure callback was called\n", 0);
544 for (i = 0; i < 3; i++)
549 =
"a much longer message that we can shorten to the extent that we need to payload up to 11";
577 "In asyncTestMessageArrived callback, %s total to exit %d, total received %d,%d,%d",
590 =
"a much longer message that we can shorten to the extent that we need to payload up to 11";
652 MyLog(
LOGA_DEBUG,
"In connect onFailure callback, context %p", context);
661 MyLog(
LOGA_DEBUG,
"In connect onSuccess callback, context %p\n", context);
663 assert(
"Connect should not succeed", 0,
"connect success callback was called", 0);
670 char* testname =
"test1";
682 MyLog(
LOGA_INFO,
"Starting SSL test 1 - connection to nonSSL MQTT server");
683 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
756 assert(
"There should be no failures in this test. ", 0,
"test2aOnConnectFailure callback was called\n", 0);
766 assert(
"There should be no failures in this test. ", 0,
"test2aOnPublishFailure callback was called\n", 0);
771 char* testname =
"test2a";
783 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
792 sprintf(tc.
clientid,
"%s", testname);
793 sprintf(tc.
topic,
"C client SSL test2a");
872 MyLog(
LOGA_DEBUG,
"In test2bOnConnectFailure callback, context %p", context);
874 assert(
"This test should call test2bOnConnectFailure. ", 1,
"test2bOnConnectFailure callback was called\n", 1);
880 MyLog(
LOGA_DEBUG,
"In test2bOnConnectFailure callback, context %p", context);
882 assert(
"This connect should not succeed. ", 0,
"test2bOnConnect callback was called\n", 0);
888 char* testname =
"test2b";
900 "Starting test 2b - connection to SSL MQTT server with clientauth=req but server does not have client cert");
901 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
967 MyLog(
LOGA_DEBUG,
"In test2cOnConnectFailure callback, context %p", context);
969 assert(
"This test should call test2cOnConnectFailure. ", 1,
"test2cOnConnectFailure callback was called\n", 0);
977 assert(
"This connect should not succeed. ", 0,
"test2cOnConnect callback was called\n", 0);
983 char* testname =
"test2c";
996 "Starting test 2c - connection to SSL MQTT server, server auth enabled but unknown cert");
997 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1024 opts.
ssl = &sslopts;
1066 MyLog(
LOGA_DEBUG,
"In test2dOnConnectFailure callback, context %p", context);
1068 assert(
"This test should call test2dOnConnectFailure. ", 1,
"test2dOnConnectFailure callback was called\n", 0);
1074 MyLog(
LOGA_DEBUG,
"In test2dOnConnect callback, context %p", context);
1076 assert(
"This connect should not succeed. ", 0,
"test2dOnConnect callback was called\n", 0);
1082 char* testname =
"test2d";
1091 unsigned int iteration = 0;
1096 "Starting test 2d - connection to SSL MQTT server, server auth enabled but unknown cert");
1097 fprintf(
xml,
"<testcase classname=\"test2d\" name=\"%s\"", testname);
1104 for (iteration = 0; !
failures && (iteration < 20) ; iteration++)
1133 opts.
ssl = &sslopts;
1148 #define TEST2D_COUNT 1000 1182 assert(
"There should be no failures in this test. ", 0,
"test2eOnConnectFailure callback was called\n", 0);
1192 assert(
"There should be no failures in this test. ", 0,
"test2eOnPublishFailure callback was called\n", 0);
1197 char* testname =
"test2e";
1209 MyLog(
LOGA_INFO,
"Starting test 2e - Mutual SSL authentication with serverURIs");
1210 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1219 sprintf(tc.
clientid,
"%s", testname);
1220 sprintf(tc.
topic,
"C client SSL test2e");
1243 opts.
ssl = &sslopts;
1300 MyLog(
LOGA_DEBUG,
"In test3aOnConnectFailure callback, context %p", context);
1302 assert(
"There should be no failures in this test. ", 0,
"test3aOnConnectFailure callback was called\n", 0);
1308 char* testname =
"test3a";
1323 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1329 sprintf(tc.
clientid,
"%s", testname);
1330 sprintf(tc.
topic,
"C client SSL test3a");
1351 opts.
ssl = &sslopts;
1379 for (i = 0; i < 3; i++)
1384 =
"a much longer message that we can shorten to the extent that we need to payload up to 11";
1425 MyLog(
LOGA_DEBUG,
"In test3bOnConnectFailure callback, context %p", context);
1427 assert(
"This test should call test3bOnConnectFailure. ", 1,
"test3bOnConnectFailure callback was called\n", 1);
1433 MyLog(
LOGA_DEBUG,
"In test3bOnConnectFailure callback, context %p", context);
1435 assert(
"This connect should not succeed. ", 0,
"test3bOnConnect callback was called\n", 0);
1441 char* testname =
"test3b";
1454 "Starting test 3b - connection to SSL MQTT server with clientauth=opt but client does not have server cert");
1455 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1479 opts.
ssl = &sslopts;
1515 MyLog(
LOGA_DEBUG,
"In test4OnConnectFailure callback, context %p", context);
1517 assert(
"There should be no failures in this test. ", 0,
"test4OnConnectFailure callback was called\n", 0);
1523 MyLog(
LOGA_DEBUG,
"In test4OnPublishFailure callback, context %p", context);
1525 assert(
"There should be no failures in this test. ", 0,
"test4OnPublishFailure callback was called\n", 0);
1530 char* testname =
"test4";
1544 MyLog(
LOGA_INFO,
"Starting test 4 - accept invalid server certificates");
1545 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1551 sprintf(tc.
clientid,
"%s", testname);
1552 sprintf(tc.
topic,
"C client SSL test4");
1573 opts.
ssl = &sslopts;
1625 MyLog(
LOGA_DEBUG,
"In test5aOnConnectFailure callback, context %p", context);
1627 assert(
"There should be no failures in this test. ", 0,
"test5aOnConnectFailure callback was called\n", 0);
1633 MyLog(
LOGA_DEBUG,
"In test5aOnPublishFailure callback, context %p", context);
1635 assert(
"There should be no failures in this test. ", 0,
"test5aOnPublishFailure callback was called\n", 0);
1640 char* testname =
"test5a";
1654 "Starting SSL test 5a - Anonymous ciphers - server authentication disabled");
1655 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1665 sprintf(tc.
clientid,
"%s", testname);
1666 sprintf(tc.
topic,
"C client SSL test5a");
1687 opts.
ssl = &sslopts;
1714 for (i = 0; i < 3; i++)
1719 =
"a much longer message that we can shorten to the extent that we need to payload up to 11";
1758 MyLog(
LOGA_DEBUG,
"In test5bOnConnectFailure callback, context %p", context);
1760 assert(
"There should be no failures in this test. ", 0,
"test5bOnConnectFailure callback was called\n", 0);
1766 MyLog(
LOGA_DEBUG,
"In test5bOnPublishFailure callback, context %p", context);
1768 assert(
"There should be no failures in this test. ", 0,
"test5bOnPublishFailure callback was called\n", 0);
1773 char* testname =
"test5b";
1787 "Starting SSL test 5b - Anonymous ciphers - server authentication enabled");
1788 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1798 sprintf(tc.
clientid,
"%s", testname);
1799 sprintf(tc.
topic,
"C client SSL test5b");
1820 opts.
ssl = &sslopts;
1847 for (i = 0; i < 3; i++)
1852 =
"a much longer message that we can shorten to the extent that we need to payload up to 11";
1892 MyLog(
LOGA_DEBUG,
"In test5cOnConnectFailure callback, context %p", context);
1894 assert(
"This test should call test5cOnConnectFailure. ", 1,
"test5cOnConnectFailure callback was called\n", 1);
1900 MyLog(
LOGA_DEBUG,
"In test5cOnConnectFailure callback, context %p", context);
1902 assert(
"This connect should not succeed. ", 0,
"test5cOnConnect callback was called\n", 0);
1908 char* testname =
"test5c";
1920 "Starting SSL test 5c - Anonymous ciphers - client not using anonymous cipher");
1921 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
1945 opts.
ssl = &sslopts;
1982 MyLog(
LOGA_DEBUG,
"In test6OnConnectFailure callback, context %p", context);
1984 assert(
"There should be no failures in this test. ", 0,
"test6OnConnectFailure callback was called\n", 0);
1990 MyLog(
LOGA_DEBUG,
"In test6OnPublishFailure callback, context %p", context);
1992 assert(
"There should be no failures in this test. ", 0,
"test6OnPublishFailure callback was called\n", 0);
1997 char* testname =
"test6";
1998 #define num_clients 10 2006 int test6finished = 0;
2009 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
2022 sprintf(tc[i].
clientid,
"sslasync_test6_num_%d", i);
2023 sprintf(tc[i].
topic,
"sslasync test6 topic num %d", i);
2047 opts.
ssl = &sslopts;
2061 while (test6finished < num_clients)
2073 if (tc[i].testFinished)
2107 assert(
"There should be no failures in this test. ", 0,
"test7OnConnectFailure callback was called\n", 0);
2119 response->
alt.
pub.message.qos);
2129 assert(
"There should be no failures in this test. ", 0,
"test7OnPublishFailure callback was called\n", 0);
2161 "message content was %c", ((
char*)message->
payload)[i]);
2166 if (++message_count == 1)
2226 ((
char*) pubmsg.
payload)[i] = rand() % 256;
2247 MyLog(
LOGA_DEBUG,
"In connect onSuccess callback, context %p", context);
2259 char* testname =
"test7";
2274 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
2290 sprintf(tc.
clientid,
"%s", testname);
2291 sprintf(tc.
topic,
"C client SSL test7");
2312 opts.
ssl = &sslopts;
2355 exit:
MyLog(
LOGA_INFO,
"%s: test %s. %d tests run, %d failures.",
2369 unsigned int max_identity_len,
2371 unsigned int max_psk_len,
2374 unsigned char test_psk[] = {0x50, 0x53, 0x4B, 0x00};
2377 assert(
"Good application context in onPSKAuth", context == (
void *) 42,
"context was %d\n", context);
2379 strncpy(identity,
"id", max_identity_len);
2380 memcpy(psk, test_psk,
sizeof(test_psk));
2381 return sizeof(test_psk);
2387 char* testname =
"test8";
2398 MyLog(
LOGA_INFO,
"Starting test 8 - TLS-PSK - client and server has a common pre-shared key");
2399 fprintf(
xml,
"<testcase classname=\"test8\" name=\"%s\"", testname);
2408 sprintf(tc.
clientid,
"%s", testname);
2409 sprintf(tc.
topic,
"C client SSL test8");
2423 opts.
ssl = &sslopts;
2478 assert(
"There should be no failures in this test. ", 0,
"test9OnConnectFailure callback was called\n", 0);
2484 char* testname =
"test9";
2495 MyLog(
LOGA_INFO,
"Starting test 9 - Mutual SSL authentication with CApath");
2496 fprintf(
xml,
"<testcase classname=\"test5\" name=\"%s\"", testname);
2505 sprintf(tc.
clientid,
"%s", testname);
2506 sprintf(tc.
topic,
"C client SSL test9");
2527 opts.
ssl = &sslopts;
2589 assert(
"This test should call test10OnConnectFailure. ", 1,
"test10OnConnectFailure callback was called\n", 1);
2595 MyLog(
LOGA_DEBUG,
"In test10OnConnect callback, context %p", context);
2597 assert(
"This connect should not succeed. ", 0,
"test10OnConnect callback was called\n", 0);
2603 char* testname =
"test10";
2616 fprintf(
xml,
"<testcase classname=\"test10\" name=\"%s\"", testname);
2626 sprintf(tc.
clientid,
"%s", testname);
2627 sprintf(tc.
topic,
"C client SSL test10");
2648 opts.
ssl = &sslopts;
2688 printf(
"%s\n", message);
2694 int* numtests = &
tests;
2700 xml = fopen(
"TEST-test5.xml",
"w");
2701 fprintf(
xml,
"<testsuite name=\"test5\" tests=\"%d\">\n", (
int)
ARRAY_SIZE(
tests) - 1);
2727 fprintf(
xml,
"</testsuite>\n");
void asyncTestOnSubscribeFailure(void *context, MQTTAsync_failureData *response)
MQTTAsync_onFailure * onFailure
char nocert_mutual_auth_connection[100]
void asyncTestOnUnsubscribe(void *context, MQTTAsync_successData *response)
enum MQTTPropertyCodes value
#define MQTTASYNC_NULL_PARAMETER
void asyncTestOnDisconnect(void *context, MQTTAsync_successData *response)
#define AsyncTestClient_initializer
FMT_INLINE std::basic_string< Char > format(const S &format_str, Args &&...args)
char * client_private_key_file
union MQTTAsync_successData::@46 alt
void test3aOnConnectFailure(void *context, MQTTAsync_failureData *response)
void write_test_result(void)
#define assert(a, b, c, d)
START_TIME_TYPE global_start_time
void test2eOnPublishFailure(void *context, MQTTAsync_failureData *response)
void test1OnConnect(void *context, MQTTAsync_successData *response)
#define MQTTAsync_responseOptions_initializer
void test5cOnConnect(void *context, MQTTAsync_successData *response)
int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions *options)
void test7OnConnect(void *context, MQTTAsync_successData *response)
void test2cOnConnect(void *context, MQTTAsync_successData *response)
int test2a(struct Options options)
int MQTTAsync_setCallbacks(MQTTAsync handle, void *context, MQTTAsync_connectionLost *cl, MQTTAsync_messageArrived *ma, MQTTAsync_deliveryComplete *dc)
int test1(struct Options options)
int test9(struct Options options)
void handleTrace(enum MQTTASYNC_TRACE_LEVELS level, char *message)
int test2d(struct Options options)
void test4OnPublishFailure(void *context, MQTTAsync_failureData *response)
void test2cOnConnectFailure(void *context, MQTTAsync_failureData *response)
size_t strftime(char *str, size_t count, const char *format, const std::tm *time)
void MQTTAsync_free(void *memory)
volatile int multiThread_arrivedcount
void MQTTAsync_freeMessage(MQTTAsync_message **message)
int MQTTAsync_unsubscribe(MQTTAsync handle, const char *topic, MQTTAsync_responseOptions *response)
void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback *callback)
int test6(struct Options options)
int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions *options)
void test2dOnConnect(void *context, MQTTAsync_successData *response)
int MQTTAsync_subscribe(MQTTAsync handle, const char *topic, int qos, MQTTAsync_responseOptions *response)
void test2bOnConnectFailure(void *context, MQTTAsync_failureData *response)
START_TIME_TYPE start_clock(void)
#define MQTTAsync_willOptions_initializer
void test1OnFailure(void *context, MQTTAsync_failureData *response)
int MQTTAsync_create(MQTTAsync *handle, const char *serverURI, const char *clientId, int persistence_type, void *persistence_context)
int test2c(struct Options options)
void test7OnSubscribe(void *context, MQTTAsync_successData *response)
int multiThread_messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *m)
void test6OnPublishFailure(void *context, MQTTAsync_failureData *response)
void test6OnConnectFailure(void *context, MQTTAsync_failureData *response)
#define MQTTAsync_disconnectOptions_initializer
MQTTAsync_onFailure * onFailure
char mutual_auth_connection[100]
void multiThread_deliveryComplete(void *context, MQTTAsync_token dt)
void test2bOnConnect(void *context, MQTTAsync_successData *response)
void asyncTestOnSend(void *context, MQTTAsync_successData *response)
int test10(struct Options options)
unsigned int(* ssl_psk_cb)(const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len, void *u)
void test3bOnConnect(void *context, MQTTAsync_successData *response)
void asyncTestOnConnect(void *context, MQTTAsync_successData *response)
void test2dOnConnectFailure(void *context, MQTTAsync_failureData *response)
void test9OnConnectFailure(void *context, MQTTAsync_failureData *response)
void test2eOnConnectFailure(void *context, MQTTAsync_failureData *response)
int main(int argc, char **argv)
MQTTAsync_message multiThread_pubmsg
MQTTAsync_SSLOptions * ssl
int test3b(struct Options options)
int test4(struct Options options)
#define MQTTAsync_connectOptions_initializer
MQTTAsync_onSuccess * onSuccess
void test7OnPublishFailure(void *context, MQTTAsync_failureData *response)
int test7(struct Options options)
int asyncTestMessageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *m)
MQTTAsync_willOptions * will
const char * privateKeyPassword
void asyncTestOnDeliveryComplete(void *context, MQTTAsync_token token)
void getopts(int argc, char **argv)
const char * enabledCipherSuites
#define MQTTCLIENT_PERSISTENCE_DEFAULT
int MQTTAsync_send(MQTTAsync handle, const char *destinationName, int payloadlen, const void *payload, int qos, int retained, MQTTAsync_responseOptions *response)
void test2aOnConnectFailure(void *context, MQTTAsync_failureData *response)
void asyncTestOnSubscribe(void *context, MQTTAsync_successData *response)
char server_auth_connection[100]
int test7MessageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
void MQTTAsync_destroy(MQTTAsync *handle)
void test5bOnConnectFailure(void *context, MQTTAsync_failureData *response)
void test4OnConnectFailure(void *context, MQTTAsync_failureData *response)
int test5b(struct Options options)
#define MQTTASYNC_SUCCESS
void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level)
int MQTTAsync_sendMessage(MQTTAsync handle, const char *destinationName, const MQTTAsync_message *message, MQTTAsync_responseOptions *response)
long elapsed(START_TIME_TYPE start_time)
int test7OnPublishSuccessCount
int test3a(struct Options options)
void test7OnConnectFailure(void *context, MQTTAsync_failureData *response)
struct MQTTAsync_successData::@46::@47 pub
void test2aOnPublishFailure(void *context, MQTTAsync_failureData *response)
#define MQTTCLIENT_PERSISTENCE_NONE
void test10OnConnectFailure(void *context, MQTTAsync_failureData *response)
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 test10OnConnect(void *context, MQTTAsync_successData *response)
void test5bOnPublishFailure(void *context, MQTTAsync_failureData *response)
#define MQTTASYNC_BAD_PROTOCOL
void test5aOnConnectFailure(void *context, MQTTAsync_failureData *response)
#define MQTTAsync_SSLOptions_initializer
void MyLog(int LOGA_level, char *format,...)
void test5aOnPublishFailure(void *context, MQTTAsync_failureData *response)
#define MQTTAsync_message_initializer
void myassert(char *filename, int lineno, char *description, int value, char *format,...)
MQTTAsync_onSuccess * onSuccess
void test7OnPublishSuccess(void *context, MQTTAsync_successData *response)
void test7OnUnsubscribe(void *context, MQTTAsync_successData *response)
int test2b(struct Options options)
void test5cOnConnectFailure(void *context, MQTTAsync_failureData *response)
void sendAndReceive(MQTTAsync *c, int qos, char *test_topic)
char anon_connection[100]
int multiThread_deliveryCompleted
int test5a(struct Options options)
int test2e(struct Options options)
MQTTAsync_onSuccess * onSuccess
int test8(struct Options options)
int test5c(struct Options options)
void test3bOnConnectFailure(void *context, MQTTAsync_failureData *response)