21 #ifndef __ctkCoreTestingMacros_h
22 #define __ctkCoreTestingMacros_h
52 #define CHECK_NULL(pointer) \
54 const void* pointerValue = (pointer); \
55 if (!ctkCoreTestingUtilities::CheckNull(__LINE__,#pointer " is not NULL", pointerValue)) \
57 return EXIT_FAILURE; \
62 #define CHECK_NOT_NULL(pointer) \
64 if (!ctkCoreTestingUtilities::CheckNotNull(__LINE__,#pointer " is NULL", (pointer))) \
66 return EXIT_FAILURE; \
70 #define CHECK_EXIT_SUCCESS(actual) \
72 if (!ctkCoreTestingUtilities::CheckInt(__LINE__,#actual " != EXIT_SUCCESS", (actual), EXIT_SUCCESS)) \
74 return EXIT_FAILURE; \
79 #define CHECK_INT(actual, expected) \
81 if (!ctkCoreTestingUtilities::CheckInt(__LINE__,#actual " != " #expected, (actual), (expected))) \
83 return EXIT_FAILURE; \
88 #define CHECK_POINTER(actual, expected) \
90 if (!ctkCoreTestingUtilities::CheckPointer(__LINE__,#actual " != " #expected, (actual), (expected))) \
92 return EXIT_FAILURE; \
97 #define CHECK_POINTER_DIFFERENT(actual, expected) \
99 if (!ctkCoreTestingUtilities::CheckPointer(__LINE__,#actual " == " #expected, (actual), (expected), false)) \
101 return EXIT_FAILURE; \
106 #define CHECK_BOOL(actual, expected) \
108 if (!ctkCoreTestingUtilities::CheckInt(__LINE__,#actual " != " #expected, (actual)?1:0, (expected)?1:0)) \
110 return EXIT_FAILURE; \
116 #define CHECK_STRING(actual, expected) \
118 if (!ctkCoreTestingUtilities::CheckString(__LINE__,#actual " != " #expected, (actual), (expected))) \
120 return EXIT_FAILURE; \
127 #define CHECK_STD_STRING(actual, expected) \
129 std::string a = (actual); \
130 std::string e = (expected); \
131 if (!ctkCoreTestingUtilities::CheckString(__LINE__,#actual " != " #expected, a.c_str(), e.c_str())) \
133 return EXIT_FAILURE; \
140 #define CHECK_QSTRING(actual, expected) \
142 QString a = (actual); \
143 QString e = (expected); \
144 if (!ctkCoreTestingUtilities::CheckString(__LINE__,#actual " != " #expected, qPrintable(a), qPrintable(e))) \
146 return EXIT_FAILURE; \
152 #define CHECK_STRING_DIFFERENT(actual, expected) \
154 if (!ctkCoreTestingUtilities::CheckString(__LINE__,#actual " != " #expected, (actual), (expected), false)) \
156 return EXIT_FAILURE; \
163 #define CHECK_STD_STRING_DIFFERENT(actual, expected) \
165 std::string a = (actual); \
166 std::string e = (expected); \
167 if (!ctkCoreTestingUtilities::CheckString(__LINE__,#actual " != " #expected, a.c_str(), e.c_str(), false)) \
169 return EXIT_FAILURE; \
176 #define CHECK_QSTRING_DIFFERENT(actual, expected) \
178 QString a = (actual); \
179 QString e = (expected); \
180 if (!ctkCoreTestingUtilities::CheckString(__LINE__,#actual " != " #expected, qPrintable(a), qPrintable(e), false)) \
182 return EXIT_FAILURE; \
187 #define CHECK_QSTRINGLIST(actual, expected) \
189 QStringList a = (actual); \
190 QStringList e = (expected); \
191 if (!ctkCoreTestingUtilities::CheckStringList(__LINE__,#actual " != " #expected, a, e)) \
193 return EXIT_FAILURE; \
198 #define CHECK_QVARIANT(actual, expected) \
200 QVariant a = (actual); \
201 QVariant e = (expected); \
202 if (!ctkCoreTestingUtilities::CheckVariant(__LINE__,#actual " != " #expected, a, e)) \
204 return EXIT_FAILURE; \