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 /testsuites/psxtests/psx01/init.c | |
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.
Diffstat (limited to 'testsuites/psxtests/psx01/init.c')
-rw-r--r-- | testsuites/psxtests/psx01/init.c | 14 |
1 files changed, 11 insertions, 3 deletions
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(); |