![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include "ctkCoreTestingUtilities.h"
Go to the source code of this file.
Macros | |
#define | CHECK_BOOL(actual, expected) |
Verifies if actual bool value is the same as expected. More... | |
#define | CHECK_EXIT_SUCCESS(actual) |
#define | CHECK_INT(actual, expected) |
Verifies if actual int value is the same as expected. More... | |
#define | CHECK_NOT_NULL(pointer) |
Verifies that pointer is not NULL. More... | |
#define | CHECK_NULL(pointer) |
Verifies that pointer is NULL. More... | |
#define | CHECK_POINTER(actual, expected) |
Verifies if actual pointer value is the same as expected. More... | |
#define | CHECK_POINTER_DIFFERENT(actual, expected) |
Verifies if actual pointer value is the same as expected. More... | |
#define | CHECK_QSTRING(actual, expected) |
#define | CHECK_QSTRING_DIFFERENT(actual, expected) |
#define | CHECK_QSTRINGLIST(actual, expected) |
Verifies if actual QStringList is the same as expected. More... | |
#define | CHECK_QVARIANT(actual, expected) |
Verifies if actual QVariant is the same as expected. More... | |
#define | CHECK_STD_STRING(actual, expected) |
#define | CHECK_STD_STRING_DIFFERENT(actual, expected) |
#define | CHECK_STRING(actual, expected) |
#define | CHECK_STRING_DIFFERENT(actual, expected) |
#define CHECK_BOOL | ( | actual, | |
expected | |||
) |
Verifies if actual bool value is the same as expected.
Definition at line 106 of file ctkCoreTestingMacros.h.
#define CHECK_EXIT_SUCCESS | ( | actual | ) |
Definition at line 70 of file ctkCoreTestingMacros.h.
#define CHECK_INT | ( | actual, | |
expected | |||
) |
Verifies if actual int value is the same as expected.
Definition at line 79 of file ctkCoreTestingMacros.h.
#define CHECK_NOT_NULL | ( | pointer | ) |
Verifies that pointer is not NULL.
Definition at line 62 of file ctkCoreTestingMacros.h.
#define CHECK_NULL | ( | pointer | ) |
Verifies that pointer is NULL.
Convenience macros for unit tests.
The macro returns from the current method with EXIT_FAILURE if the check fails. Expressions can be passed as arguments, they are guaranteed to be executed only once.
Example:
Definition at line 52 of file ctkCoreTestingMacros.h.
#define CHECK_POINTER | ( | actual, | |
expected | |||
) |
Verifies if actual pointer value is the same as expected.
Definition at line 88 of file ctkCoreTestingMacros.h.
#define CHECK_POINTER_DIFFERENT | ( | actual, | |
expected | |||
) |
Verifies if actual pointer value is the same as expected.
Definition at line 97 of file ctkCoreTestingMacros.h.
#define CHECK_QSTRING | ( | actual, | |
expected | |||
) |
Verifies if actual QString value is the same as expected. It is safe to use for comparing QString values. It cannot handle NULL pointer inputs.
Definition at line 140 of file ctkCoreTestingMacros.h.
#define CHECK_QSTRING_DIFFERENT | ( | actual, | |
expected | |||
) |
Verifies if actual QString value is not the same as expected. It is safe to use for comparing QString values. It cannot handle NULL pointer inputs.
Definition at line 176 of file ctkCoreTestingMacros.h.
#define CHECK_QSTRINGLIST | ( | actual, | |
expected | |||
) |
Verifies if actual QStringList is the same as expected.
Definition at line 187 of file ctkCoreTestingMacros.h.
#define CHECK_QVARIANT | ( | actual, | |
expected | |||
) |
Verifies if actual QVariant is the same as expected.
Definition at line 198 of file ctkCoreTestingMacros.h.
#define CHECK_STD_STRING | ( | actual, | |
expected | |||
) |
Verifies if actual std::string value is the same as expected. It is safe to use for comparing std::string values. It cannot handle NULL pointer inputs.
Definition at line 127 of file ctkCoreTestingMacros.h.
#define CHECK_STD_STRING_DIFFERENT | ( | actual, | |
expected | |||
) |
Verifies if actual std::string value is not the same as expected. It is safe to use for comparing std::string values. It cannot handle NULL pointer inputs.
Definition at line 163 of file ctkCoreTestingMacros.h.
#define CHECK_STRING | ( | actual, | |
expected | |||
) |
Verifies if actual const char* value is the same as expected. It can handle NULL pointer inputs.
Definition at line 116 of file ctkCoreTestingMacros.h.
#define CHECK_STRING_DIFFERENT | ( | actual, | |
expected | |||
) |
Verifies if actual const char* value is not the same as expected. It can handle NULL pointer inputs.
Definition at line 152 of file ctkCoreTestingMacros.h.