Skip to content

Commit 2405dd3

Browse files
finikorgnashif
authored andcommitted
edac: tests: Increase code coverage
Add test for better code coverage. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
1 parent 7fc77d9 commit 2405dd3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/subsys/edac/ibecc/src/ibecc.c

+13
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,18 @@ static void test_ibecc_error_inject_test_uc(void)
305305
}
306306
#endif
307307

308+
/* Used only for code coverage */
309+
310+
bool z_x86_do_kernel_nmi(const z_arch_esf_t *esf);
311+
312+
static void test_trigger_nmi_handler(void)
313+
{
314+
bool ret;
315+
316+
ret = z_x86_do_kernel_nmi(NULL);
317+
zassert_false(ret, "Test that NMI handling fails");
318+
}
319+
308320
void test_edac_dummy_api(void);
309321

310322
void test_main(void)
@@ -314,6 +326,7 @@ void test_main(void)
314326
#endif
315327

316328
ztest_test_suite(ibecc,
329+
ztest_unit_test(test_trigger_nmi_handler),
317330
ztest_unit_test(test_ibecc_initialized),
318331
ztest_unit_test(test_ibecc_api),
319332
ztest_unit_test(test_edac_dummy_api),

0 commit comments

Comments
 (0)