]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Increase tolerances in util/monotonic_time tests
authorNick Mathewson <nickm@torproject.org>
Wed, 7 Dec 2016 16:08:54 +0000 (11:08 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 7 Dec 2016 16:08:54 +0000 (11:08 -0500)
This is an attempt to fix #19974.

changes/19974 [new file with mode: 0644]
src/test/test_util.c

diff --git a/changes/19974 b/changes/19974
new file mode 100644 (file)
index 0000000..5496143
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (unit tests):
+    - Fix tolerances in unit tests for monotonic time comparisons between
+      nanoseconds and microseconds. Previously, we accepted a 10 us
+      difference only, which is not realistic on every platform's
+      clock_gettime(). Fixes bug 19974; bugfix on 0.2.9.1-alpha.
index 7276c0cbfca7a83d17948b8ce5276de166972463..fcda56456956bb7fbe98f8ec3c6b4de29d1b4277 100644 (file)
@@ -5531,9 +5531,9 @@ test_util_monotonic_time(void *arg)
   tt_u64_op(msecc1, OP_GE, nsecc1 / 1000000);
   tt_u64_op(usecc1, OP_GE, nsecc1 / 1000);
   tt_u64_op(msec1, OP_LE, nsec1 / 1000000 + 1);
-  tt_u64_op(usec1, OP_LE, nsec1 / 1000 +10);
+  tt_u64_op(usec1, OP_LE, nsec1 / 1000 + 1000);
   tt_u64_op(msecc1, OP_LE, nsecc1 / 1000000 + 1);
-  tt_u64_op(usecc1, OP_LE, nsecc1 / 1000 + 10);
+  tt_u64_op(usecc1, OP_LE, nsecc1 / 1000 + 1000);
 
  done:
   ;