summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authornils <nils@shkoo.com>2012-02-29 16:42:59 -0800
committerLinus Nordberg <linus@torproject.org>2012-10-17 10:54:17 +0200
commit167363403b54accb2442fe10a8c588532ab4c26f (patch)
tree701b88e55cacb8b2e75fcbf6b66d5d46a1d7a6ee /src/test
parent4da2864308efd3de7a3dcc857003fa4aea169be6 (diff)
downloadtor-167363403b54accb2442fe10a8c588532ab4c26f.tar.gz
tor-167363403b54accb2442fe10a8c588532ab4c26f.zip
Rename address family specific IPv4 geoip functions in preparation for IPv6 support
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 81172795f2..4774fec087 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1459,19 +1459,19 @@ test_geoip(void)
/* Populate the DB a bit. Add these in order, since we can't do the final
* 'sort' step. These aren't very good IP addresses, but they're perfectly
* fine uint32_t values. */
- test_eq(0, geoip_parse_entry("10,50,AB"));
- test_eq(0, geoip_parse_entry("52,90,XY"));
- test_eq(0, geoip_parse_entry("95,100,AB"));
- test_eq(0, geoip_parse_entry("\"105\",\"140\",\"ZZ\""));
- test_eq(0, geoip_parse_entry("\"150\",\"190\",\"XY\""));
- test_eq(0, geoip_parse_entry("\"200\",\"250\",\"AB\""));
+ test_eq(0, geoip_ipv4_parse_entry("10,50,AB"));
+ test_eq(0, geoip_ipv4_parse_entry("52,90,XY"));
+ test_eq(0, geoip_ipv4_parse_entry("95,100,AB"));
+ test_eq(0, geoip_ipv4_parse_entry("\"105\",\"140\",\"ZZ\""));
+ test_eq(0, geoip_ipv4_parse_entry("\"150\",\"190\",\"XY\""));
+ test_eq(0, geoip_ipv4_parse_entry("\"200\",\"250\",\"AB\""));
/* We should have 4 countries: ??, ab, xy, zz. */
test_eq(4, geoip_get_n_countries());
/* Make sure that country ID actually works. */
-#define NAMEFOR(x) geoip_get_country_name(geoip_get_country_by_ip(x))
+#define NAMEFOR(x) geoip_get_country_name(geoip_get_country_by_ipv4(x))
test_streq("??", NAMEFOR(3));
- test_eq(0, geoip_get_country_by_ip(3));
+ test_eq(0, geoip_get_country_by_ipv4(3));
test_streq("ab", NAMEFOR(32));
test_streq("??", NAMEFOR(5));
test_streq("??", NAMEFOR(51));