summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxtime
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-12-08 17:52:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-12-08 17:52:53 +0000
commit2317457e101509ca16a669d99719ae44b0c60599 (patch)
tree76c26f4c12c18c55f067f00e644a28dded70c79b /testsuites/psxtests/psxtime
parent2009-12-08 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-2317457e101509ca16a669d99719ae44b0c60599.tar.bz2
2009-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/pmacros.h, psx01/task.c, psx02/init.c, psx02/task.c, psx03/init.c, psx03/task.c, psx04/init.c, psx04/task1.c, psx04/task2.c, psx04/task3.c, psx05/init.c, psx05/task.c, psx05/task2.c, psx05/task3.c, psx06/init.c, psx06/task.c, psx06/task2.c, psx07/init.c, psx08/init.c, psx08/task2.c, psx08/task3.c, psx09/init.c, psx10/init.c, psx10/task.c, psx10/task2.c, psx10/task3.c, psx11/init.c, psx11/task.c, psx12/init.c, psxalarm01/init.c, psxbarrier01/test.c, psxcancel01/init.c, psxchroot01/test.c, psxclock/init.c, psxfile01/test.c, psxfile01/test_cat.c, psxfile01/test_extend.c, psxfile01/test_write.c, psxitimer/init.c, psxkey01/task.c, psxkey02/init.c, psxkey03/init.c, psxmount/test.c, psxmsgq01/init.c, psxmsgq03/init.c, psxmsgq04/init.c, psxreaddir/test.c, psxrwlock01/test.c, psxsem01/init.c, psxsignal01/init.c, psxsignal01/task1.c, psxsignal02/init.c, psxsignal03/init.c, psxsignal05/init.c, psxspin01/test.c, psxspin02/test.c, psxstack01/init.c, psxstat/test.c, psxtime/test.c, psxualarm/init.c: Use rtems_test_assert() consistently instead of system assert(). rtems_test_assert() is designed to integrate into the RTEMS test suite infrastructure.
Diffstat (limited to 'testsuites/psxtests/psxtime')
-rw-r--r--testsuites/psxtests/psxtime/test.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/testsuites/psxtests/psxtime/test.c b/testsuites/psxtests/psxtime/test.c
index d0fd09f6d3..790f698eb5 100644
--- a/testsuites/psxtests/psxtime/test.c
+++ b/testsuites/psxtests/psxtime/test.c
@@ -13,7 +13,6 @@
*/
#include <tmacros.h>
-#include <assert.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
@@ -67,16 +66,16 @@ void check_a_tod(
print_time( "rtems_clock_set ", the_tod, "\n" );
status = rtems_clock_set( the_tod );
- assert( !status );
+ rtems_test_assert( !status );
do {
status = rtems_clock_get_tod( &new_tod );
- assert( !status );
+ rtems_test_assert( !status );
print_time( "rtems_clock_get_tod ", &new_tod, "\n" );
/* now do the posix time gets */
result = gettimeofday( &tv, 0 );
- assert( result == 0 );
+ rtems_test_assert( result == 0 );
a_time_t = tv.tv_sec; /* ctime() takes a time_t */
printf( "gettimeofday: %s", ctime( &a_time_t) );
@@ -110,7 +109,7 @@ void test_adjtime(void)
print_time( "rtems_clock_set ", the_tod, "\n" );
status = rtems_clock_set( the_tod );
- assert( !status );
+ rtems_test_assert( !status );
delta.tv_sec = 0;
delta.tv_usec = 0;
@@ -119,56 +118,56 @@ void test_adjtime(void)
puts( "adjtime - NULL delta - EINVAL" );
sc = adjtime( NULL, &olddelta );
- assert( sc == -1 );
- assert( errno == EINVAL );
+ rtems_test_assert( sc == -1 );
+ rtems_test_assert( errno == EINVAL );
puts( "adjtime - delta out of range - EINVAL" );
delta.tv_usec = 1000000000; /* 100 seconds worth */
sc = adjtime( &delta, &olddelta );
- assert( sc == -1 );
- assert( errno == EINVAL );
+ rtems_test_assert( sc == -1 );
+ rtems_test_assert( errno == EINVAL );
puts( "adjtime - delta too small - do nothing" );
delta.tv_sec = 0;
delta.tv_usec = 1;
sc = adjtime( &delta, &olddelta );
- assert( sc == 0 );
+ rtems_test_assert( sc == 0 );
puts( "adjtime - delta too small - do nothing, olddelta=NULL" );
sc = adjtime( &delta, NULL );
- assert( sc == 0 );
+ rtems_test_assert( sc == 0 );
puts( "adjtime - delta of one second forward" );
delta.tv_sec = 1;
delta.tv_usec = 0;
sc = adjtime( &delta, &olddelta );
- assert( sc == 0 );
+ rtems_test_assert( sc == 0 );
puts( "adjtime - delta of almost two seconds forward" );
delta.tv_sec = 1;
delta.tv_usec = 1000000 - 1;
sc = adjtime( &delta, &olddelta );
- assert( sc == 0 );
+ rtems_test_assert( sc == 0 );
/*
* spin until over 1/2 of the way to the
*/
ticks = rtems_clock_get_ticks_per_second();
- assert( ticks );
+ rtems_test_assert( ticks );
ticks /= 2;
do {
status = rtems_clock_get_tod( &tod );
- assert( !status );
+ rtems_test_assert( !status );
} while ( tod.ticks <= ticks );
puts( "adjtime - delta of almost one second forward which bumps second" );
delta.tv_sec = 0;
delta.tv_usec = 1000000 - 1;
sc = adjtime( &delta, &olddelta );
- assert( sc == 0 );
+ rtems_test_assert( sc == 0 );
status = rtems_clock_get_tod( &tod );
- assert( !status );
+ rtems_test_assert( !status );
print_time( "rtems_clock_get_tod ", &tod, "\n" );
}