Module Name: src
Committed By: pgoyette
Date: Thu Nov 8 16:33:26 UTC 2012
Modified Files:
src/tests/lib/libc/gen: t_sleep.c
Log Message:
Provide clear explanation of test-case failures.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/gen/t_sleep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/gen/t_sleep.c
diff -u src/tests/lib/libc/gen/t_sleep.c:1.2 src/tests/lib/libc/gen/t_sleep.c:1.3
--- src/tests/lib/libc/gen/t_sleep.c:1.2 Thu Nov 8 04:58:44 2012
+++ src/tests/lib/libc/gen/t_sleep.c Thu Nov 8 16:33:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sleep.c,v 1.2 2012/11/08 04:58:44 pgoyette Exp $ */
+/* $NetBSD: t_sleep.c,v 1.3 2012/11/08 16:33:26 pgoyette Exp $ */
/*-
* Copyright (c) 2006 Frank Kardel
@@ -135,10 +135,9 @@ do_kevent(struct timespec *delay, struct
ATF_REQUIRE_MSG(rtc != -1 || kerrno == EINTR, "kevent: %s",
strerror(errno));
- if (rtc == 0)
- ATF_REQUIRE_MSG((delay->tv_sec * BILLION + delay->tv_nsec -
- tmo * MILLION) <= 0,
- "kevent - none queued - timing error");
+ if (delay->tv_sec * BILLION + delay->tv_nsec > tmo * MILLION)
+ ATF_REQUIRE_MSG(rtc > 0,
+ "kevent: ALARM did not cause EVFILT_TIMER event");
return 0;
}
@@ -264,7 +263,7 @@ sleeptest(int (*test)(struct timespec *,
delta3 *= round;
ATF_REQUIRE_MSG(delta3 <= FUZZ && delta3 >= -FUZZ,
- "Elapsed time %"PRId64" exceeds allowable fuzz %lld",
+ "Reschedule latency %"PRId64" exceeds allowable fuzz %lld",
delta3, FUZZ);
delta3 = (int64_t)tslp.tv_sec * 2 * BILLION;