]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix up geoip unit tests to know about ??
authorNick Mathewson <nickm@torproject.org>
Sat, 31 Jul 2010 19:20:28 +0000 (15:20 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 31 Jul 2010 19:21:08 +0000 (15:21 -0400)
src/test/test.c

index 755d1233f68157add52bcf391e4e072d1cb04c6f..0830f579463c99dbc59f81193077d2fd92a65948 100644 (file)
@@ -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));