mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-09 08:37:58 +08:00
2008-01-18 Jennifer Averett <jennifer.averett@OARcorp.com>
* psx01/init.c, psxmsgq01/init.c, psxtimer01/psxtimer.c, psxtimer01/psxtimer01.scn, psxtimer02/psxtimer.c:
This commit is contained in:
1 parent
c3925dbe92
commit
0e4232bbd6
6 files changed
+139
-45
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2008-01-18 Jennifer Averett <jennifer.averett@OARcorp.com>
|
||||
|
||||
* psx01/init.c, psxmsgq01/init.c, psxtimer01/psxtimer.c,
|
||||
psxtimer01/psxtimer01.scn, psxtimer02/psxtimer.c:
|
||||
|
||||
2007-12-20 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* psxsignal01/.cvsignore, psxualarm/.cvsignore: New files.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -52,8 +52,13 @@ void *POSIX_Init(
|
||||
|
||||
/* error cases in clock_gettime and clock_settime */
|
||||
|
||||
puts( "Init: clock_gettime - EINVAL (NULL timespec)" );
|
||||
status = clock_gettime( CLOCK_REALTIME, NULL );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
puts( "Init: clock_gettime - EINVAL (invalid clockid)" );
|
||||
status = clock_settime( -1, &tv );
|
||||
status = clock_gettime( -1, &tv );
|
||||
assert( status == -1 );
|
||||
assert( errno == EINVAL );
|
||||
|
||||
@@ -102,8 +107,11 @@ void *POSIX_Init(
|
||||
|
||||
remaining = sleep( 3 );
|
||||
assert( !remaining );
|
||||
|
||||
|
||||
/* print new times to make sure it has changed and we can get the realtime */
|
||||
status = clock_gettime( CLOCK_PROCESS_CPUTIME, &tv );
|
||||
assert( !status );
|
||||
printf("Time since boot: (%d, %d)\n", tv.tv_sec,tv.tv_nsec );
|
||||
|
||||
status = clock_gettime( CLOCK_REALTIME, &tv );
|
||||
assert( !status );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
int count;
|
||||
} Test_queue_type;
|
||||
|
||||
Test_queue_type Test_q[ NUMBER_OF_TEST_QUEUES ] =
|
||||
Test_queue_type Test_q[ NUMBER_OF_TEST_QUEUES + 1 ] =
|
||||
{
|
||||
{ 0, 0, "Qread", ( O_CREAT | O_RDONLY | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 },
|
||||
{ 0, 1, "Qwrite", ( O_CREAT | O_WRONLY | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 },
|
||||
@@ -51,6 +51,7 @@ Test_queue_type Test_q[ NUMBER_OF_TEST_QUEUES ] =
|
||||
{ 0, 3, "Qblock", ( O_CREAT | O_RDWR ) , MAXMSG, MSGSIZE, 0 },
|
||||
{ 0, 4, "Qdefault", ( O_CREAT | O_RDWR ) , 10, 16, 0 },
|
||||
{ 0, 5, "mq6", ( O_CREAT | O_WRONLY | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 },
|
||||
{ 0, 6, "Qblock", ( O_RDWR ) , MAXMSG, MSGSIZE, 0 },
|
||||
};
|
||||
|
||||
#define RW_NAME Test_q[ RW_QUEUE ].name
|
||||
@@ -130,7 +131,7 @@ void open_test_queues()
|
||||
|
||||
puts( "Init: Open Test Queues" );
|
||||
|
||||
for( que = 0; que < NUMBER_OF_TEST_QUEUES; que++ ) {
|
||||
for( que = 0; que < NUMBER_OF_TEST_QUEUES+1; que++ ) {
|
||||
|
||||
tq = &Test_q[ que ];
|
||||
if ( que == DEFAULT_RW)
|
||||
@@ -141,6 +142,8 @@ void open_test_queues()
|
||||
assert( Test_q[que].mq != (-1) );
|
||||
}
|
||||
|
||||
status = mq_close( Test_q[NUMBER_OF_TEST_QUEUES].mq );
|
||||
fatal_posix_service_status( status, 0, "mq_close duplicate message queue");
|
||||
status = mq_close( Test_q[CLOSED].mq );
|
||||
fatal_posix_service_status( status, 0, "mq_close message queue");
|
||||
status = mq_unlink( CLOSED_NAME );
|
||||
@@ -949,7 +952,6 @@ void verify_notify()
|
||||
/*
|
||||
* XXX setup notification
|
||||
*/
|
||||
|
||||
printf( "_____mq_notify - notify when %s gets a message\n",RW_NAME);
|
||||
status = mq_notify( Test_q[RW_QUEUE].mq, &event );
|
||||
fatal_posix_service_status( status, 0, "mq_notify valid status");
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,5 @@
|
||||
*** POSIX Timers Test 01 ***
|
||||
task A: timer_settime - value=0:0 interval=0:0
|
||||
Executing task A Fri Jan 1 00:00:01 1988
|
||||
Executing task B with x = 1 Fri Jan 1 00:00:02 1988
|
||||
Executing task A Fri Jan 1 00:00:02 1988
|
||||
@@ -32,6 +33,8 @@ Executing task A Fri Jan 1 00:00:17 1988
|
||||
Executing task B with x = 9 Fri Jan 1 00:00:18 1988
|
||||
Executing task C with x = 9 Fri Jan 1 00:00:18 1988
|
||||
Executing task A Fri Jan 1 00:00:18 1988
|
||||
task C: timer_getoverrun - overruns=0
|
||||
task C: timer_gettime - 2:0 remaining from 3:0
|
||||
Executing task A Fri Jan 1 00:00:19 1988
|
||||
Executing task B with x = 10 Fri Jan 1 00:00:20 1988
|
||||
*** END OF POSIX Timers Test 01 ***
|
||||
@@ -92,6 +92,12 @@ void *POSIX_Init (
|
||||
status = timer_settime( timer, TIMER_ABSTIME, &itimer, NULL );
|
||||
fatal_posix_service_status_errno( status, EINVAL, "bad itimer value #2" );
|
||||
|
||||
itimer.it_value = _TOD_Now;
|
||||
itimer.it_value.tv_sec = itimer.it_value.tv_sec - 1;
|
||||
puts( "timer_settime - bad itimer value - previous time - EINVAL" );
|
||||
status = timer_settime( timer, TIMER_ABSTIME, &itimer, NULL );
|
||||
fatal_posix_service_status_errno( status, EINVAL, "bad itimer value #3" );
|
||||
|
||||
itimer.it_value.tv_nsec = 0;
|
||||
puts( "timer_settime - bad clock value - EINVAL" );
|
||||
status = timer_settime( timer, 0x80, &itimer, NULL );
|
||||
|
||||
Reference in new issue
Block a user