Expand error status test coverage
- Added explicit status validation across error handling tests. - Added lifecycle and slot-leak checks to older tests. - Improved unhandled-error propagation coverage. - Added repository guidance and a test runner script. - Verified all 23 CTest tests pass. Co-Authored by Codex GPT 5.4
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
static int wrong_handler_fired = 0;
|
||||
static int swallowed_status = 0;
|
||||
|
||||
akerr_ErrorContext *boom(void)
|
||||
{
|
||||
@@ -24,6 +25,7 @@ akerr_ErrorContext *swallow_it(void)
|
||||
ATTEMPT {
|
||||
CATCH(e, boom());
|
||||
} CLEANUP {
|
||||
swallowed_status = (e != NULL) ? e->status : 0;
|
||||
} PROCESS(e) {
|
||||
} HANDLE(e, AKERR_KEY) {
|
||||
wrong_handler_fired = 1; /* does not match AKERR_VALUE */
|
||||
@@ -38,6 +40,7 @@ int main(void)
|
||||
akerr_ErrorContext *res = swallow_it();
|
||||
|
||||
AKERR_CHECK(wrong_handler_fired == 0);
|
||||
AKERR_CHECK(swallowed_status == AKERR_VALUE);
|
||||
AKERR_CHECK(res == NULL); /* released even though unhandled */
|
||||
AKERR_CHECK(akerr_slots_in_use() == 0);
|
||||
fprintf(stderr, "err_swallow ok\n");
|
||||
|
||||
Reference in New Issue
Block a user