Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
Theory and datapoint macros

Macros

#define Theory(Params, Suite, Name, ...)   internal
 
#define TheoryDataPoints(Suite, Name)   CR_TH_INTERNAL_TDPS(Suite, Name)
 
#define DataPoints(Type, ...)   CR_EXPAND(CR_TH_INTERNAL_DP(Type, __VA_ARGS__))
 

Detailed Description

Macro Definition Documentation

◆ DataPoints

#define DataPoints ( Type,
... )   CR_EXPAND(CR_TH_INTERNAL_DP(Type, __VA_ARGS__))

Defines a new set of data points.

Parameters
TypeThe type of each data point in the set.
...The data points in the set.

Definition at line 98 of file theories.h.

◆ Theory

#define Theory ( Params,
Suite,
Name,
... )   internal

Defines a new theory test.

The parameters are selected from a cartesian product defined by a TheoryDataPoints macro.

Example:

Theory((int arg0, double arg1), suite, test) {
// function body
};
#define Theory(Args,...)
Parameters
ParamsA list of function parameters.
SuiteThe name of the test suite containing this test.
NameThe name of the test.
...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

Definition at line 69 of file theories.h.

◆ TheoryDataPoints

#define TheoryDataPoints ( Suite,
Name )   CR_TH_INTERNAL_TDPS(Suite, Name)

Defines an array of data points.

The types of the specified data points must match the types of the associated theory.

Each entry in the array must be the result of the DataPoints macro.

Example:

TheoryDataPoints(suite, test) = {
DataPoints(int, 1, 2, 3), // first theory parameter
DataPoints(double, 4.2, 0, -INFINITY), // second theory parameter
};
#define TheoryDataPoints(Suite, Name)
Definition theories.h:90
#define DataPoints(Type,...)
Definition theories.h:98
Parameters
SuiteThe name of the test suite containing this test.
NameThe name of the test.

Definition at line 90 of file theories.h.