diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-24 15:55:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-24 15:55:27 -0400 |
commit | 011d94fb11c0ccd8d009acba04304588f6d3694b (patch) | |
tree | 5d456af8e977db5a495bd887cc548ab5eb0e0ffb /src/test/test_address.c | |
parent | 047790a25343e3857fb95e8874755440da30a982 (diff) | |
download | tor-011d94fb11c0ccd8d009acba04304588f6d3694b.tar.gz tor-011d94fb11c0ccd8d009acba04304588f6d3694b.zip |
apply ahf's test_assert_null.cocci
Diffstat (limited to 'src/test/test_address.c')
-rw-r--r-- | src/test/test_address.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c index a2a89c9a1d..8e1fd73033 100644 --- a/src/test/test_address.c +++ b/src/test/test_address.c @@ -745,7 +745,7 @@ test_address_get_if_addrs_list_internal(void *arg) results = get_interface_address_list(LOG_ERR, 1); - tt_assert(results != NULL); + tt_ptr_op(results, OP_NE, NULL); /* When the network is down, a system might not have any non-local * non-multicast addresseses, not even internal ones. * Unit tests shouldn't fail because of this. */ @@ -776,7 +776,7 @@ test_address_get_if_addrs_list_no_internal(void *arg) results = get_interface_address_list(LOG_ERR, 0); - tt_assert(results != NULL); + tt_ptr_op(results, OP_NE, NULL); /* Work even on systems with only internal IPv4 addresses */ tt_int_op(smartlist_len(results),OP_GE,0); @@ -818,7 +818,7 @@ test_address_get_if_addrs6_list_internal(void *arg) } teardown_capture_of_logs(); - tt_assert(results != NULL); + tt_ptr_op(results, OP_NE, NULL); /* Work even on systems without IPv6 interfaces */ tt_int_op(smartlist_len(results),OP_GE,0); @@ -861,7 +861,7 @@ test_address_get_if_addrs6_list_no_internal(void *arg) } teardown_capture_of_logs(); - tt_assert(results != NULL); + tt_ptr_op(results, OP_NE, NULL); /* Work even on systems without IPv6 interfaces */ tt_int_op(smartlist_len(results),OP_GE,0); @@ -927,11 +927,11 @@ test_address_get_if_addrs_internal_fail(void *arg) mock_get_interface_address6_via_udp_socket_hack_fail); results1 = get_interface_address6_list(LOG_ERR, AF_INET6, 1); - tt_assert(results1 != NULL); + tt_ptr_op(results1, OP_NE, NULL); tt_int_op(smartlist_len(results1),OP_EQ,0); results2 = get_interface_address_list(LOG_ERR, 1); - tt_assert(results2 != NULL); + tt_ptr_op(results2, OP_NE, NULL); tt_int_op(smartlist_len(results2),OP_EQ,0); rv = get_interface_address6(LOG_ERR, AF_INET6, &ipv6_addr); @@ -961,11 +961,11 @@ test_address_get_if_addrs_no_internal_fail(void *arg) mock_get_interface_address6_via_udp_socket_hack_fail); results1 = get_interface_address6_list(LOG_ERR, AF_INET6, 0); - tt_assert(results1 != NULL); + tt_ptr_op(results1, OP_NE, NULL); tt_int_op(smartlist_len(results1),OP_EQ,0); results2 = get_interface_address_list(LOG_ERR, 0); - tt_assert(results2 != NULL); + tt_ptr_op(results2, OP_NE, NULL); tt_int_op(smartlist_len(results2),OP_EQ,0); done: |