aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-07-31 15:20:28 -0400
committerNick Mathewson <nickm@torproject.org>2010-07-31 15:21:08 -0400
commit49b0eb7a329224e53c3e24192a59e7c89d7e4ea4 (patch)
tree9f5a5669a60bc58cf7f44fe3de4e58f48504bac6 /src/test
parentb175c584d579da9eeb92dc619451820f89d1979d (diff)
downloadtor-49b0eb7a329224e53c3e24192a59e7c89d7e4ea4.tar
tor-49b0eb7a329224e53c3e24192a59e7c89d7e4ea4.tar.gz
Fix up geoip unit tests to know about ??
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 755d1233f..0830f5794 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1108,10 +1108,12 @@ test_geoip(void)
test_eq(0, geoip_parse_entry("\"150\",\"190\",\"XY\""));
test_eq(0, geoip_parse_entry("\"200\",\"250\",\"AB\""));
- /* We should have 3 countries: ab, xy, zz. */
- test_eq(3, geoip_get_n_countries());
+ /* 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))
+ test_streq("??", NAMEFOR(3));
+ test_eq(0, geoip_get_country_by_ip(3));
test_streq("ab", NAMEFOR(32));
test_streq("??", NAMEFOR(5));
test_streq("??", NAMEFOR(51));