diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-13 18:00:41 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-13 18:00:41 +0000 |
commit | cdc79843ffbf69664a47dc7aeb8dc80e1447963d (patch) | |
tree | f515583749468fe654ab86abc07d417bcb33d242 | |
parent | 2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-cdc79843ffbf69664a47dc7aeb8dc80e1447963d.tar.bz2 |
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* psx01/init.c, psx01/psx01.scn: Add usleep() test.
-rw-r--r-- | testsuites/psxtests/ChangeLog | 4 | ||||
-rw-r--r-- | testsuites/psxtests/psx01/init.c | 14 | ||||
-rw-r--r-- | testsuites/psxtests/psx01/psx01.scn | 10 |
3 files changed, 21 insertions, 7 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index 5b1af2141f..bda976ede6 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,5 +1,9 @@ 2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> + * psx01/init.c, psx01/psx01.scn: Add usleep() test. + +2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> + * Makefile.am, configure.ac: New test to cover all RTEMS POSIX functions that return ENOSYS. * psxenosys/.cvsignore, psxenosys/Makefile.am, psxenosys/init.c, 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) |