Expose ignored error snapshot
Co-Authored-By: Andrew Kesterson <andrew@aklabs.net>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user