aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_geoip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-27 10:15:39 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-27 10:15:39 -0400
commitfa32574bdb7381f02abc68ad917ad79f354938a4 (patch)
tree77ef274275246db9506f713094eea61927ecf5bf /src/test/test_geoip.c
parentf403af22076b0092807822ddc9890acdbd62f578 (diff)
downloadtor-fa32574bdb7381f02abc68ad917ad79f354938a4.tar.gz
tor-fa32574bdb7381f02abc68ad917ad79f354938a4.zip
Remove excess dependencies from geoip.c
Diffstat (limited to 'src/test/test_geoip.c')
-rw-r--r--src/test/test_geoip.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c
index 8f13939dbd..5e2849147b 100644
--- a/src/test/test_geoip.c
+++ b/src/test/test_geoip.c
@@ -404,7 +404,8 @@ test_geoip_load_file(void *arg)
/* A nonexistant filename should fail. */
tt_int_op(-1, OP_EQ,
- geoip_load_file(AF_INET, "/you/did/not/put/a/file/here/I/hope"));
+ geoip_load_file(AF_INET, "/you/did/not/put/a/file/here/I/hope",
+ LOG_INFO));
/* We start out with only "Ningunpartia" in the database. */
tt_int_op(1, OP_EQ, geoip_get_n_countries());
@@ -418,7 +419,7 @@ test_geoip_load_file(void *arg)
const char *fname = get_fname("geoip");
tt_int_op(0, OP_EQ, write_str_to_file(fname, GEOIP_CONTENT, 1));
- int rv = geoip_load_file(AF_INET, fname);
+ int rv = geoip_load_file(AF_INET, fname, LOG_WARN);
if (rv != 0) {
TT_GRIPE(("Unable to load geoip from %s", escaped(fname)));
}
@@ -468,7 +469,8 @@ test_geoip6_load_file(void *arg)
/* A nonexistant filename should fail. */
tt_int_op(-1, OP_EQ,
- geoip_load_file(AF_INET6, "/you/did/not/put/a/file/here/I/hope"));
+ geoip_load_file(AF_INET6, "/you/did/not/put/a/file/here/I/hope",
+ LOG_INFO));
/* Any lookup attempt should say "-1" because we have no info */
tor_inet_pton(AF_INET6, "2001:4860:4860::8888", &iaddr6);
@@ -494,7 +496,7 @@ test_geoip6_load_file(void *arg)
"2001:4878:205::,2001:4878:214:ffff:ffff:ffff:ffff:ffff,US\n";
tt_int_op(0, OP_EQ, write_str_to_file(fname6, CONTENT, 1));
- tt_int_op(0, OP_EQ, geoip_load_file(AF_INET6, fname6));
+ tt_int_op(0, OP_EQ, geoip_load_file(AF_INET6, fname6, LOG_WARN));
/* Check that we loaded some countries; this will fail if there are ever
* fewer than 5 countries in our test data above. */
@@ -546,11 +548,11 @@ test_geoip_load_2nd_file(void *arg)
tt_int_op(0, OP_EQ, write_str_to_file(fname_empty, "\n", 1));
/* Load 1st geoip file */
- tt_int_op(0, OP_EQ, geoip_load_file(AF_INET, fname_geoip));
+ tt_int_op(0, OP_EQ, geoip_load_file(AF_INET, fname_geoip, LOG_WARN));
/* Load 2nd geoip (empty) file */
/* It has to be the same IP address family */
- tt_int_op(0, OP_EQ, geoip_load_file(AF_INET, fname_empty));
+ tt_int_op(0, OP_EQ, geoip_load_file(AF_INET, fname_empty, LOG_WARN));
/* Check that there is no geoip information for 8.8.8.8, */
/* since loading the empty 2nd file should have delete it. */