diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-07-23 15:35:35 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-07-23 16:53:24 -0500 |
commit | 875fff0ae3d7676bbd8816caf1b32e33142d2e73 (patch) | |
tree | de7a2c0e7f8dcdef75aac8a9e913de873aa097b6 /testsuites/psxtests | |
parent | adjtime.c: Use timestamp math and simplify (diff) | |
download | rtems-875fff0ae3d7676bbd8816caf1b32e33142d2e73.tar.bz2 |
Add _TOD_Adjust to SCORE TOD Handler.
This lays the proper structure for doing future work on
time adjustment algorithms. Any TOD adjustments should be
requested at the API level and performed at the SCORE level.
Additionally updated a test.
Diffstat (limited to 'testsuites/psxtests')
-rw-r--r-- | testsuites/psxtests/psxtime/psxtime.scn | 1 | ||||
-rw-r--r-- | testsuites/psxtests/psxtime/test.c | 21 |
2 files changed, 18 insertions, 4 deletions
diff --git a/testsuites/psxtests/psxtime/psxtime.scn b/testsuites/psxtests/psxtime/psxtime.scn index 174f9d71ba..2d56b7d4d1 100644 --- a/testsuites/psxtests/psxtime/psxtime.scn +++ b/testsuites/psxtests/psxtime/psxtime.scn @@ -5,6 +5,7 @@ _gettimeofday( NULL, NULL ) - EFAULT rtems_clock_set 12:45:00 01/01/1988 adjtime - NULL delta - EINVAL adjtime - delta out of range - EINVAL +adjtime - delta range of 0 - OK adjtime - delta too small - do nothing adjtime - delta too small - do nothing, olddelta=NULL adjtime - delta of one second forward, olddelta=NULL diff --git a/testsuites/psxtests/psxtime/test.c b/testsuites/psxtests/psxtime/test.c index 58484e9605..7620d56d27 100644 --- a/testsuites/psxtests/psxtime/test.c +++ b/testsuites/psxtests/psxtime/test.c @@ -1,8 +1,14 @@ -/* - * This test exercises the time of day services via the Classic - * and POSIX APIs to make sure they are consistent. +/** + * @file * - * COPYRIGHT (c) 1989-2009. + * This test exercises the time of day services via the Classic + * and POSIX APIs to make sure they are consistent. It additionally + * exericses the adjtime() method. + * + */ + +/* + * COPYRIGHT (c) 1989-2014. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -128,11 +134,18 @@ void test_adjtime(void) rtems_test_assert( errno == EINVAL ); puts( "adjtime - delta out of range - EINVAL" ); + delta.tv_sec = 0; delta.tv_usec = 1000000000; /* 100 seconds worth */ sc = adjtime( &delta, &olddelta ); rtems_test_assert( sc == -1 ); rtems_test_assert( errno == EINVAL ); + puts( "adjtime - delta range of 0 - OK" ); + delta.tv_sec = 0; + delta.tv_usec = 0; + sc = adjtime( &delta, &olddelta ); + rtems_test_assert( sc == 0 ); + puts( "adjtime - delta too small - do nothing" ); delta.tv_sec = 0; delta.tv_usec = 1; |