[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix test_geoip failures on windows by writing file in binary mode.



commit 3cc0a145bd2befbc22e86d4fa609d5b00f6039f6
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Jun 22 14:47:48 2018 -0400

    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.
---
 src/test/test_geoip.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test/test_geoip.c b/src/test/test_geoip.c
index 88fed43d8..6f849f436 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));



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits