From c6da8821ac6c0ac372ce665c93b29e00eba58e4a Mon Sep 17 00:00:00 2001 From: Christian Hujer Date: Fri, 19 Apr 2024 18:41:29 +0530 Subject: [PATCH] Clarify the table in Assertion/Failure Features. --- README.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 53a9bd0..142b212 100644 --- a/README.md +++ b/README.md @@ -220,16 +220,34 @@ clean:: ## Assertion/Failure Features There are multiple ways how you can make a test-case fail. +The following table shows which type of assertion is supported by which type of runner. - - - - - - + + + + + + +
Assertion SimpleRunnerSetJmpRunnerAbortRunnerForkRunner
<stdlib.h> longjmp()no yes yes no (not required)
<assert.h> assert() stop no yes yes
<stdlib.h> abort() stop no yes yes
<stdlib.h> exit() stop no no yes
<AceUnit.h> assert()stop yes yes yes
Assertion SimpleRunnerSetJmpRunnerAbortRunnerForkRunner
<stdlib.h> longjmp() no yes yes no
<assert.h> assert() stop no yes yes
<stdlib.h> abort() stop no yes yes
<stdlib.h> exit() stop no no yes
<AceUnit.h> assert() stop yes yes yes
abnormal test case termination (like `SEGFAULT`)no no no yes
+Legend: +* "no" means that this runner doesn't support the specified assertion type. + This means that this assertion type will not result in a test case fail. + It also means that the test execution will be aborted. + For example, using `exit(1)` will simply abort test execution for all runners except for the _ForkRunner_. +* "yes" means that this runner supports the specified assertion type. + The assertion will result in a test case fail. + And the runner will continue execution with the next test case. +* "stop" means that this runner supports the specified assertion type. + The assertion will result in a test case fail. + However, the runner will _not_ continue execution with the next test case but instead stop. + +The _ForkRunner_ does not support `longjmp()` as there is no need for this. +Using `longjmp()` for assertions in a test case only serves the purpose of implementing a kind of exception handling in the absence of proper exception handling. +The _ForkRunner_ uses POSIX `fork()` for exception handling, so using `longjmp()` or catching `SIGABORT` as a workaround to have exception handling in C is not required. + ## Test Fixtures ## What is different from previous versions?