From 875fff0ae3d7676bbd8816caf1b32e33142d2e73 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 23 Jul 2014 15:35:35 -0500 Subject: 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. --- testsuites/psxtests/psxtime/psxtime.scn | 1 + testsuites/psxtests/psxtime/test.c | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'testsuites/psxtests/psxtime') 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; -- cgit v1.2.3