OnAbort
Description
Register a custom callback function invoked when Abort runs. If no callback is registered, Abort traps directly.
Parameters
| Name | Direction | Description |
|---|---|---|
callback |
in | Function to call when Abort is invoked, or NULL to reset to default. |
Success
Callback is registered.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Sys.c:251:
static AbortCallback g_abort_callback = NULL;
void OnAbort(AbortCallback callback) {
g_abort_callback = callback;
}- In
TestRunner.c:271:
// Install the abort capture handler for the duration of this call.
OnAbort(test_abort_handler);
bool test_result = false;- In
TestRunner.c:296:
// Restore the default abort path before returning.
OnAbort(NULL);
return test_result;
Last updated on