diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-08-26 18:30:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-08-26 20:03:16 -0400 |
commit | 8af92b6577595181eddc1dea25cf44d20bedb8a0 (patch) | |
tree | 703cff310f3e2502ca9b972a740d81d5dfd60558 /src/test/test_address.c | |
parent | 5eca338107a4d578e1cd0204e21fd7556c0aa926 (diff) | |
download | tor-8af92b6577595181eddc1dea25cf44d20bedb8a0.tar.gz tor-8af92b6577595181eddc1dea25cf44d20bedb8a0.zip |
test_address: parenthesize macro arguments.
It's good style to always add parentheses when using macro
arguments, in case somebody someday provides an argument that
contains an operator you don't expect, or causes the expression to
parse differently.
Diffstat (limited to 'src/test/test_address.c')
-rw-r--r-- | src/test/test_address.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c index 164cc3150d..ef6daa06b4 100644 --- a/src/test/test_address.c +++ b/src/test/test_address.c @@ -1248,10 +1248,10 @@ test_address_tor_node_in_same_network_family(void *ignored) #define CHECK_RI_ADDR(addr_str, rv) STMT_BEGIN \ ri = tor_malloc_zero(sizeof(routerinfo_t)); \ tor_addr_t addr; \ - tor_addr_parse(&addr, addr_str); \ + tor_addr_parse(&addr, (addr_str)); \ ri->addr = tor_addr_to_ipv4h(&addr); \ tor_addr_make_null(&ri->ipv6_addr, AF_INET6); \ - tt_int_op(dirserv_router_has_valid_address(ri), OP_EQ, rv); \ + tt_int_op(dirserv_router_has_valid_address(ri), OP_EQ, (rv)); \ tor_free(ri); \ STMT_END @@ -1260,8 +1260,8 @@ test_address_tor_node_in_same_network_family(void *ignored) #define CHECK_RI_ADDR6(addr_str, rv) STMT_BEGIN \ ri = tor_malloc_zero(sizeof(routerinfo_t)); \ ri->addr = 16777217; /* 1.0.0.1 */ \ - tor_addr_parse(&ri->ipv6_addr, addr_str); \ - tt_int_op(dirserv_router_has_valid_address(ri), OP_EQ, rv); \ + tor_addr_parse(&ri->ipv6_addr, (addr_str)); \ + tt_int_op(dirserv_router_has_valid_address(ri), OP_EQ, (rv)); \ tor_free(ri); \ STMT_END |