From 09bd08ed976652b8c09a02ed941b2fc92483e141 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 1 Jul 2011 18:19:18 +0200 Subject: [PATCH] Assert that uv_hrtime() actually sleeps for several microseconds. --- test/test-hrtime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-hrtime.c b/test/test-hrtime.c index 9256b80a..d7badde7 100644 --- a/test/test-hrtime.c +++ b/test/test-hrtime.c @@ -41,7 +41,7 @@ TEST_IMPL(hrtime) { uint64_t a, b, diff; a = uv_hrtime(); - uv_sleep(1); + uv_sleep(100); b = uv_hrtime(); diff = b - a; @@ -49,5 +49,6 @@ TEST_IMPL(hrtime) { printf("diff = %llu\n", diff); ASSERT(diff >= NANOSEC / MICROSEC); + ASSERT(diff > MICROSEC); return 0; }