From cdc79843ffbf69664a47dc7aeb8dc80e1447963d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 13 Dec 2007 18:00:41 +0000 Subject: 2007-12-13 Joel Sherrill * psx01/init.c, psx01/psx01.scn: Add usleep() test. --- testsuites/psxtests/psx01/init.c | 14 +++++++++++--- testsuites/psxtests/psx01/psx01.scn | 10 ++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'testsuites/psxtests/psx01') diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c index 5a7547e0b8..3aa89dc726 100644 --- a/testsuites/psxtests/psx01/init.c +++ b/testsuites/psxtests/psx01/init.c @@ -28,6 +28,7 @@ void *POSIX_Init( time_t remaining; struct tm tm; struct utsname uts; + useconds_t useconds; puts( "\n\n*** POSIX TEST 1 ***" ); @@ -161,15 +162,13 @@ void *POSIX_Init( tv.tv_sec = 3; tv.tv_nsec = 500000; - puts( "Init: nanosleep - 3.05 seconds" ); + puts( "Init: nanosleep - 1.05 seconds" ); status = nanosleep ( &tv, &tr ); assert( !status ); /* print the current real time again */ - status = clock_gettime( CLOCK_REALTIME, &tv ); assert( !status ); - printf( ctime( &tv.tv_sec ) ); /* check the time remaining */ @@ -177,6 +176,15 @@ void *POSIX_Init( printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec ); assert( !tr.tv_sec && !tr.tv_nsec ); + puts( "Init: usleep - 1.35 seconds" ); + useconds = usleep ( 1350000 ); + assert( useconds < 1350000); + + /* print the current real time again */ + status = clock_gettime( CLOCK_REALTIME, &tv ); + assert( !status ); + printf( ctime( &tv.tv_sec ) ); + /* get id of this thread */ Init_id = pthread_self(); diff --git a/testsuites/psxtests/psx01/psx01.scn b/testsuites/psxtests/psx01/psx01.scn index eb281705d1..0f15268c5b 100644 --- a/testsuites/psxtests/psx01/psx01.scn +++ b/testsuites/psxtests/psx01/psx01.scn @@ -2,8 +2,8 @@ Init: uname - EFAULT (invalid uts pointer argument) Init: uts.sysname: RTEMS Init: uts.nodename: Node 1 -Init: uts.release: 4.7.99.1 -Init: uts.version: +Init: uts.release: 4.8.99.0 +Init: uts.version: Init: uts.machine: SPARC/w/FPU Init: clock_gettime - EINVAL (invalid clockid) Init: clock_settime - EINVAL (invalid clockid) @@ -20,11 +20,13 @@ Fri May 24 11:05:03 1996 Init: seconds remaining (0) Init: nanosleep - EINVAL (NULL time) Init: nanosleep - EINVAL (too many nanoseconds) -Init: nanosleep - negative seconds small delay +Init: nanosleep - negative seconds small delay Init: nanosleep - yield -Init: nanosleep - 3.05 seconds +Init: nanosleep - 1.05 seconds Fri May 24 11:05:06 1996 Init: sec (0), nsec (0) remaining +Init: usleep - 1.35 seconds +Fri May 24 11:05:07 1996 Init: ID is 0x0b010001 Init: sched_get_priority_min (SCHED_FIFO) -- 1 Init: sched_get_priority_min -- EINVAL (invalid policy) -- cgit v1.2.3