diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-13 13:32:23 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-10-13 13:32:23 +0200 |
commit | a29dc105ffcee1531781b55bad450188fb7988f4 (patch) | |
tree | d40464d5a1a35e757c5327728d8d866bb8754158 | |
parent | d256804f5d6602fe79458fbe67f93b426ca62b75 (diff) |
testsuites/validation/tc-timecounter-install.c
-rw-r--r-- | testsuites/validation/tc-timecounter-install.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuites/validation/tc-timecounter-install.c b/testsuites/validation/tc-timecounter-install.c index 344befdfd3..d0199647d6 100644 --- a/testsuites/validation/tc-timecounter-install.c +++ b/testsuites/validation/tc-timecounter-install.c @@ -55,6 +55,7 @@ #include <rtems.h> #include <rtems/timecounter.h> #include <rtems/score/atomic.h> +#include <rtems/score/threaddispatch.h> #include "tx-support.h" @@ -235,6 +236,8 @@ * - Prepare the timecounter to get a large time difference. Check that * rtems_clock_get_monotonic_timeval() returns the correct time. * + * - Update the oldest timehand after a large time interval. + * * @{ */ @@ -828,6 +831,33 @@ static void ScoreTimecounterValInstall_Action_5( void ) } /** + * @brief Update the oldest timehand after a large time interval. + */ +static void ScoreTimecounterValInstall_Action_6( void ) +{ + Timecounter *tc; + Per_CPU_Control *cpu_self; + struct bintime bt; + + tc = &high_quality_high_frequency; + + SetCounter( tc, 0 ); + rtems_clock_get_realtime_bintime( &bt ); + T_eq_i64( bt.sec, 567993600 ); + T_eq_u64( bt.frac, 103079215104 ); + + SetCounter( tc, 2 * tc->base.tc_frequency ); + cpu_self = _Thread_Dispatch_disable(); + rtems_timecounter_tick(); + _Thread_Dispatch_enable( cpu_self ); + + SetCounter( tc, 2 * tc->base.tc_frequency ); + rtems_clock_get_realtime_bintime( &bt ); + T_eq_i64( bt.sec, 567993602 ); + T_eq_u64( bt.frac, 103079215104 ); +} + +/** * @fn void T_case_body_ScoreTimecounterValInstall( void ) */ T_TEST_CASE( ScoreTimecounterValInstall ) @@ -838,6 +868,7 @@ T_TEST_CASE( ScoreTimecounterValInstall ) ScoreTimecounterValInstall_Action_3(); ScoreTimecounterValInstall_Action_4(); ScoreTimecounterValInstall_Action_5(); + ScoreTimecounterValInstall_Action_6(); } /** @} */ |