summaryrefslogtreecommitdiff
path: root/auto_tests/messenger_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-01-28 21:30:39 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-01-30 23:35:50 +0000
commit92ffad1a72bc8c422426d52ac408bd71242dd047 (patch)
treef592f353068dd2043525dd2cc04d6124a4ed4bc4 /auto_tests/messenger_test.c
parent623e9ac331df7323660e21c8a2226523a5ee713b (diff)
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
Diffstat (limited to 'auto_tests/messenger_test.c')
-rw-r--r--auto_tests/messenger_test.c22
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
45static const char *bad_id_str = "9B569D14ff637e69f2"; 45static const char *bad_id_str = "9B569D14ff637e69f2";
46 46
47static unsigned char *friend_id = NULL; 47static unsigned char *friend_id = nullptr;
48static unsigned char *good_id_a = NULL; 48static unsigned char *good_id_a = nullptr;
49static unsigned char *good_id_b = NULL; 49static unsigned char *good_id_b = nullptr;
50static unsigned char *bad_id = NULL; 50static unsigned char *bad_id = nullptr;
51 51
52static int friend_id_num = 0; 52static 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}
68END_TEST 72END_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) {