Added array-to-criterion_test_param conversion constructor
This commit is contained in:
parent
f44eb1760e
commit
0b8680aac7
2 changed files with 10 additions and 1 deletions
|
@ -70,6 +70,15 @@ struct criterion_test_params {
|
|||
, length(vec.size())
|
||||
, cleanup(cleanup)
|
||||
{}
|
||||
|
||||
template <typename T, unsigned int N>
|
||||
constexpr criterion_test_params(T (&arr)[N],
|
||||
void (*cleanup)(criterion_test_params *) = nullptr)
|
||||
: size(sizeof (arr[0]))
|
||||
, params(static_cast<void*>(&arr))
|
||||
, length(N)
|
||||
, cleanup(cleanup)
|
||||
{}
|
||||
# endif
|
||||
};
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ ParameterizedTestParameters(params, multiple) {
|
|||
{5, 6},
|
||||
};
|
||||
|
||||
return cr_make_param_array(struct parameter_tuple, params, sizeof (params) / sizeof (struct parameter_tuple));
|
||||
return criterion_test_params(params);
|
||||
}
|
||||
|
||||
ParameterizedTest(struct parameter_tuple *tup, params, multiple) {
|
||||
|
|
Loading…
Add table
Reference in a new issue