These macros can be used in test cases and stubs when the test case is registered with the CPPTEST_TEST_DS() macro.

MacroDefinition
const char* CPPTEST_DS_GET_CSTR(const char* NAME)Returns a null-terminated string value.
long long CPPTEST_DS_GET_INTEGER(const char* NAME)Returns an integer value.
unsigned long long
CPPTEST_DS_GET_UINTEGER(const char* NAME)
Returns an unsigned integer value.
long double CPPTEST_DS_GET_FLOAT(const char* NAME)Returns a floating point value.
int CPPTEST_DS_GET_BOOL(const char* NAME)Returns a boolean value.
const char*
CPPTEST_DS_GET_MEM_BUFFER(const char* NAME, unsigned int* SIZE_PTR)
Returns the memory buffer. If SIZE_PTR is not null, the size of the buffer will be stored there. For null-terminated strings, the ending null is counted.
CPPTEST_DS_GET_VALUE(SOURCE)Returns a value from SOURCE array. A variable of array type should be specified as the SOURCE parameter. The number of the row from which the values are extracted will be automatically increased after each subsequent test case execution.

unsigned int CPPTEST_DS_GET_ITERATION()

Can be used to determine the current iteration/row number. Returns the current iteration (row number).

int CPPTEST_DS_HAS_COLUMN(const char* NAME)Returns a non-zero value if column 'NAME' exists in the current iteration of the current data source. Can be used in stubs for test case specific behavior (see Using Data Sources in Stubs. Zero is returned if the data source is not used.
CPPTEST_DS_GET_ENUM(<scoped enum name>, <column name>)Extracts an enum value from a data source.
  • No labels