diff options
Diffstat (limited to 'spec/score/val/fatal.yml')
-rw-r--r-- | spec/score/val/fatal.yml | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/spec/score/val/fatal.yml b/spec/score/val/fatal.yml index 13d6a3f7..8521c619 100644 --- a/spec/score/val/fatal.yml +++ b/spec/score/val/fatal.yml @@ -104,7 +104,7 @@ test-actions: deadlock_mutex = CreateMutex(); - SetFatalHandler( FatalThreadQueueDeadlock, ctx ); + SetFatalHandler( FatalJumpBack, ctx ); SetSelfPriority( PRIO_NORMAL ); counter = ResetFatalInfo( ctx ); @@ -113,7 +113,7 @@ test-actions: task_id = CreateTask( "WORK", PRIO_HIGH ); StartTask( task_id, ThreadQueueDeadlockTask, NULL ); - if ( setjmp( before_deadlock ) == 0 ) { + if ( setjmp( before_fatal ) == 0 ) { (void) CreateTask( "DLCK", PRIO_NORMAL ); } @@ -134,6 +134,29 @@ test-actions: links: - role: validation uid: ../object/req/fatal-allocator-mutex-deadlock +- action-brief: | + Check that ${/rtems/fatal/if/fatal:/name} terminates the system. Since + SetFatalHandler() requires an initial extension this validates + ${/acfg/if/initial-extensions:/name}. + action-code: | + unsigned int counter; + + SetFatalHandler( FatalJumpBack, ctx ); + counter = ResetFatalInfo( ctx ); + + if ( setjmp( before_fatal ) == 0 ) { + rtems_fatal( 123, 4567890 ); + } + + T_eq_uint( GetFatalCounter( ctx ), counter + 1 ); + T_eq_int( ctx->source, 123 ); + T_eq_ulong( ctx->code, 4567890 ); + checks: [] + links: + - role: validation + uid: /rtems/fatal/req/fatal + - role: validation + uid: /acfg/if/initial-extensions test-brief: | Tests some fatal errors. test-context: @@ -250,7 +273,7 @@ test-support: | rtems_task_exit(); } - static jmp_buf before_deadlock; + static jmp_buf before_fatal; static rtems_id deadlock_mutex; @@ -265,14 +288,14 @@ test-support: | return true; } - static void FatalThreadQueueDeadlock( + static void FatalJumpBack( rtems_fatal_source source, rtems_fatal_code code, void *arg ) { Fatal( source, code, arg ); - longjmp( before_deadlock, 1 ); + longjmp( before_fatal, 1 ); } static void ThreadQueueDeadlockTask( rtems_task_argument arg ) |