From 6eefdaf966cd328a73d918ccbfffd4f6f6a77126 Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Sun, 19 Jun 2011 13:59:28 +0200 Subject: [PATCH] Fixes #61. Failure in test-hrtime --- test/test-hrtime.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test-hrtime.c b/test/test-hrtime.c index e7309804..41f9f1c9 100644 --- a/test/test-hrtime.c +++ b/test/test-hrtime.c @@ -23,6 +23,10 @@ #include "task.h" +/* + * We expect the amount of time passed to be at least one us plus two system + * calls. Therefore checking that at least a microsecond has elapsed is safe. + */ TEST_IMPL(hrtime) { uint64_t a, b, diff; @@ -33,5 +37,7 @@ TEST_IMPL(hrtime) { diff = b - a; printf("diff = %llu\n", diff); - ASSERT(b - a >= NANOSEC / MILLISEC); + + ASSERT(diff >= NANOSEC / MICROSEC); + return 0; }