doc: Fixed wrong usage of parameterized test arrays

This commit is contained in:
Snaipe 2016-09-27 18:52:48 +02:00
parent 4e0ee1a319
commit 69a05ded6d
1 changed files with 6 additions and 2 deletions

View File

@ -39,6 +39,10 @@ identifier format.
``Type`` is the compound type of the generated array. ``params`` and ``nb_params``
are the pointer and the length of the generated array, respectively.
.. note::
The parameter array must be reachable after the function returns -- as
such, local arrays must be declared with `static` or dynamically allocated.
Passing multiple parameters
---------------------------
@ -57,7 +61,7 @@ easily use a struct to hold the context as a workaround:
};
ParameterizedTestParameters(suite_name, test_name) {
struct my_params params[] = {
static struct my_params params[] = {
// parameter set
};
@ -74,7 +78,7 @@ C++ users can also use a simpler syntax before returning an array of parameters:
.. code-block:: c++
ParameterizedTestParameters(suite_name, test_name) {
struct my_params params[] = {
static struct my_params params[] = {
// parameter set
};