diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-11-07 14:06:56 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-11-07 15:23:26 +0100 |
commit | 1a3125c0fef850650eb6b0dc6ced81a4cda970ab (patch) | |
tree | d2175c5eba84b1f673051688b68a9e557bbc13b0 /testsuites/validation | |
parent | build: Do not use coverage for librtemstest (diff) | |
download | rtems-1a3125c0fef850650eb6b0dc6ced81a4cda970ab.tar.bz2 |
validation: Improve thread idle bodies test
Update #3716.
Diffstat (limited to 'testsuites/validation')
-rw-r--r-- | testsuites/validation/tc-thread-idle-body-no-return.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/testsuites/validation/tc-thread-idle-body-no-return.c b/testsuites/validation/tc-thread-idle-body-no-return.c index 49caf8b03d..19c86dad99 100644 --- a/testsuites/validation/tc-thread-idle-body-no-return.c +++ b/testsuites/validation/tc-thread-idle-body-no-return.c @@ -100,19 +100,30 @@ typedef ScoreThreadValIdleBodyNoReturn_Context Context; static void CheckIdleBody( Context *ctx, rtems_task_entry entry ) { - rtems_id id; + rtems_id id; + rtems_interval interval; + rtems_status_code sc; ctx->counter = 0; id = CreateTask( "WORK", PRIO_LOW ); StartTask( id, entry, ctx ); - while ( ctx->counter == 0 ) { - rtems_status_code sc; + /* + * With optimization disabled, coverage enabled, SMP enabled and a slow + * target, things may take some time. + */ + interval = 1; + while ( ctx->counter == 0 && interval <= 1024 ) { - sc = rtems_task_wake_after( 1 ); + sc = rtems_task_wake_after( interval ); T_rsc_success( sc ); + + interval *= 2; } + sc = rtems_task_wake_after( interval ); + T_rsc_success( sc ); + T_eq_u32( ctx->counter, 1 ); DeleteTask( id ); } |