diff options
Diffstat (limited to 'auto_tests/messenger_test.c')
-rw-r--r-- | auto_tests/messenger_test.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/auto_tests/messenger_test.c b/auto_tests/messenger_test.c index 8ab185a0..34de6543 100644 --- a/auto_tests/messenger_test.c +++ b/auto_tests/messenger_test.c | |||
@@ -44,10 +44,10 @@ static const char *good_id_b_str = "d3f14b6d384d8f5f2a66cff637e69f28f539c5de61bc | |||
44 | 44 | ||
45 | static const char *bad_id_str = "9B569D14ff637e69f2"; | 45 | static const char *bad_id_str = "9B569D14ff637e69f2"; |
46 | 46 | ||
47 | static unsigned char *friend_id = NULL; | 47 | static unsigned char *friend_id = nullptr; |
48 | static unsigned char *good_id_a = NULL; | 48 | static unsigned char *good_id_a = nullptr; |
49 | static unsigned char *good_id_b = NULL; | 49 | static unsigned char *good_id_b = nullptr; |
50 | static unsigned char *bad_id = NULL; | 50 | static unsigned char *bad_id = nullptr; |
51 | 51 | ||
52 | static int friend_id_num = 0; | 52 | static int friend_id_num = 0; |
53 | 53 | ||
@@ -60,10 +60,14 @@ START_TEST(test_m_sendmesage) | |||
60 | int bad_len = MAX_CRYPTO_PACKET_SIZE; | 60 | int bad_len = MAX_CRYPTO_PACKET_SIZE; |
61 | 61 | ||
62 | 62 | ||
63 | ck_assert(m_send_message_generic(m, -1, MESSAGE_NORMAL, (const uint8_t *)message, good_len, 0) == -1); | 63 | ck_assert(m_send_message_generic( |
64 | ck_assert(m_send_message_generic(m, REALLY_BIG_NUMBER, MESSAGE_NORMAL, (const uint8_t *)message, good_len, 0) == -1); | 64 | m, -1, MESSAGE_NORMAL, (const uint8_t *)message, good_len, nullptr) == -1); |
65 | ck_assert(m_send_message_generic(m, 17, MESSAGE_NORMAL, (const uint8_t *)message, good_len, 0) == -1); | 65 | ck_assert(m_send_message_generic( |
66 | ck_assert(m_send_message_generic(m, friend_id_num, MESSAGE_NORMAL, (const uint8_t *)message, bad_len, 0) == -2); | 66 | m, REALLY_BIG_NUMBER, MESSAGE_NORMAL, (const uint8_t *)message, good_len, nullptr) == -1); |
67 | ck_assert(m_send_message_generic( | ||
68 | m, 17, MESSAGE_NORMAL, (const uint8_t *)message, good_len, nullptr) == -1); | ||
69 | ck_assert(m_send_message_generic( | ||
70 | m, friend_id_num, MESSAGE_NORMAL, (const uint8_t *)message, bad_len, nullptr) == -2); | ||
67 | } | 71 | } |
68 | END_TEST | 72 | END_TEST |
69 | 73 | ||
@@ -355,7 +359,7 @@ int main(int argc, char *argv[]) | |||
355 | Messenger_Options options = {0}; | 359 | Messenger_Options options = {0}; |
356 | options.ipv6enabled = TOX_ENABLE_IPV6_DEFAULT; | 360 | options.ipv6enabled = TOX_ENABLE_IPV6_DEFAULT; |
357 | options.log_callback = (logger_cb *)print_debug_log; | 361 | options.log_callback = (logger_cb *)print_debug_log; |
358 | m = new_messenger(&options, 0); | 362 | m = new_messenger(&options, nullptr); |
359 | 363 | ||
360 | /* setup a default friend and friendnum */ | 364 | /* setup a default friend and friendnum */ |
361 | if (m_addfriend_norequest(m, (uint8_t *)friend_id) < 0) { | 365 | if (m_addfriend_norequest(m, (uint8_t *)friend_id) < 0) { |