summaryrefslogtreecommitdiff
path: root/auto_tests/network_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-12 17:22:20 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-12 20:21:42 +0000
commitbeeb9b4335d9ca6f947a52528453753a51f194f3 (patch)
tree242cad42e2e90ebf5ed04283fd79f42f4e3afa60 /auto_tests/network_test.c
parentcbda01021c561bd061cb03a1c1bab58199ac2307 (diff)
Style fixes in TCP code; remove MIN and PAIR from util.h.
* Moved PAIR to toxav, where it's used (but really this should die). * Replace most MIN calls with typed `min_*` calls. Didn't replace the ones where the desired semantics are unclear. Moved the MIN macro to the one place where it's still used. * Avoid assignments in `while` loops. Instead, factored out the loop body into a separate `bool`-returning function. * Use named types for callbacks (`_cb` types). * Avoid assignments in `if` conditions. * Removed `MAKE_REALLOC` and expanded its two calls. We can't have templates in C, and this fake templating is ugly and hard to analyse and debug (it expands on a single line). * Moved epoll system include to the .c file, out of the .h file. * Avoid assignments in expressions (`a = b = c;`). * Avoid multiple declarators per struct member declaration. * Fix naming inconsistencies. * Replace `net_to_host` macro with function.
Diffstat (limited to 'auto_tests/network_test.c')
-rw-r--r--auto_tests/network_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/auto_tests/network_test.c b/auto_tests/network_test.c
index f9de94f9..dc67e0c0 100644
--- a/auto_tests/network_test.c
+++ b/auto_tests/network_test.c
@@ -144,8 +144,8 @@ START_TEST(test_ip_equal)
144 ip2.ip.v6.uint32[2] = net_htonl(0xFFFF); 144 ip2.ip.v6.uint32[2] = net_htonl(0xFFFF);
145 ip2.ip.v6.uint32[3] = net_htonl(0x7F000001); 145 ip2.ip.v6.uint32[3] = net_htonl(0x7F000001);
146 146
147 ck_assert_msg(IPV6_IPV4_IN_V6(ip2.ip.v6) != 0, 147 ck_assert_msg(ipv6_ipv4_in_v6(ip2.ip.v6) != 0,
148 "IPV6_IPV4_IN_V6(::ffff:127.0.0.1): expected != 0, got 0."); 148 "ipv6_ipv4_in_v6(::ffff:127.0.0.1): expected != 0, got 0.");
149 149
150 res = ip_equal(&ip1, &ip2); 150 res = ip_equal(&ip1, &ip2);
151 ck_assert_msg(res != 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_INET6, ::ffff:127.0.0.1} ): " 151 ck_assert_msg(res != 0, "ip_equal( {TOX_AF_INET, 127.0.0.1}, {TOX_AF_INET6, ::ffff:127.0.0.1} ): "