aboutsummaryrefslogtreecommitdiff
path: root/src/test/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test.c')
-rw-r--r--src/test/test.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/test/test.c b/src/test/test.c
index f34a22cad..0c5e84ddb 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1485,13 +1485,15 @@ test_geoip(void)
/* Make sure that country ID actually works. */
#define SET_TEST_IPV6(i) in6.s6_addr32[3] = htonl((uint32_t) i)
-#define CHECK_COUNTRY(country, val) do { \
- /* test ipv4 country lookup */ \
- test_streq(country, geoip_get_country_name(geoip_get_country_by_ipv4(val))); \
- /* test ipv6 country lookup */ \
- SET_TEST_IPV6(val); \
- test_streq(country, geoip_get_country_name(geoip_get_country_by_ipv6(&in6))); \
- } while(0)
+#define CHECK_COUNTRY(country, val) do { \
+ /* test ipv4 country lookup */ \
+ test_streq(country, \
+ geoip_get_country_name(geoip_get_country_by_ipv4(val))); \
+ /* test ipv6 country lookup */ \
+ SET_TEST_IPV6(val); \
+ test_streq(country, \
+ geoip_get_country_name(geoip_get_country_by_ipv6(&in6))); \
+ } while (0)
CHECK_COUNTRY("??", 3);
CHECK_COUNTRY("ab", 32);
@@ -1511,14 +1513,14 @@ test_geoip(void)
* using ipv4. Since our fake geoip database is the same between
* ipv4 and ipv6, we should get the same result no matter which
* address family we pick for each IP. */
-#define SET_TEST_ADDRESS(i) do { \
- if ((i) & 1) { \
- SET_TEST_IPV6(i); \
- tor_addr_from_in6(&addr, &in6); \
- } else { \
+#define SET_TEST_ADDRESS(i) do { \
+ if ((i) & 1) { \
+ SET_TEST_IPV6(i); \
+ tor_addr_from_in6(&addr, &in6); \
+ } else { \
tor_addr_from_ipv4h(&addr, (uint32_t) i); \
- } \
- } while(0)
+ } \
+ } while (0)
get_options_mutable()->BridgeRelay = 1;
get_options_mutable()->BridgeRecordUsageByCountry = 1;