2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>

* psx01/init.c, psx01/psx01.scn: Add usleep() test.
This commit is contained in:
Joel Sherrill
2007-12-13 18:00:41 +00:00
parent bcf4cbb589
commit cdc79843ff
3 changed files with 21 additions and 7 deletions

View File

@@ -1,3 +1,7 @@
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

View File

@@ -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();

View File

@@ -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)