summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxclock/init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-11-12 00:21:51 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-11-12 00:21:51 +0000
commitea7d86b2450f3d4587e13c21b900ad10211aed60 (patch)
treed7068175de1b77342af1ca747f109ba76bd61501 /testsuites/psxtests/psxclock/init.c
parent2009-11-11 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-ea7d86b2450f3d4587e13c21b900ad10211aed60.tar.bz2
2009-11-11 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1466/tests * Makefile.am, configure.ac, psxclock/init.c, psxclock/psxclock.doc, psxclock/psxclock.scn, psxkey03/init.c, psxsignal02/init.c, psxsignal03/init.c, psxstack01/init.c: Remove usleep() from tests. Add test specifically to test it since it is deprecated as of POSIX.1-2008. * psxusleep/.cvsignore, psxusleep/Makefile.am, psxusleep/init.c, psxusleep/psxusleep.doc, psxusleep/psxusleep.scn: New files.
Diffstat (limited to '')
-rw-r--r--testsuites/psxtests/psxclock/init.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/testsuites/psxtests/psxclock/init.c b/testsuites/psxtests/psxclock/init.c
index 41fd228875..1930bfa073 100644
--- a/testsuites/psxtests/psxclock/init.c
+++ b/testsuites/psxtests/psxclock/init.c
@@ -34,7 +34,7 @@ rtems_task Init(
time_t seconds1;
unsigned int remaining;
struct tm tm;
- useconds_t useconds;
+ struct timespec delay_request;
puts( "\n\n*** POSIX CLOCK TEST ***" );
@@ -206,9 +206,11 @@ rtems_task Init(
printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec );
rtems_test_assert( !tr.tv_sec && !tr.tv_nsec );
- puts( "Init: usleep - 1.35 seconds" );
- useconds = usleep ( 1350000 );
- rtems_test_assert( useconds < 1350000 );
+ puts( "Init: nanosleep - 1.35 seconds" );
+ delay_request.tv_sec = 1;
+ delay_request.tv_nsec = 35000000;
+ sc = nanosleep( &delay_request, NULL );
+ assert( !sc );
/* print the current real time again */
sc = clock_gettime( CLOCK_REALTIME, &tv );