diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-02 13:56:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-02 13:56:54 -0400 |
commit | 44f0dfa53bd0eea816fd2785088b4295a91112e4 (patch) | |
tree | be03583c2ae6e30f1e7e9e25f6dbcd2731e60c38 /src/test/test_routerset.c | |
parent | 32b88d2565daa47c087fb5610405fcb57c3ed153 (diff) | |
download | tor-44f0dfa53bd0eea816fd2785088b4295a91112e4.tar.gz tor-44f0dfa53bd0eea816fd2785088b4295a91112e4.zip |
Use real pointers in unit tests, not (void*)101 etc
The clangalyzer hates (void*)101 etc
Diffstat (limited to 'src/test/test_routerset.c')
-rw-r--r-- | src/test/test_routerset.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c index 9e5b51ee13..0ef2c538b9 100644 --- a/src/test/test_routerset.c +++ b/src/test/test_routerset.c @@ -845,7 +845,8 @@ NS(test_main)(void *arg) NS_DECL(addr_policy_result_t, compare_tor_addr_to_addr_policy, (const tor_addr_t *addr, uint16_t port, const smartlist_t *policy)); -#define MOCK_TOR_ADDR_PTR (tor_addr_t *)0xdeafbead +static tor_addr_t MOCK_TOR_ADDR; +#define MOCK_TOR_ADDR_PTR (&MOCK_TOR_ADDR) static void NS(test_main)(void *arg) @@ -892,8 +893,6 @@ NS(compare_tor_addr_to_addr_policy)(const tor_addr_t *addr, uint16_t port, NS_DECL(addr_policy_result_t, compare_tor_addr_to_addr_policy, (const tor_addr_t *addr, uint16_t port, const smartlist_t *policy)); -#define MOCK_TOR_ADDR_PTR (tor_addr_t *)0xdeafbead - static void NS(test_main)(void *arg) { @@ -940,8 +939,6 @@ NS(compare_tor_addr_to_addr_policy)(const tor_addr_t *addr, uint16_t port, NS_DECL(addr_policy_result_t, compare_tor_addr_to_addr_policy, (const tor_addr_t *addr, uint16_t port, const smartlist_t *policy)); -#define MOCK_TOR_ADDR_PTR (tor_addr_t *)0xdeafbead - static void NS(test_main)(void *arg) { @@ -987,8 +984,6 @@ NS_DECL(addr_policy_result_t, compare_tor_addr_to_addr_policy, (const tor_addr_t *addr, uint16_t port, const smartlist_t *policy)); NS_DECL(int, geoip_get_country_by_addr, (const tor_addr_t *addr)); -#define MOCK_TOR_ADDR_PTR (tor_addr_t *)0xdeafbead - static void NS(test_main)(void *arg) { @@ -1047,8 +1042,6 @@ NS_DECL(addr_policy_result_t, compare_tor_addr_to_addr_policy, (const tor_addr_t *addr, uint16_t port, const smartlist_t *policy)); NS_DECL(int, geoip_get_country_by_addr, (const tor_addr_t *addr)); -#define MOCK_TOR_ADDR_PTR (tor_addr_t *)0xdeafbead - static void NS(test_main)(void *arg) { |