Fixes #61. Failure in test-hrtime

This commit is contained in:
Robert Mustacchi 2011-06-19 13:59:28 +02:00 committed by Ryan Dahl
parent 4eb06151bd
commit 6eefdaf966

View File

@ -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;
}