diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-22 14:47:48 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-24 14:06:05 -0400 |
commit | 3cc0a145bd2befbc22e86d4fa609d5b00f6039f6 (patch) | |
tree | ef6a799526ecbaf3f51553aca59f08466d6ae97a | |
parent | 92ae9bb95b6275dfeb28f9aee424c1147365ed4d (diff) | |
download | tor-3cc0a145bd2befbc22e86d4fa609d5b00f6039f6.tar.gz tor-3cc0a145bd2befbc22e86d4fa609d5b00f6039f6.zip |
Fix test_geoip failures on windows by writing file in binary mode.
Fixes bug 26480; bug appeared when we re-enabled the geoip tests on
windows. Bug originally introduced by our fix to 25787; bug not in
any released Tor.
-rw-r--r-- | src/test/test_geoip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c index 88fed43d83..6f849f436b 100644 --- a/src/test/test_geoip.c +++ b/src/test/test_geoip.c @@ -415,7 +415,7 @@ test_geoip_load_file(void *arg) geoip_db_digest(AF_INET)); const char *fname = get_fname("geoip"); - tt_int_op(0, OP_EQ, write_str_to_file(fname, GEOIP_CONTENT, 0)); + tt_int_op(0, OP_EQ, write_str_to_file(fname, GEOIP_CONTENT, 1)); int rv = geoip_load_file(AF_INET, fname); if (rv != 0) { @@ -491,7 +491,7 @@ test_geoip6_load_file(void *arg) "2001:4878:12a::,2001:4878:203:ffff:ffff:ffff:ffff:ffff,US\n" "2001:4878:204::,2001:4878:204:ffff:ffff:ffff:ffff:ffff,DE\n" "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, 0)); + 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)); @@ -541,8 +541,8 @@ test_geoip_load_2nd_file(void *arg) char *fname_geoip = tor_strdup(get_fname("geoip_data")); char *fname_empty = tor_strdup(get_fname("geoip_empty")); - tt_int_op(0, OP_EQ, write_str_to_file(fname_geoip, GEOIP_CONTENT, 0)); - tt_int_op(0, OP_EQ, write_str_to_file(fname_empty, "\n", 0)); + tt_int_op(0, OP_EQ, write_str_to_file(fname_geoip, GEOIP_CONTENT, 1)); + 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)); |