tests/kernel/fatal: Work around historical API misuse
This test was written to do a k_oops() in the main thread. That's an essential thread, and aborting it is actually a system panic now. The test was written contra the docs on this, but it worked fine for years. Just reflag the thread as a simple workaround rather than trying anything fancy. This is a very simple test. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
fb613594c7
commit
c64ac967a8
1 changed files with 10 additions and 0 deletions
|
@ -9,6 +9,8 @@
|
|||
|
||||
static volatile int expected_reason = -1;
|
||||
|
||||
void z_thread_essential_clear(void);
|
||||
|
||||
void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf)
|
||||
{
|
||||
printk("Caught system error -- reason %d\n", reason);
|
||||
|
@ -73,5 +75,13 @@ void test_message_capture(void)
|
|||
|
||||
void main(void)
|
||||
{
|
||||
/* main() is an essential thread, and we try to OOPS it. When
|
||||
* this test was written, that worked (even though it wasn't
|
||||
* supposed to per docs). Now we trap a different error (a
|
||||
* panic and not an oops). Set the thread non-essential as a
|
||||
* workaround.
|
||||
*/
|
||||
z_thread_essential_clear();
|
||||
|
||||
test_message_capture();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue