test_deadend
- Function
- August 22, 2025
Table of Contents
test_deadend
test_deadend
Description
Run a specific test function using setjmp/longjmp to capture aborts. This is used for deadend tests that are expected to call LOG_FATAL.
Parameters
Name | Direction | Description |
---|---|---|
test_func | in | Test function to execute. |
expect_failure | in | If true, expects the test to call SysAbort(). |
Success
Returns true if test behaved as expected.
Failure
Returns false if test did not behave as expected.
Usage example (Cross-references)
- In
TestRunner.c:26
:
// Run a specific deadend test using setjmp/longjmp to capture aborts
bool test_deadend(TestFunction test_func, bool expect_failure) {
if (!test_func) {
printf("[ERROR] test_deadend: NULL test function provided\n");
- In
TestRunner.c:28
:
bool test_deadend(TestFunction test_func, bool expect_failure) {
if (!test_func) {
printf("[ERROR] test_deadend: NULL test function provided\n");
return false;
}
- In
TestRunner.c:117
:
for (int i = 0; i < count; i++) {
printf("[TEST %d/%d] ", i + 1, count);
bool result = test_deadend(tests[i], true); // All deadend tests expect failure
if (result) {
printf("[PASS]\n\n");