testsuites: fix usage of rtems_test_spin_for_ticks

The rtems_test_spin_for_ticks( x ) executes one partial tick and the
remaining x - 1 as complete ticks. Some tests assumed it executed x
complete ticks. Fix those tests.

Fixes #5575.
This commit is contained in:
Gedare Bloom
2026-05-15 12:59:10 -05:00
committed by Kinsey Moore
parent 8f59e18ea3
commit d3a6a6540e
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -72,6 +72,8 @@ static void test_times_functions( void )
rtems_test_assert( start != 0 );
rtems_test_assert( now != 0 );
/* spin for at least interval ticks */
rtems_test_spin_until_next_tick( );
rtems_test_spin_for_ticks( interval );
puts( "_times( &end_tm ) -- OK" );
+3 -3
View File
@@ -90,10 +90,10 @@ rtems_task Init( rtems_task_argument argument )
status = rtems_rate_monotonic_period( period_id, 100 );
directive_failed( status, "rate_monotonic_period" );
/* Do some work */
/* Do some work: this will execute for just under 10 complete ticks. */
rtems_test_spin_for_ticks( 10 );
/* Block a little */
/* Block a little: this will sleep for over 50 complete ticks. */
status = rtems_task_wake_after( 50 );
/* Check the status */
@@ -115,7 +115,7 @@ rtems_task Init( rtems_task_argument argument )
rtems_test_assert( period_status.since_last_period.tv_nsec <= 610000000 );
rtems_test_assert( period_status.executed_since_last_period.tv_sec == 0 );
rtems_test_assert(
period_status.executed_since_last_period.tv_nsec >= 100000000
period_status.executed_since_last_period.tv_nsec >= 90000000
);
rtems_test_assert(
period_status.executed_since_last_period.tv_nsec <= 110000000