Unit Test Framework C and Traditional C++ API Reference
test_assert_types.h
1/*
2 * (c) Copyright, Real-Time Innovations, 2002-2024.
3 * All rights reserved.
4 * No duplications, whole or partial, manual or electronic, may be made
5 * without express written permission. Any such copies, or
6 * revisions thereof, must display this notice unaltered.
7 * This code contains trade secrets of Real-Time Innovations, Inc.
8 */
9
10/*
11 * This file was partly generated using resource.3.0/python/rti-generate-assert-macros.py.
12 * See the script for more information.
13 */
14
15#ifndef rtitest_assert_impl_h
16#define rtitest_assert_impl_h
17
18#define RTITest_assertComparisonForTypeWithAction( \
19 expected__, \
20 actual__, \
21 type__, \
22 formatSpecifier__, \
23 operation__, \
24 failAction__) \
25 { \
26 type__ expectedTmp__ = (type__) (expected__); \
27 type__ actualTmp__ = (type__) (actual__); \
28 RTITest_debugAssert((actualTmp__) operation__ (expectedTmp__)); \
29 if (!((actualTmp__) operation__(expectedTmp__))) { \
30 char buffer__[255]; \
31 if (RTITestLog_snprintf( \
32 buffer__, \
33 sizeof(buffer__), \
34 ": expected " #formatSpecifier__ \
35 ", got " #formatSpecifier__, \
36 expectedTmp__, \
37 actualTmp__) \
38 > 0) { \
39 RTITest_assertLog( \
40 &RTI_TEST_LOG_EMPTY_TEMPLATE, \
41 "[%s:%d] assertion failed: %s%s", \
42 __FILE__, \
43 __LINE__, \
44 #actual__ " " #operation__ " " #expected__, \
45 buffer__); \
46 } \
47 failAction__; \
48 } \
49 }
50
51#define RTITest_assertComparisonForType( \
52 expected__, \
53 actual__, \
54 type__, \
55 formatSpecifier__, \
56 operation__) \
57 { \
58 RTITest_assertComparisonForTypeWithAction( \
59 expected__, \
60 actual__, \
61 type__, \
62 formatSpecifier__, \
63 operation__, \
64 goto done); \
65 }
66
67
68#define RTITest_assertComparisonForFloatingPointTypeWithAction( \
69 expected__, \
70 actual__, \
71 type__, \
72 operation__, \
73 epsilon__, \
74 failAction__) \
75 { \
76 type__ expectedTmp__ = (expected__); \
77 type__ actualTmp__ = (actual__); \
78 type__ diff__ = expectedTmp__ - actualTmp__; \
79 /* After the macro is expanded we are actually comparing a string with */ \
80 /* itself, so we need to avoid the Coverity defect adding this variable */ \
81 const char *operationString__ = #operation__; \
82 RTIBool assertResult__; \
83 if (diff__ < 0) { \
84 diff__ = -diff__; \
85 } \
86 if (strcmp(operationString__, "==") == 0) { \
87 assertResult__ = diff__ <= epsilon__; \
88 } else if (strcmp(operationString__, "!=") == 0) { \
89 assertResult__ = diff__ > epsilon__; \
90 } else if (strcmp(operationString__, "<") == 0) { \
91 assertResult__ = actualTmp__ < expectedTmp__ && diff__ > epsilon__; \
92 } else if (strcmp(operationString__, "<=") == 0) { \
93 assertResult__ = actualTmp__ < expectedTmp__ || diff__ <= epsilon__; \
94 } else if (strcmp(operationString__, ">") == 0) { \
95 assertResult__ = actualTmp__ > expectedTmp__ && diff__ > epsilon__; \
96 } else if (strcmp(operationString__, ">=") == 0) { \
97 assertResult__ = actualTmp__ > expectedTmp__ || diff__ <= epsilon__; \
98 } else { \
99 assertResult__ = RTI_FALSE; \
100 } \
101 RTITest_debugAssert(assertResult__); \
102 if (!(assertResult__)) { \
103 char buffer__[255]; \
104 /* We use double regardless of the type of the floating point */ \
105 /* variables since float doesn't work properly with %f specifier */ \
106 /* according to Coverity */ \
107 if (RTITestLog_snprintf( \
108 buffer__, \
109 sizeof(buffer__), \
110 ": expected %.5g, got %.5g", \
111 (double) expectedTmp__, \
112 (double) actualTmp__) \
113 > 0) { \
114 RTITest_assertLog( \
115 &RTI_TEST_LOG_EMPTY_TEMPLATE, \
116 "[%s:%d] assertion failed: %s%s", \
117 __FILE__, \
118 __LINE__, \
119 #actual__ " " #operation__ " " #expected__, \
120 buffer__); \
121 } \
122 failAction__; \
123 } \
124 } \
125 (void) 0
126
127#define RTITest_assertComparisonForFloatingPointType( \
128 expected__, \
129 actual__, \
130 type__, \
131 operation__, \
132 epsilon__) \
133 { \
134 RTITest_assertComparisonForFloatingPointTypeWithAction( \
135 expected__, \
136 actual__, \
137 type__, \
138 operation__, \
139 epsilon__, \
140 goto done); \
141 }
149#define RTITest_assertEqualsInt(expected__, actual__) \
150 RTITest_assertComparisonForType( \
151 expected__, \
152 actual__, \
153 int, \
154 "%d", \
155 ==);
156
165#define RTITest_assertEqualsIntWithAction(expected__, actual__, failAction__) \
166 RTITest_assertComparisonForTypeWithAction( \
167 expected__, \
168 actual__, \
169 int, \
170 "%d", \
171 ==, \
172 failAction__);
173
182#define RTITest_assertEqualsIntAfterDone(expected__, actual__) \
183 RTITest_assertEqualsIntWithAction( \
184 expected__, \
185 actual__, \
186 result = RTI_TEST_RETCODE_FAILED)
187
195#define RTITest_assertNotEqualsInt(expected__, actual__) \
196 RTITest_assertComparisonForType( \
197 expected__, \
198 actual__, \
199 int, \
200 "%d", \
201 !=);
202
211#define RTITest_assertNotEqualsIntWithAction(expected__, actual__, failAction__) \
212 RTITest_assertComparisonForTypeWithAction( \
213 expected__, \
214 actual__, \
215 int, \
216 "%d", \
217 !=, \
218 failAction__);
219
227#define RTITest_assertLessThanInt(expected__, actual__) \
228 RTITest_assertComparisonForType( \
229 expected__, \
230 actual__, \
231 int, \
232 "%d", \
233 <);
234
243#define RTITest_assertLessThanIntWithAction(expected__, actual__, failAction__) \
244 RTITest_assertComparisonForTypeWithAction( \
245 expected__, \
246 actual__, \
247 int, \
248 "%d", \
249 <, \
250 failAction__);
251
259#define RTITest_assertLessOrEqualsInt(expected__, actual__) \
260 RTITest_assertComparisonForType( \
261 expected__, \
262 actual__, \
263 int, \
264 "%d", \
265 <=);
266
275#define RTITest_assertLessOrEqualsIntWithAction(expected__, actual__, failAction__) \
276 RTITest_assertComparisonForTypeWithAction( \
277 expected__, \
278 actual__, \
279 int, \
280 "%d", \
281 <=, \
282 failAction__);
283
291#define RTITest_assertGreaterThanInt(expected__, actual__) \
292 RTITest_assertComparisonForType( \
293 expected__, \
294 actual__, \
295 int, \
296 "%d", \
297 >);
298
307#define RTITest_assertGreaterThanIntWithAction(expected__, actual__, failAction__) \
308 RTITest_assertComparisonForTypeWithAction( \
309 expected__, \
310 actual__, \
311 int, \
312 "%d", \
313 >, \
314 failAction__);
315
323#define RTITest_assertGreaterOrEqualsInt(expected__, actual__) \
324 RTITest_assertComparisonForType( \
325 expected__, \
326 actual__, \
327 int, \
328 "%d", \
329 >=);
330
339#define RTITest_assertGreaterOrEqualsIntWithAction(expected__, actual__, failAction__) \
340 RTITest_assertComparisonForTypeWithAction( \
341 expected__, \
342 actual__, \
343 int, \
344 "%d", \
345 >=, \
346 failAction__);
347
355#define RTITest_assertEqualsUnsignedInt(expected__, actual__) \
356 RTITest_assertComparisonForType( \
357 expected__, \
358 actual__, \
359 unsigned int, \
360 "%u", \
361 ==);
362
371#define RTITest_assertEqualsUnsignedIntWithAction(expected__, actual__, failAction__) \
372 RTITest_assertComparisonForTypeWithAction( \
373 expected__, \
374 actual__, \
375 unsigned int, \
376 "%u", \
377 ==, \
378 failAction__);
379
387#define RTITest_assertNotEqualsUnsignedInt(expected__, actual__) \
388 RTITest_assertComparisonForType( \
389 expected__, \
390 actual__, \
391 unsigned int, \
392 "%u", \
393 !=);
394
403#define RTITest_assertNotEqualsUnsignedIntWithAction(expected__, actual__, failAction__) \
404 RTITest_assertComparisonForTypeWithAction( \
405 expected__, \
406 actual__, \
407 unsigned int, \
408 "%u", \
409 !=, \
410 failAction__);
411
419#define RTITest_assertLessThanUnsignedInt(expected__, actual__) \
420 RTITest_assertComparisonForType( \
421 expected__, \
422 actual__, \
423 unsigned int, \
424 "%u", \
425 <);
426
435#define RTITest_assertLessThanUnsignedIntWithAction(expected__, actual__, failAction__) \
436 RTITest_assertComparisonForTypeWithAction( \
437 expected__, \
438 actual__, \
439 unsigned int, \
440 "%u", \
441 <, \
442 failAction__);
443
451#define RTITest_assertLessOrEqualsUnsignedInt(expected__, actual__) \
452 RTITest_assertComparisonForType( \
453 expected__, \
454 actual__, \
455 unsigned int, \
456 "%u", \
457 <=);
458
467#define RTITest_assertLessOrEqualsUnsignedIntWithAction(expected__, actual__, failAction__) \
468 RTITest_assertComparisonForTypeWithAction( \
469 expected__, \
470 actual__, \
471 unsigned int, \
472 "%u", \
473 <=, \
474 failAction__);
475
483#define RTITest_assertGreaterThanUnsignedInt(expected__, actual__) \
484 RTITest_assertComparisonForType( \
485 expected__, \
486 actual__, \
487 unsigned int, \
488 "%u", \
489 >);
490
499#define RTITest_assertGreaterThanUnsignedIntWithAction(expected__, actual__, failAction__) \
500 RTITest_assertComparisonForTypeWithAction( \
501 expected__, \
502 actual__, \
503 unsigned int, \
504 "%u", \
505 >, \
506 failAction__);
507
515#define RTITest_assertGreaterOrEqualsUnsignedInt(expected__, actual__) \
516 RTITest_assertComparisonForType( \
517 expected__, \
518 actual__, \
519 unsigned int, \
520 "%u", \
521 >=);
522
531#define RTITest_assertGreaterOrEqualsUnsignedIntWithAction(expected__, actual__, failAction__) \
532 RTITest_assertComparisonForTypeWithAction( \
533 expected__, \
534 actual__, \
535 unsigned int, \
536 "%u", \
537 >=, \
538 failAction__);
539
547#define RTITest_assertEqualsSignedChar(expected__, actual__) \
548 RTITest_assertComparisonForType( \
549 expected__, \
550 actual__, \
551 signed char, \
552 "%c", \
553 ==);
554
563#define RTITest_assertEqualsSignedCharWithAction(expected__, actual__, failAction__) \
564 RTITest_assertComparisonForTypeWithAction( \
565 expected__, \
566 actual__, \
567 signed char, \
568 "%c", \
569 ==, \
570 failAction__);
571
579#define RTITest_assertNotEqualsSignedChar(expected__, actual__) \
580 RTITest_assertComparisonForType( \
581 expected__, \
582 actual__, \
583 signed char, \
584 "%c", \
585 !=);
586
595#define RTITest_assertNotEqualsSignedCharWithAction(expected__, actual__, failAction__) \
596 RTITest_assertComparisonForTypeWithAction( \
597 expected__, \
598 actual__, \
599 signed char, \
600 "%c", \
601 !=, \
602 failAction__);
603
611#define RTITest_assertLessThanSignedChar(expected__, actual__) \
612 RTITest_assertComparisonForType( \
613 expected__, \
614 actual__, \
615 signed char, \
616 "%c", \
617 <);
618
627#define RTITest_assertLessThanSignedCharWithAction(expected__, actual__, failAction__) \
628 RTITest_assertComparisonForTypeWithAction( \
629 expected__, \
630 actual__, \
631 signed char, \
632 "%c", \
633 <, \
634 failAction__);
635
643#define RTITest_assertLessOrEqualsSignedChar(expected__, actual__) \
644 RTITest_assertComparisonForType( \
645 expected__, \
646 actual__, \
647 signed char, \
648 "%c", \
649 <=);
650
659#define RTITest_assertLessOrEqualsSignedCharWithAction(expected__, actual__, failAction__) \
660 RTITest_assertComparisonForTypeWithAction( \
661 expected__, \
662 actual__, \
663 signed char, \
664 "%c", \
665 <=, \
666 failAction__);
667
675#define RTITest_assertGreaterThanSignedChar(expected__, actual__) \
676 RTITest_assertComparisonForType( \
677 expected__, \
678 actual__, \
679 signed char, \
680 "%c", \
681 >);
682
691#define RTITest_assertGreaterThanSignedCharWithAction(expected__, actual__, failAction__) \
692 RTITest_assertComparisonForTypeWithAction( \
693 expected__, \
694 actual__, \
695 signed char, \
696 "%c", \
697 >, \
698 failAction__);
699
707#define RTITest_assertGreaterOrEqualsSignedChar(expected__, actual__) \
708 RTITest_assertComparisonForType( \
709 expected__, \
710 actual__, \
711 signed char, \
712 "%c", \
713 >=);
714
723#define RTITest_assertGreaterOrEqualsSignedCharWithAction(expected__, actual__, failAction__) \
724 RTITest_assertComparisonForTypeWithAction( \
725 expected__, \
726 actual__, \
727 signed char, \
728 "%c", \
729 >=, \
730 failAction__);
731
745#define RTITest_assertEqualsChar(expected__, actual__) \
746 RTITest_assertComparisonForType( \
747 (unsigned char) (expected__), \
748 (unsigned char) (actual__), \
749 int, \
750 "%c", \
751 ==);
752
767#define RTITest_assertEqualsCharWithAction(expected__, actual__, failAction__) \
768 RTITest_assertComparisonForTypeWithAction( \
769 (unsigned char) (expected__), \
770 (unsigned char) (actual__), \
771 int, \
772 "%c", \
773 ==, \
774 failAction__);
775
789#define RTITest_assertNotEqualsChar(expected__, actual__) \
790 RTITest_assertComparisonForType( \
791 (unsigned char) (expected__), \
792 (unsigned char) (actual__), \
793 int, \
794 "%c", \
795 !=);
796
811#define RTITest_assertNotEqualsCharWithAction(expected__, actual__, failAction__) \
812 RTITest_assertComparisonForTypeWithAction( \
813 (unsigned char) (expected__), \
814 (unsigned char) (actual__), \
815 int, \
816 "%c", \
817 !=, \
818 failAction__);
819
833#define RTITest_assertLessThanChar(expected__, actual__) \
834 RTITest_assertComparisonForType( \
835 (unsigned char) (expected__), \
836 (unsigned char) (actual__), \
837 int, \
838 "%c", \
839 <);
840
855#define RTITest_assertLessThanCharWithAction(expected__, actual__, failAction__) \
856 RTITest_assertComparisonForTypeWithAction( \
857 (unsigned int) (expected__), \
858 (unsigned int) (actual__), \
859 int, \
860 "%c", \
861 <, \
862 failAction__);
863
877#define RTITest_assertLessOrEqualsChar(expected__, actual__) \
878 RTITest_assertComparisonForType( \
879 (unsigned char) (expected__), \
880 (unsigned char) (actual__), \
881 int, \
882 "%c", \
883 <=);
884
899#define RTITest_assertLessOrEqualsCharWithAction(expected__, actual__, failAction__) \
900 RTITest_assertComparisonForTypeWithAction( \
901 (unsigned char) (expected__), \
902 (unsigned char) (actual__), \
903 int, \
904 "%c", \
905 <=, \
906 failAction__);
907
921#define RTITest_assertGreaterThanChar(expected__, actual__) \
922 RTITest_assertComparisonForType( \
923 (unsigned char) (expected__), \
924 (unsigned char) (actual__), \
925 int, \
926 "%c", \
927 >);
928
943#define RTITest_assertGreaterThanCharWithAction(expected__, actual__, failAction__) \
944 RTITest_assertComparisonForTypeWithAction( \
945 (unsigned char) (expected__), \
946 (unsigned char) (actual__), \
947 int, \
948 "%c", \
949 >, \
950 failAction__);
951
965#define RTITest_assertGreaterOrEqualsChar(expected__, actual__) \
966 RTITest_assertComparisonForType( \
967 (unsigned int) (expected__), \
968 (unsigned int) (actual__), \
969 int, \
970 "%c", \
971 >=);
972
987#define RTITest_assertGreaterOrEqualsCharWithAction(expected__, actual__, failAction__) \
988 RTITest_assertComparisonForTypeWithAction( \
989 (unsigned int) (expected__), \
990 (unsigned int) (actual__), \
991 int, \
992 "%c", \
993 >=, \
994 failAction__);
995
1003#define RTITest_assertEqualsShort(expected__, actual__) \
1004 RTITest_assertComparisonForType( \
1005 expected__, \
1006 actual__, \
1007 short, \
1008 "%hhd", \
1009 ==);
1010
1019#define RTITest_assertEqualsShortWithAction(expected__, actual__, failAction__) \
1020 RTITest_assertComparisonForTypeWithAction( \
1021 expected__, \
1022 actual__, \
1023 short, \
1024 "%hhd", \
1025 ==, \
1026 failAction__);
1027
1035#define RTITest_assertNotEqualsShort(expected__, actual__) \
1036 RTITest_assertComparisonForType( \
1037 expected__, \
1038 actual__, \
1039 short, \
1040 "%hhd", \
1041 !=);
1042
1051#define RTITest_assertNotEqualsShortWithAction(expected__, actual__, failAction__) \
1052 RTITest_assertComparisonForTypeWithAction( \
1053 expected__, \
1054 actual__, \
1055 short, \
1056 "%hhd", \
1057 !=, \
1058 failAction__);
1059
1067#define RTITest_assertLessThanShort(expected__, actual__) \
1068 RTITest_assertComparisonForType( \
1069 expected__, \
1070 actual__, \
1071 short, \
1072 "%hhd", \
1073 <);
1074
1083#define RTITest_assertLessThanShortWithAction(expected__, actual__, failAction__) \
1084 RTITest_assertComparisonForTypeWithAction( \
1085 expected__, \
1086 actual__, \
1087 short, \
1088 "%hhd", \
1089 <, \
1090 failAction__);
1091
1099#define RTITest_assertLessOrEqualsShort(expected__, actual__) \
1100 RTITest_assertComparisonForType( \
1101 expected__, \
1102 actual__, \
1103 short, \
1104 "%hhd", \
1105 <=);
1106
1115#define RTITest_assertLessOrEqualsShortWithAction(expected__, actual__, failAction__) \
1116 RTITest_assertComparisonForTypeWithAction( \
1117 expected__, \
1118 actual__, \
1119 short, \
1120 "%hhd", \
1121 <=, \
1122 failAction__);
1123
1131#define RTITest_assertGreaterThanShort(expected__, actual__) \
1132 RTITest_assertComparisonForType( \
1133 expected__, \
1134 actual__, \
1135 short, \
1136 "%hhd", \
1137 >);
1138
1147#define RTITest_assertGreaterThanShortWithAction(expected__, actual__, failAction__) \
1148 RTITest_assertComparisonForTypeWithAction( \
1149 expected__, \
1150 actual__, \
1151 short, \
1152 "%hhd", \
1153 >, \
1154 failAction__);
1155
1163#define RTITest_assertGreaterOrEqualsShort(expected__, actual__) \
1164 RTITest_assertComparisonForType( \
1165 expected__, \
1166 actual__, \
1167 short, \
1168 "%hhd", \
1169 >=);
1170
1179#define RTITest_assertGreaterOrEqualsShortWithAction(expected__, actual__, failAction__) \
1180 RTITest_assertComparisonForTypeWithAction( \
1181 expected__, \
1182 actual__, \
1183 short, \
1184 "%hhd", \
1185 >=, \
1186 failAction__);
1187
1195#define RTITest_assertEqualsUnsignedShort(expected__, actual__) \
1196 RTITest_assertComparisonForType( \
1197 expected__, \
1198 actual__, \
1199 unsigned short, \
1200 "%hhu", \
1201 ==);
1202
1211#define RTITest_assertEqualsUnsignedShortWithAction(expected__, actual__, failAction__) \
1212 RTITest_assertComparisonForTypeWithAction( \
1213 expected__, \
1214 actual__, \
1215 unsigned short, \
1216 "%hhu", \
1217 ==, \
1218 failAction__);
1219
1227#define RTITest_assertNotEqualsUnsignedShort(expected__, actual__) \
1228 RTITest_assertComparisonForType( \
1229 expected__, \
1230 actual__, \
1231 unsigned short, \
1232 "%hhu", \
1233 !=);
1234
1243#define RTITest_assertNotEqualsUnsignedShortWithAction(expected__, actual__, failAction__) \
1244 RTITest_assertComparisonForTypeWithAction( \
1245 expected__, \
1246 actual__, \
1247 unsigned short, \
1248 "%hhu", \
1249 !=, \
1250 failAction__);
1251
1259#define RTITest_assertLessThanUnsignedShort(expected__, actual__) \
1260 RTITest_assertComparisonForType( \
1261 expected__, \
1262 actual__, \
1263 unsigned short, \
1264 "%hhu", \
1265 <);
1266
1275#define RTITest_assertLessThanUnsignedShortWithAction(expected__, actual__, failAction__) \
1276 RTITest_assertComparisonForTypeWithAction( \
1277 expected__, \
1278 actual__, \
1279 unsigned short, \
1280 "%hhu", \
1281 <, \
1282 failAction__);
1283
1291#define RTITest_assertLessOrEqualsUnsignedShort(expected__, actual__) \
1292 RTITest_assertComparisonForType( \
1293 expected__, \
1294 actual__, \
1295 unsigned short, \
1296 "%hhu", \
1297 <=);
1298
1307#define RTITest_assertLessOrEqualsUnsignedShortWithAction(expected__, actual__, failAction__) \
1308 RTITest_assertComparisonForTypeWithAction( \
1309 expected__, \
1310 actual__, \
1311 unsigned short, \
1312 "%hhu", \
1313 <=, \
1314 failAction__);
1315
1323#define RTITest_assertGreaterThanUnsignedShort(expected__, actual__) \
1324 RTITest_assertComparisonForType( \
1325 expected__, \
1326 actual__, \
1327 unsigned short, \
1328 "%hhu", \
1329 >);
1330
1339#define RTITest_assertGreaterThanUnsignedShortWithAction(expected__, actual__, failAction__) \
1340 RTITest_assertComparisonForTypeWithAction( \
1341 expected__, \
1342 actual__, \
1343 unsigned short, \
1344 "%hhu", \
1345 >, \
1346 failAction__);
1347
1355#define RTITest_assertGreaterOrEqualsUnsignedShort(expected__, actual__) \
1356 RTITest_assertComparisonForType( \
1357 expected__, \
1358 actual__, \
1359 unsigned short, \
1360 "%hhu", \
1361 >=);
1362
1371#define RTITest_assertGreaterOrEqualsUnsignedShortWithAction(expected__, actual__, failAction__) \
1372 RTITest_assertComparisonForTypeWithAction( \
1373 expected__, \
1374 actual__, \
1375 unsigned short, \
1376 "%hhu", \
1377 >=, \
1378 failAction__);
1379
1388#define RTITest_assertEqualsLongWithAction(expected__, actual__, failAction__) \
1389 RTITest_assertComparisonForTypeWithAction( \
1390 expected__, \
1391 actual__, \
1392 long, \
1393 "%ld", \
1394 ==, \
1395 failAction__);
1396
1404#define RTITest_assertNotEqualsLong(expected__, actual__) \
1405 RTITest_assertComparisonForType( \
1406 expected__, \
1407 actual__, \
1408 long, \
1409 "%ld", \
1410 !=);
1411
1420#define RTITest_assertNotEqualsLongWithAction(expected__, actual__, failAction__) \
1421 RTITest_assertComparisonForTypeWithAction( \
1422 expected__, \
1423 actual__, \
1424 long, \
1425 "%ld", \
1426 !=, \
1427 failAction__);
1428
1436#define RTITest_assertLessThanLong(expected__, actual__) \
1437 RTITest_assertComparisonForType( \
1438 expected__, \
1439 actual__, \
1440 long, \
1441 "%ld", \
1442 <);
1443
1452#define RTITest_assertLessThanLongWithAction(expected__, actual__, failAction__) \
1453 RTITest_assertComparisonForTypeWithAction( \
1454 expected__, \
1455 actual__, \
1456 long, \
1457 "%ld", \
1458 <, \
1459 failAction__);
1460
1468#define RTITest_assertLessOrEqualsLong(expected__, actual__) \
1469 RTITest_assertComparisonForType( \
1470 expected__, \
1471 actual__, \
1472 long, \
1473 "%ld", \
1474 <=);
1475
1484#define RTITest_assertLessOrEqualsLongWithAction(expected__, actual__, failAction__) \
1485 RTITest_assertComparisonForTypeWithAction( \
1486 expected__, \
1487 actual__, \
1488 long, \
1489 "%ld", \
1490 <=, \
1491 failAction__);
1492
1500#define RTITest_assertGreaterThanLong(expected__, actual__) \
1501 RTITest_assertComparisonForType( \
1502 expected__, \
1503 actual__, \
1504 long, \
1505 "%ld", \
1506 >);
1507
1516#define RTITest_assertGreaterThanLongWithAction(expected__, actual__, failAction__) \
1517 RTITest_assertComparisonForTypeWithAction( \
1518 expected__, \
1519 actual__, \
1520 long, \
1521 "%ld", \
1522 >, \
1523 failAction__);
1524
1532#define RTITest_assertGreaterOrEqualsLong(expected__, actual__) \
1533 RTITest_assertComparisonForType( \
1534 expected__, \
1535 actual__, \
1536 long, \
1537 "%ld", \
1538 >=);
1539
1548#define RTITest_assertGreaterOrEqualsLongWithAction(expected__, actual__, failAction__) \
1549 RTITest_assertComparisonForTypeWithAction( \
1550 expected__, \
1551 actual__, \
1552 long, \
1553 "%ld", \
1554 >=, \
1555 failAction__);
1556
1564#define RTITest_assertEqualsUnsignedLong(expected__, actual__) \
1565 RTITest_assertComparisonForType( \
1566 expected__, \
1567 actual__, \
1568 long, \
1569 "%lu", \
1570 ==);
1571
1580#define RTITest_assertEqualsUnsignedLongWithAction(expected__, actual__, failAction__) \
1581 RTITest_assertComparisonForTypeWithAction( \
1582 expected__, \
1583 actual__, \
1584 long, \
1585 "%lu", \
1586 ==, \
1587 failAction__);
1588
1596#define RTITest_assertNotEqualsUnsignedLong(expected__, actual__) \
1597 RTITest_assertComparisonForType( \
1598 expected__, \
1599 actual__, \
1600 long, \
1601 "%lu", \
1602 !=);
1603
1612#define RTITest_assertNotEqualsUnsignedLongWithAction(expected__, actual__, failAction__) \
1613 RTITest_assertComparisonForTypeWithAction( \
1614 expected__, \
1615 actual__, \
1616 long, \
1617 "%lu", \
1618 !=, \
1619 failAction__);
1620
1628#define RTITest_assertLessThanUnsignedLong(expected__, actual__) \
1629 RTITest_assertComparisonForType( \
1630 expected__, \
1631 actual__, \
1632 long, \
1633 "%lu", \
1634 <);
1635
1644#define RTITest_assertLessThanUnsignedLongWithAction(expected__, actual__, failAction__) \
1645 RTITest_assertComparisonForTypeWithAction( \
1646 expected__, \
1647 actual__, \
1648 long, \
1649 "%lu", \
1650 <, \
1651 failAction__);
1652
1660#define RTITest_assertLessOrEqualsUnsignedLong(expected__, actual__) \
1661 RTITest_assertComparisonForType( \
1662 expected__, \
1663 actual__, \
1664 long, \
1665 "%lu", \
1666 <=);
1667
1676#define RTITest_assertLessOrEqualsUnsignedLongWithAction(expected__, actual__, failAction__) \
1677 RTITest_assertComparisonForTypeWithAction( \
1678 expected__, \
1679 actual__, \
1680 long, \
1681 "%lu", \
1682 <=, \
1683 failAction__);
1684
1692#define RTITest_assertGreaterThanUnsignedLong(expected__, actual__) \
1693 RTITest_assertComparisonForType( \
1694 expected__, \
1695 actual__, \
1696 long, \
1697 "%lu", \
1698 >);
1699
1708#define RTITest_assertGreaterThanUnsignedLongWithAction(expected__, actual__, failAction__) \
1709 RTITest_assertComparisonForTypeWithAction( \
1710 expected__, \
1711 actual__, \
1712 long, \
1713 "%lu", \
1714 >, \
1715 failAction__);
1716
1724#define RTITest_assertGreaterOrEqualsUnsignedLong(expected__, actual__) \
1725 RTITest_assertComparisonForType( \
1726 expected__, \
1727 actual__, \
1728 long, \
1729 "%lu", \
1730 >=);
1731
1740#define RTITest_assertGreaterOrEqualsUnsignedLongWithAction(expected__, actual__, failAction__) \
1741 RTITest_assertComparisonForTypeWithAction( \
1742 expected__, \
1743 actual__, \
1744 long, \
1745 "%lu", \
1746 >=, \
1747 failAction__);
1748
1756#define RTITest_assertEqualsLongLong(expected__, actual__) \
1757 RTITest_assertComparisonForType( \
1758 expected__, \
1759 actual__, \
1760 long long, \
1761 "%lld", \
1762 ==);
1763
1772#define RTITest_assertEqualsLongLongWithAction(expected__, actual__, failAction__) \
1773 RTITest_assertComparisonForTypeWithAction( \
1774 expected__, \
1775 actual__, \
1776 long long, \
1777 "%lld", \
1778 ==, \
1779 failAction__);
1780
1788#define RTITest_assertNotEqualsLongLong(expected__, actual__) \
1789 RTITest_assertComparisonForType( \
1790 expected__, \
1791 actual__, \
1792 long long, \
1793 "%lld", \
1794 !=);
1795
1804#define RTITest_assertNotEqualsLongLongWithAction(expected__, actual__, failAction__) \
1805 RTITest_assertComparisonForTypeWithAction( \
1806 expected__, \
1807 actual__, \
1808 long long, \
1809 "%lld", \
1810 !=, \
1811 failAction__);
1812
1820#define RTITest_assertLessThanLongLong(expected__, actual__) \
1821 RTITest_assertComparisonForType( \
1822 expected__, \
1823 actual__, \
1824 long long, \
1825 "%lld", \
1826 <);
1827
1836#define RTITest_assertLessThanLongLongWithAction(expected__, actual__, failAction__) \
1837 RTITest_assertComparisonForTypeWithAction( \
1838 expected__, \
1839 actual__, \
1840 long long, \
1841 "%lld", \
1842 <, \
1843 failAction__);
1844
1852#define RTITest_assertLessOrEqualsLongLong(expected__, actual__) \
1853 RTITest_assertComparisonForType( \
1854 expected__, \
1855 actual__, \
1856 long long, \
1857 "%lld", \
1858 <=);
1859
1868#define RTITest_assertLessOrEqualsLongLongWithAction(expected__, actual__, failAction__) \
1869 RTITest_assertComparisonForTypeWithAction( \
1870 expected__, \
1871 actual__, \
1872 long long, \
1873 "%lld", \
1874 <=, \
1875 failAction__);
1876
1884#define RTITest_assertGreaterThanLongLong(expected__, actual__) \
1885 RTITest_assertComparisonForType( \
1886 expected__, \
1887 actual__, \
1888 long long, \
1889 "%lld", \
1890 >);
1891
1900#define RTITest_assertGreaterThanLongLongWithAction(expected__, actual__, failAction__) \
1901 RTITest_assertComparisonForTypeWithAction( \
1902 expected__, \
1903 actual__, \
1904 long long, \
1905 "%lld", \
1906 >, \
1907 failAction__);
1908
1916#define RTITest_assertGreaterOrEqualsLongLong(expected__, actual__) \
1917 RTITest_assertComparisonForType( \
1918 expected__, \
1919 actual__, \
1920 long long, \
1921 "%lld", \
1922 >=);
1923
1932#define RTITest_assertGreaterOrEqualsLongLongWithAction(expected__, actual__, failAction__) \
1933 RTITest_assertComparisonForTypeWithAction( \
1934 expected__, \
1935 actual__, \
1936 long long, \
1937 "%lld", \
1938 >=, \
1939 failAction__);
1940
1948#define RTITest_assertEqualsUnsignedLongLong(expected__, actual__) \
1949 RTITest_assertComparisonForType( \
1950 expected__, \
1951 actual__, \
1952 unsigned long long, \
1953 "%llu", \
1954 ==);
1955
1964#define RTITest_assertEqualsUnsignedLongLongWithAction(expected__, actual__, failAction__) \
1965 RTITest_assertComparisonForTypeWithAction( \
1966 expected__, \
1967 actual__, \
1968 unsigned long long, \
1969 "%llu", \
1970 ==, \
1971 failAction__);
1972
1980#define RTITest_assertNotEqualsUnsignedLongLong(expected__, actual__) \
1981 RTITest_assertComparisonForType( \
1982 expected__, \
1983 actual__, \
1984 unsigned long long, \
1985 "%llu", \
1986 !=);
1987
1996#define RTITest_assertNotEqualsUnsignedLongLongWithAction(expected__, actual__, failAction__) \
1997 RTITest_assertComparisonForTypeWithAction( \
1998 expected__, \
1999 actual__, \
2000 unsigned long long, \
2001 "%llu", \
2002 !=, \
2003 failAction__);
2004
2012#define RTITest_assertLessThanUnsignedLongLong(expected__, actual__) \
2013 RTITest_assertComparisonForType( \
2014 expected__, \
2015 actual__, \
2016 unsigned long long, \
2017 "%llu", \
2018 <);
2019
2028#define RTITest_assertLessThanUnsignedLongLongWithAction(expected__, actual__, failAction__) \
2029 RTITest_assertComparisonForTypeWithAction( \
2030 expected__, \
2031 actual__, \
2032 unsigned long long, \
2033 "%llu", \
2034 <, \
2035 failAction__);
2036
2044#define RTITest_assertLessOrEqualsUnsignedLongLong(expected__, actual__) \
2045 RTITest_assertComparisonForType( \
2046 expected__, \
2047 actual__, \
2048 unsigned long long, \
2049 "%llu", \
2050 <=);
2051
2060#define RTITest_assertLessOrEqualsUnsignedLongLongWithAction(expected__, actual__, failAction__) \
2061 RTITest_assertComparisonForTypeWithAction( \
2062 expected__, \
2063 actual__, \
2064 unsigned long long, \
2065 "%llu", \
2066 <=, \
2067 failAction__);
2068
2076#define RTITest_assertGreaterThanUnsignedLongLong(expected__, actual__) \
2077 RTITest_assertComparisonForType( \
2078 expected__, \
2079 actual__, \
2080 unsigned long long, \
2081 "%llu", \
2082 >);
2083
2092#define RTITest_assertGreaterThanUnsignedLongLongWithAction(expected__, actual__, failAction__) \
2093 RTITest_assertComparisonForTypeWithAction( \
2094 expected__, \
2095 actual__, \
2096 unsigned long long, \
2097 "%llu", \
2098 >, \
2099 failAction__);
2100
2108#define RTITest_assertGreaterOrEqualsUnsignedLongLong(expected__, actual__) \
2109 RTITest_assertComparisonForType( \
2110 expected__, \
2111 actual__, \
2112 unsigned long long, \
2113 "%llu", \
2114 >=);
2115
2124#define RTITest_assertGreaterOrEqualsUnsignedLongLongWithAction(expected__, actual__, failAction__) \
2125 RTITest_assertComparisonForTypeWithAction( \
2126 expected__, \
2127 actual__, \
2128 unsigned long long, \
2129 "%llu", \
2130 >=, \
2131 failAction__);
2132
2140#define RTITest_assertEqualsFloat(expected__, actual__) \
2141 RTITest_assertComparisonForFloatingPointType( \
2142 expected__, \
2143 actual__, \
2144 float, \
2145 ==, \
2146 FLT_EPSILON);
2147
2156#define RTITest_assertEqualsFloatWithAction(expected__, actual__, failAction__) \
2157 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2158 expected__, \
2159 actual__, \
2160 float, \
2161 ==, \
2162 FLT_EPSILON, \
2163 failAction__);
2164
2172#define RTITest_assertNotEqualsFloat(expected__, actual__) \
2173 RTITest_assertComparisonForFloatingPointType( \
2174 expected__, \
2175 actual__, \
2176 float, \
2177 !=, \
2178 FLT_EPSILON);
2179
2188#define RTITest_assertNotEqualsFloatWithAction(expected__, actual__, failAction__) \
2189 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2190 expected__, \
2191 actual__, \
2192 float, \
2193 !=, \
2194 FLT_EPSILON, \
2195 failAction__);
2196
2204#define RTITest_assertLessThanFloat(expected__, actual__) \
2205 RTITest_assertComparisonForFloatingPointType( \
2206 expected__, \
2207 actual__, \
2208 float, \
2209 <, \
2210 FLT_EPSILON);
2211
2220#define RTITest_assertLessThanFloatWithAction(expected__, actual__, failAction__) \
2221 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2222 expected__, \
2223 actual__, \
2224 float, \
2225 <, \
2226 FLT_EPSILON, \
2227 failAction__);
2228
2236#define RTITest_assertLessOrEqualsFloat(expected__, actual__) \
2237 RTITest_assertComparisonForFloatingPointType( \
2238 expected__, \
2239 actual__, \
2240 float, \
2241 <=, \
2242 FLT_EPSILON);
2243
2252#define RTITest_assertLessOrEqualsFloatWithAction(expected__, actual__, failAction__) \
2253 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2254 expected__, \
2255 actual__, \
2256 float, \
2257 <=, \
2258 FLT_EPSILON, \
2259 failAction__);
2260
2268#define RTITest_assertGreaterThanFloat(expected__, actual__) \
2269 RTITest_assertComparisonForFloatingPointType( \
2270 expected__, \
2271 actual__, \
2272 float, \
2273 >, \
2274 FLT_EPSILON);
2275
2284#define RTITest_assertGreaterThanFloatWithAction(expected__, actual__, failAction__) \
2285 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2286 expected__, \
2287 actual__, \
2288 float, \
2289 >, \
2290 FLT_EPSILON, \
2291 failAction__);
2292
2300#define RTITest_assertGreaterOrEqualsFloat(expected__, actual__) \
2301 RTITest_assertComparisonForFloatingPointType( \
2302 expected__, \
2303 actual__, \
2304 float, \
2305 >=, \
2306 FLT_EPSILON);
2307
2316#define RTITest_assertGreaterOrEqualsFloatWithAction(expected__, actual__, failAction__) \
2317 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2318 expected__, \
2319 actual__, \
2320 float, \
2321 >=, \
2322 FLT_EPSILON, \
2323 failAction__);
2324
2332#define RTITest_assertEqualsDouble(expected__, actual__) \
2333 RTITest_assertComparisonForFloatingPointType( \
2334 expected__, \
2335 actual__, \
2336 double, \
2337 ==, \
2338 DBL_EPSILON);
2339
2348#define RTITest_assertEqualsDoubleWithAction(expected__, actual__, failAction__) \
2349 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2350 expected__, \
2351 actual__, \
2352 double, \
2353 ==, \
2354 DBL_EPSILON, \
2355 failAction__);
2356
2364#define RTITest_assertNotEqualsDouble(expected__, actual__) \
2365 RTITest_assertComparisonForFloatingPointType( \
2366 expected__, \
2367 actual__, \
2368 double, \
2369 !=, \
2370 DBL_EPSILON);
2371
2380#define RTITest_assertNotEqualsDoubleWithAction(expected__, actual__, failAction__) \
2381 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2382 expected__, \
2383 actual__, \
2384 double, \
2385 !=, \
2386 DBL_EPSILON, \
2387 failAction__);
2388
2396#define RTITest_assertLessThanDouble(expected__, actual__) \
2397 RTITest_assertComparisonForFloatingPointType( \
2398 expected__, \
2399 actual__, \
2400 double, \
2401 <, \
2402 DBL_EPSILON);
2403
2412#define RTITest_assertLessThanDoubleWithAction(expected__, actual__, failAction__) \
2413 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2414 expected__, \
2415 actual__, \
2416 double, \
2417 <, \
2418 DBL_EPSILON, \
2419 failAction__);
2420
2428#define RTITest_assertLessOrEqualsDouble(expected__, actual__) \
2429 RTITest_assertComparisonForFloatingPointType( \
2430 expected__, \
2431 actual__, \
2432 double, \
2433 <=, \
2434 DBL_EPSILON);
2435
2444#define RTITest_assertLessOrEqualsDoubleWithAction(expected__, actual__, failAction__) \
2445 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2446 expected__, \
2447 actual__, \
2448 double, \
2449 <=, \
2450 DBL_EPSILON, \
2451 failAction__);
2452
2460#define RTITest_assertGreaterThanDouble(expected__, actual__) \
2461 RTITest_assertComparisonForFloatingPointType( \
2462 expected__, \
2463 actual__, \
2464 double, \
2465 >, \
2466 DBL_EPSILON);
2467
2476#define RTITest_assertGreaterThanDoubleWithAction(expected__, actual__, failAction__) \
2477 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2478 expected__, \
2479 actual__, \
2480 double, \
2481 >, \
2482 DBL_EPSILON, \
2483 failAction__);
2484
2492#define RTITest_assertGreaterOrEqualsDouble(expected__, actual__) \
2493 RTITest_assertComparisonForFloatingPointType( \
2494 expected__, \
2495 actual__, \
2496 double, \
2497 >=, \
2498 DBL_EPSILON);
2499
2508#define RTITest_assertGreaterOrEqualsDoubleWithAction(expected__, actual__, failAction__) \
2509 RTITest_assertComparisonForFloatingPointTypeWithAction( \
2510 expected__, \
2511 actual__, \
2512 double, \
2513 >=, \
2514 DBL_EPSILON, \
2515 failAction__);
2516
2524#define RTITest_assertEqualsPtr(expected__, actual__) \
2525 RTITest_assertComparisonForType( \
2526 expected__, \
2527 actual__, \
2528 void *, \
2529 "%p", \
2530 ==);
2531
2540#define RTITest_assertEqualsPtrWithAction(expected__, actual__, failAction__) \
2541 RTITest_assertComparisonForTypeWithAction( \
2542 expected__, \
2543 actual__, \
2544 void *, \
2545 "%p", \
2546 ==, \
2547 failAction__);
2548
2556#define RTITest_assertNotEqualsPtr(expected__, actual__) \
2557 RTITest_assertComparisonForType( \
2558 expected__, \
2559 actual__, \
2560 void *, \
2561 "%p", \
2562 !=);
2563
2572#define RTITest_assertNotEqualsPtrWithAction(expected__, actual__, failAction__) \
2573 RTITest_assertComparisonForTypeWithAction( \
2574 expected__, \
2575 actual__, \
2576 void *, \
2577 "%p", \
2578 !=, \
2579 failAction__);
2580
2581
2589#define RTITest_assertEqualsBoolean RTITest_assertEqualsUnsignedShort
2590
2598#define RTITest_assertNotEqualsBoolean RTITest_assertNotEqualsUnsignedShort
2599
2613#define RTITest_assertEqualsNumericalChar(expected__, actual__) \
2614 RTITest_assertComparisonForType( \
2615 (unsigned char) (expected__), \
2616 (unsigned char) (actual__), \
2617 int, \
2618 "%d", \
2619 ==)
2620
2628#define RTITest_assertEqualsSize_t(expected__, actual__) \
2629 RTITest_assertComparisonForType( \
2630 expected__, \
2631 actual__, \
2632 size_t, \
2633 "%zu", \
2634 ==);
2635
2644#define RTITest_assertEqualsSize_tWithAction(expected__, actual__, failAction__) \
2645 RTITest_assertComparisonForTypeWithAction( \
2646 expected__, \
2647 actual__, \
2648 size_t, \
2649 "%zu", \
2650 ==, \
2651 failAction__);
2652
2660#define RTITest_assertNotEqualsSize_t(expected__, actual__) \
2661 RTITest_assertComparisonForType( \
2662 expected__, \
2663 actual__, \
2664 size_t, \
2665 "%zu", \
2666 !=);
2667
2676#define RTITest_assertNotEqualsSize_tWithAction(expected__, actual__, failAction__) \
2677 RTITest_assertComparisonForTypeWithAction( \
2678 expected__, \
2679 actual__, \
2680 size_t, \
2681 "%zu", \
2682 !=, \
2683 failAction__);
2684
2692#define RTITest_assertLessThanSize_t(expected__, actual__) \
2693 RTITest_assertComparisonForType( \
2694 expected__, \
2695 actual__, \
2696 size_t, \
2697 "%zu", \
2698 <);
2699
2708#define RTITest_assertLessThanSize_tWithAction(expected__, actual__, failAction__) \
2709 RTITest_assertComparisonForTypeWithAction( \
2710 expected__, \
2711 actual__, \
2712 size_t, \
2713 "%zu", \
2714 <, \
2715 failAction__);
2716
2724#define RTITest_assertLessOrEqualsSize_t(expected__, actual__) \
2725 RTITest_assertComparisonForType( \
2726 expected__, \
2727 actual__, \
2728 size_t, \
2729 "%zu", \
2730 <=);
2731
2740#define RTITest_assertLessOrEqualsSize_tWithAction(expected__, actual__, failAction__) \
2741 RTITest_assertComparisonForTypeWithAction( \
2742 expected__, \
2743 actual__, \
2744 size_t, \
2745 "%zu", \
2746 <=, \
2747 failAction__);
2748
2756#define RTITest_assertGreaterThanSize_t(expected__, actual__) \
2757 RTITest_assertComparisonForType( \
2758 expected__, \
2759 actual__, \
2760 size_t, \
2761 "%zu", \
2762 >);
2763
2772#define RTITest_assertGreaterThanSize_tWithAction(expected__, actual__, failAction__) \
2773 RTITest_assertComparisonForTypeWithAction( \
2774 expected__, \
2775 actual__, \
2776 size_t, \
2777 "%zu", \
2778 >, \
2779 failAction__);
2780
2788#define RTITest_assertGreaterOrEqualsSize_t(expected__, actual__) \
2789 RTITest_assertComparisonForType( \
2790 expected__, \
2791 actual__, \
2792 size_t, \
2793 "%zu", \
2794 >=);
2795
2804#define RTITest_assertGreaterOrEqualsSize_tWithAction(expected__, actual__, failAction__) \
2805 RTITest_assertComparisonForTypeWithAction( \
2806 expected__, \
2807 actual__, \
2808 size_t, \
2809 "%zu", \
2810 >=, \
2811 failAction__);
2812
2813#endif