summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/sp09
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-13 21:45:23 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-12-13 21:45:23 +0000
commit9c691efcf40135d1b875515b25108f8cf4ed8ee7 (patch)
tree1551d8e41fcf872916d2452681fc384128e299d3 /testsuites/sptests/sp09
parent2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-9c691efcf40135d1b875515b25108f8cf4ed8ee7.tar.bz2
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp07/init.c, sp07/sp07.scn, sp07/task1.c: Add tests for using notepad with the current task's ID or SELF * sp09/screen02.c, sp09/screen04.c, sp09/sp09.scn: Add test missing test cases for clock_get.
Diffstat (limited to 'testsuites/sptests/sp09')
-rw-r--r--testsuites/sptests/sp09/screen02.c45
-rw-r--r--testsuites/sptests/sp09/screen04.c9
-rw-r--r--testsuites/sptests/sp09/sp09.scn6
3 files changed, 56 insertions, 4 deletions
diff --git a/testsuites/sptests/sp09/screen02.c b/testsuites/sptests/sp09/screen02.c
index a7d0dcd029..648007b4e2 100644
--- a/testsuites/sptests/sp09/screen02.c
+++ b/testsuites/sptests/sp09/screen02.c
@@ -6,7 +6,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -21,6 +21,8 @@
void Screen2()
{
rtems_time_of_day time;
+ rtems_interval interval;
+ struct timeval tv;
rtems_status_code status;
/* errors before clock is set */
@@ -34,11 +36,48 @@ void Screen2()
fatal_directive_status(
status,
RTEMS_NOT_DEFINED,
- "rtems_clock_get before clock is set"
+ "rtems_clock_get before clock is set #1"
);
- puts( "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED" );
+ puts( "TA1 - rtems_clock_get - TOD - RTEMS_NOT_DEFINED" );
}
+ status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &interval );
+ if ( status == RTEMS_SUCCESSFUL ) {
+ puts(
+ "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
+ );
+ } else {
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_clock_get before clock is set #2"
+ );
+ puts( "TA1 - rtems_clock_get - SECONDS SINCE EPOCH - RTEMS_NOT_DEFINED" );
+ }
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &tv );
+ if ( status == RTEMS_SUCCESSFUL ) {
+ puts(
+ "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
+ );
+ } else {
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_clock_get before clock is set #3"
+ );
+ puts( "TA1 - rtems_clock_get - TIME VALUE - RTEMS_NOT_DEFINED" );
+ }
+
+ /* arbitrary bad value for switch */
+ status = rtems_clock_get( 0x100, &tv );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_clock_get bad case"
+ );
+ puts( "TA1 - rtems_clock_get - RTEMS_INVALID_NUMBER" );
+
status = rtems_task_wake_when( &time );
if ( status == RTEMS_SUCCESSFUL ) {
puts(
diff --git a/testsuites/sptests/sp09/screen04.c b/testsuites/sptests/sp09/screen04.c
index f9021b55ce..ac9bca0a7e 100644
--- a/testsuites/sptests/sp09/screen04.c
+++ b/testsuites/sptests/sp09/screen04.c
@@ -22,6 +22,8 @@ void Screen4()
{
rtems_event_set event_out;
rtems_time_of_day time;
+ struct timeval tv;
+ time_t seconds;
rtems_status_code status;
status = rtems_event_receive(
@@ -81,4 +83,11 @@ void Screen4()
status = rtems_clock_set( &time );
directive_failed( status, "rtems_clock_set" );
puts( " - RTEMS_SUCCESSFUL" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &tv );
+ directive_failed( status, "clock_get time value OK" );
+
+ seconds = tv.tv_sec;
+ printf( "TA1 - current time - %s\n", ctime(&seconds) );
+
}
diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn
index 15d1946f26..74a2a1c542 100644
--- a/testsuites/sptests/sp09/sp09.scn
+++ b/testsuites/sptests/sp09/sp09.scn
@@ -21,7 +21,10 @@ TA1 - rtems_task_start - RTEMS_INVALID_ID
TA1 - rtems_task_start - RTEMS_INCORRECT_STATE
TA1 - rtems_task_suspend - RTEMS_INVALID_ID
<pause - screen 2>
-TA1 - rtems_clock_get - RTEMS_NOT_DEFINED
+TA1 - rtems_clock_get - TOD - RTEMS_NOT_DEFINED
+TA1 - rtems_clock_get - SECONDS SINCE EPOCH - RTEMS_NOT_DEFINED
+TA1 - rtems_clock_get - TIME VALUE - RTEMS_NOT_DEFINED
+TA1 - rtems_clock_get - RTEMS_INVALID_NUMBER
TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED
TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED
TA1 - rtems_clock_set - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
@@ -63,6 +66,7 @@ TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT
TA1 - rtems_event_send - RTEMS_INVALID_ID
TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL
TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
+TA1 - current time - Fri Feb 5 08:30:45 1988
<pause - screen 5>
TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME
TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL