Added doxygen for parameterized.h

This commit is contained in:
Snaipe 2015-12-08 00:34:38 +01:00
parent 93199a1651
commit c681d2a42e
2 changed files with 42 additions and 3 deletions

View file

@ -104,10 +104,10 @@ struct criterion_test_params {
static struct criterion_test_params CR_IDENTIFIER_(Category, Name, param)(void)
# ifdef __cplusplus
# define cr_make_param_array(Type, Array, ...) \
# define cr_make_param_array_(Type, Array, ...) \
criterion_test_params(sizeof (Type), (Array), __VA_ARGS__)
# else
# define cr_make_param_array(Type, Array, ...) \
# define cr_make_param_array_(Type, Array, ...) \
(struct criterion_test_params) { .size = sizeof (Type), (void*)(Array), __VA_ARGS__ }
# endif

View file

@ -28,9 +28,48 @@
# include "assert.h"
# include "internal/parameterized.h"
/**
* ParameterizedTest(Type *param, Suite, Name, [Options...]) { Function Body }
*
* Defines a new parameterized test.
*
* A parameterized test only takes one parameter -- to pass multiple parameters,
* use a structure type.
*
* @param Type The type of the parameter.
* @param Suite The name of the test suite containing this test.
* @param Name The name of the test.
* @param Options An optional sequence of designated initializer key/value
* pairs as described in the `criterion_test_extra_data` structure
* (see criterion/types.h).
* Example: .exit_code = 1
*/
# define ParameterizedTest(...) CR_EXPAND(CR_PARAM_TEST_BASE(__VA_ARGS__, .sentinel_ = 0))
# define ParameterizedTestParameters(Category, Name) CR_PARAM_TEST_PARAMS(Category, Name)
/**
* ParameterizedTestParameters(Suite, Test) { Function Body }
*
* Defines the parameter generator for the associated parameterized test.
*
* @param Suite The name of the test suite containing the test.
* @param Test The name of the test.
* @returns A constructed instance of criterion::parameters, or the result of
* the cr_make_param_array macro.
*/
# define ParameterizedTestParameters(Suite, Name) CR_PARAM_TEST_PARAMS(Suite, Name)
/**
* cr_make_param_array(Type, Array, Len, [Cleanup]);
*
* Constructs a parameter list used as a return value for a parameter generator.
*
* @param Type The type of the array subscript.
* @param Array The array of parameters.
* @param Len The length of the array.
* @param Cleanup The optional cleanup function for the array.
* @returns The parameter list.
*/
# define cr_make_param_array(...) CR_EXPAND(cr_make_param_array_(__VA_ARGS__))
# ifdef __cplusplus
# include <vector>