jerenkrantz 02/01/02 14:47:56
Modified: test testsleep.c
Log:
Add stdlib.h for exit.
Print out the time information if we fail. On my Linux SMP box, we
sleep for less than the time requested. Is this permissible? (I'd
suggest doing 0.99*interval<->1.01*interval.)
Revision Changes Path
1.3 +3 -1 apr/test/testsleep.c
Index: testsleep.c
===================================================================
RCS file: /home/cvs/apr/test/testsleep.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- testsleep.c 2 Jan 2002 19:47:07 -0000 1.2
+++ testsleep.c 2 Jan 2002 22:47:56 -0000 1.3
@@ -59,6 +59,7 @@
#include "apr_lib.h"
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
#include "test_apr.h"
@@ -77,7 +78,8 @@
printf("%-60s"," Just woken up, checking how long I've been asleep");
if (diff < interval || diff > interval * 1.01) {
- printf("Failed!\n");
+ printf("Failed!\n\t(actual: %" APR_TIME_T_FMT
+ ", wanted: %" APR_TIME_T_FMT")\n", diff, interval);
} else {
printf("OK\n");
}