Fixed documentation on report hook parameters
This commit is contained in:
parent
3a2fe96653
commit
d58fc1598a
1 changed files with 2 additions and 9 deletions
|
@ -41,10 +41,7 @@ The flow of the test process goes as follows:
|
|||
Hook Parameters
|
||||
---------------
|
||||
|
||||
A report hook may take zero or one parameter. If a parameter is given, it
|
||||
is undefined behaviour if it is not a pointer type and not of the proper pointed
|
||||
type for that phase.
|
||||
|
||||
A report hook takes exactly one parameter.
|
||||
Valid types for each phases are:
|
||||
|
||||
* ``struct criterion_test_set *`` for ``PRE_ALL``.
|
||||
|
@ -56,17 +53,13 @@ Valid types for each phases are:
|
|||
* ``struct criterion_suite_stats *`` for ``POST_SUITE``.
|
||||
* ``struct criterion_global_stats *`` for ``POST_ALL``.
|
||||
|
||||
For instance, these are valid report hook declarations for the ``PRE_TEST`` phase:
|
||||
For instance, this is a valid report hook declaration for the ``PRE_TEST`` phase:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#include <criterion/criterion.h>
|
||||
#include <criterion/hooks.h>
|
||||
|
||||
ReportHook(PRE_TEST)() {
|
||||
// not using the parameter
|
||||
}
|
||||
|
||||
ReportHook(PRE_TEST)(struct criterion_test *test) {
|
||||
// using the parameter
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue