Expose ignored error snapshot
All checks were successful
libakerror CI Build / coverage (push) Successful in 3m18s
libakerror CI Build / cmake_build (push) Successful in 10m11s
libakerror CI Build / mutation_test (push) Successful in 45m33s

Co-Authored-By: Andrew Kesterson <andrew@aklabs.net>
This commit is contained in:
2026-08-04 11:24:30 -04:00
parent 55090d2419
commit 5a269ea01b
8 changed files with 19 additions and 19 deletions

View File

@@ -107,7 +107,7 @@ The remaining survivors are dominated by:
* **Equivalent mutants** in `akerr_init`: deleting the `memset`/`NULL` setup of
file-scope statics (`AKERR_ARRAY_ERROR`, `__akerr_last_ditch`,
`__akerr_last_ignored`) changes nothing, because C already zero-initializes
`akerr_last_ignored`) changes nothing, because C already zero-initializes
objects with static storage duration. `int oldid = 0;``1` is likewise
dead: it is overwritten before use, and so is clearing `akerr_initializing`
at the end of initialization — nothing reads that flag once the once-routine

View File

@@ -24,8 +24,8 @@ int main(void)
* iteration. */
for ( int i = 0; i < AKERR_MAX_ARRAY_ERROR + 1; i++ ) {
IGNORE(boom());
AKERR_CHECK(__akerr_last_ignored.status == AKERR_VALUE);
AKERR_CHECK(strcmp(__akerr_last_ignored.message,
AKERR_CHECK(akerr_last_ignored.status == AKERR_VALUE);
AKERR_CHECK(strcmp(akerr_last_ignored.message,
"this error is ignored on purpose") == 0);
AKERR_CHECK(akerr_slots_in_use() == 0);
}

View File

@@ -103,8 +103,8 @@ static void *pool_body(void *raw)
/* IGNORE's snapshot is thread-local while logging and remains valid after
* release. Concurrent ignored errors must all return their pool slots. */
IGNORE(ignorable(arg));
AKERR_TCHECK(arg, __akerr_last_ignored.status == AKERR_IO);
AKERR_TCHECK(arg, strcmp(__akerr_last_ignored.message, expected) == 0);
AKERR_TCHECK(arg, akerr_last_ignored.status == AKERR_IO);
AKERR_TCHECK(arg, strcmp(akerr_last_ignored.message, expected) == 0);
/* Reuse a slot after IGNORE and prove that the copied snapshot did not
* become an alias for the newly acquired context. */
@@ -113,8 +113,8 @@ static void *pool_body(void *raw)
if ( reused != NULL ) {
RELEASE_ERROR(reused);
}
AKERR_TCHECK(arg, __akerr_last_ignored.status == AKERR_IO);
AKERR_TCHECK(arg, strcmp(__akerr_last_ignored.message, expected) == 0);
AKERR_TCHECK(arg, akerr_last_ignored.status == AKERR_IO);
AKERR_TCHECK(arg, strcmp(akerr_last_ignored.message, expected) == 0);
return NULL;
}