summaryrefslogtreecommitdiff
path: root/auto_tests/network_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/network_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/network_test.c')
-rw-r--r--auto_tests/network_test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/auto_tests/network_test.c b/auto_tests/network_test.c
index 106f5f6a..9e3e0e15 100644
--- a/auto_tests/network_test.c
+++ b/auto_tests/network_test.c
@@ -36,7 +36,7 @@ START_TEST(test_addr_resolv_localhost)
36 IP ip; 36 IP ip;
37 ip_init(&ip, 0); // ipv6enabled = 0 37 ip_init(&ip, 0); // ipv6enabled = 0
38 38
39 int res = addr_resolve(localhost, &ip, NULL); 39 int res = addr_resolve(localhost, &ip, nullptr);
40 40
41 ck_assert_msg(res > 0, "Resolver failed: %u, %s (%x, %x)", errno, strerror(errno)); 41 ck_assert_msg(res > 0, "Resolver failed: %u, %s (%x, %x)", errno, strerror(errno));
42 42
@@ -47,10 +47,10 @@ START_TEST(test_addr_resolv_localhost)
47 ip_ntoa(&ip, ip_str, sizeof(ip_str))); 47 ip_ntoa(&ip, ip_str, sizeof(ip_str)));
48 48
49 ip_init(&ip, 1); // ipv6enabled = 1 49 ip_init(&ip, 1); // ipv6enabled = 1
50 res = addr_resolve(localhost, &ip, NULL); 50 res = addr_resolve(localhost, &ip, nullptr);
51 51
52 if (!(res & TOX_ADDR_RESOLVE_INET6)) { 52 if (!(res & TOX_ADDR_RESOLVE_INET6)) {
53 res = addr_resolve("ip6-localhost", &ip, NULL); 53 res = addr_resolve("ip6-localhost", &ip, nullptr);
54 localhost_split = 1; 54 localhost_split = 1;
55 } 55 }
56 56
@@ -96,13 +96,13 @@ START_TEST(test_ip_equal)
96 ip_reset(&ip1); 96 ip_reset(&ip1);
97 ip_reset(&ip2); 97 ip_reset(&ip2);
98 98
99 res = ip_equal(NULL, NULL); 99 res = ip_equal(nullptr, nullptr);
100 ck_assert_msg(res == 0, "ip_equal(NULL, NULL): expected result 0, got %u.", res); 100 ck_assert_msg(res == 0, "ip_equal(NULL, NULL): expected result 0, got %u.", res);
101 101
102 res = ip_equal(&ip1, NULL); 102 res = ip_equal(&ip1, nullptr);
103 ck_assert_msg(res == 0, "ip_equal(PTR, NULL): expected result 0, got %u.", res); 103 ck_assert_msg(res == 0, "ip_equal(PTR, NULL): expected result 0, got %u.", res);
104 104
105 res = ip_equal(NULL, &ip1); 105 res = ip_equal(nullptr, &ip1);
106 ck_assert_msg(res == 0, "ip_equal(NULL, PTR): expected result 0, got %u.", res); 106 ck_assert_msg(res == 0, "ip_equal(NULL, PTR): expected result 0, got %u.", res);
107 107
108 ip1.family = TOX_AF_INET; 108 ip1.family = TOX_AF_INET;
@@ -165,7 +165,7 @@ static Suite *network_suite(void)
165 165
166int main(void) 166int main(void)
167{ 167{
168 srand((unsigned int) time(NULL)); 168 srand((unsigned int) time(nullptr));
169 169
170 Suite *network = network_suite(); 170 Suite *network = network_suite();
171 SRunner *test_runner = srunner_create(network); 171 SRunner *test_runner = srunner_create(network);