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:
@@ -11,6 +11,8 @@
|
||||
|
||||
static int group_fired = 0;
|
||||
static int other_fired = 0;
|
||||
static int group_status = 0;
|
||||
static int other_status = 0;
|
||||
|
||||
akerr_ErrorContext *boom(int status)
|
||||
{
|
||||
@@ -28,8 +30,10 @@ akerr_ErrorContext *run(int status)
|
||||
} HANDLE(e, AKERR_KEY)
|
||||
HANDLE_GROUP(e, AKERR_INDEX) {
|
||||
group_fired++;
|
||||
group_status = e->status;
|
||||
} HANDLE(e, AKERR_IO) {
|
||||
other_fired++;
|
||||
other_status = e->status;
|
||||
} FINISH(e, false);
|
||||
return e;
|
||||
}
|
||||
@@ -40,15 +44,18 @@ int main(void)
|
||||
|
||||
run(AKERR_KEY);
|
||||
AKERR_CHECK(group_fired == 1);
|
||||
AKERR_CHECK(group_status == AKERR_KEY);
|
||||
AKERR_CHECK(other_fired == 0);
|
||||
|
||||
run(AKERR_INDEX);
|
||||
AKERR_CHECK(group_fired == 2);
|
||||
AKERR_CHECK(group_status == AKERR_INDEX);
|
||||
AKERR_CHECK(other_fired == 0);
|
||||
|
||||
run(AKERR_IO);
|
||||
AKERR_CHECK(group_fired == 2);
|
||||
AKERR_CHECK(other_fired == 1);
|
||||
AKERR_CHECK(other_status == AKERR_IO);
|
||||
|
||||
AKERR_CHECK(akerr_slots_in_use() == 0);
|
||||
fprintf(stderr, "err_handle_group ok\n");
|
||||
|
||||
Reference in New Issue
Block a user