]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix gmtime unit test on openbsd
authorNick Mathewson <nickm@torproject.org>
Sun, 11 Sep 2016 21:43:20 +0000 (17:43 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 11 Sep 2016 21:43:20 +0000 (17:43 -0400)
openbsd helpfully handles gmtime() of INT64_MIN.  Good job!

Our tests didn't handle that so well.

src/test/test_util.c

index cb523cf350f0e3f48b03f48dbf585401cd274625..7d02fed85374e389a3015be91e5a3e4c2b8c99bf 100644 (file)
@@ -881,7 +881,11 @@ test_util_time(void *arg)
            b_time.tm_year == (1-1900))) {
       tt_int_op(b_time.tm_year, OP_EQ, 1970-1900);
     }
-    CHECK_TIMEGM_WARNING("Rounding up to ");
+    if (b_time.tm_year != 1970-1900) {
+      CHECK_TIMEGM_WARNING("Rounding up to ");
+    } else {
+      teardown_capture_of_logs();
+    }
   }
 #endif