RTEMS 6.1-rc1
test.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2017, 2021 embedded brains GmbH & Co. KG
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef THE_T_TEST_FRAMEWORK_H
38#define THE_T_TEST_FRAMEWORK_H
39
40#include <stdarg.h>
41#include <stdbool.h>
42#include <stddef.h>
43#include <stdint.h>
44#include <string.h>
45
46#ifdef __rtems__
47#include <rtems/score/cpu.h>
48#include <rtems/rtems/status.h>
49#endif
50
51#ifdef __cplusplus
52extern "C" {
53#endif /* __cplusplus */
54
65typedef enum {
66 T_QUIET,
67 T_NORMAL,
68 T_VERBOSE
69} T_verbosity;
70
71typedef struct T_fixture {
72 void (*setup)(void *);
73 void (*stop)(void *);
74 void (*teardown)(void *);
75 size_t (*scope)(void *, char *, size_t);
76 void *initial_context;
77} T_fixture;
78
79typedef struct T_fixture_node {
80 struct T_fixture_node *next;
81 struct T_fixture_node *previous;
82 const T_fixture *fixture;
83 void *context;
84 unsigned int next_planned_steps;
85 unsigned int next_steps;
86 unsigned int failures;
88
89typedef struct T_remark {
90 struct T_remark *next;
91 const char *remark;
92} T_remark;
93
94#define T_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
95
96/*
97 * The __FILE__ includes the full file path from the command line. Enable the
98 * build system to give a sorter file name via a command line define.
99 */
100#ifndef T_FILE_NAME
101#define T_FILE_NAME __FILE__
102#endif
103
104#if defined(__GNUC__) || __STDC_VERSION__ >= 199409L
105#define T_ZERO_LENGTH_ARRAY
106#else
107#define T_ZERO_LENGTH_ARRAY 1
108#endif
109
122#ifdef __cplusplus
123#define T_NO_RETURN [[ noreturn ]]
124#else
125#define T_NO_RETURN _Noreturn
126#endif
127
128typedef struct T_case_context {
129 const char *name;
130 void (*body)(void);
131 const T_fixture *fixture;
132 const struct T_case_context *next;
134
135void T_case_register(T_case_context *);
136
137#define T_CHECK_STOP 1U
138
139#define T_CHECK_QUIET 2U
140
141/* If you change this value, you have to adjust T_VA_ARGS_KIND() as well */
142#define T_CHECK_FMT 4U
143
144#define T_CHECK_STEP_FLAG 8U
145
146#define T_CHECK_STEP_TO_FLAGS(step) ((unsigned int)(step) << 8)
147
148#define T_CHECK_STEP_FROM_FLAGS(flags) ((flags) >> 8)
149
150#define T_CHECK_STEP(step) (T_CHECK_STEP_TO_FLAGS(step) | T_CHECK_STEP_FLAG)
151
152typedef struct {
153 const char *file;
154 int line;
155 unsigned int flags;
157
158typedef struct {
159 T_check_context base;
160 const char *msg;
162
163#define T_VA_ARGS_FIRST(...) T_VA_ARGS_FIRST_SELECT(__VA_ARGS__, throw_away)
164#define T_VA_ARGS_FIRST_SELECT(first, ...) first
165
166/*
167 * The T_VA_ARGS_MORE() supports up to nine arguments. It expands to nothing
168 * if only one argument is given. It expands to a comma and the second and
169 * following arguments if at least two arguments are present. The 4U shall
170 * correspond to T_CHECK_FMT.
171 */
172#define T_VA_ARGS_MORE(...) \
173 T_VA_ARGS_XEXPAND(T_VA_ARGS_KIND(__VA_ARGS__), __VA_ARGS__)
174#define T_VA_ARGS_XEXPAND(kind, ...) T_VA_ARGS_EXPAND(kind, __VA_ARGS__)
175#define T_VA_ARGS_EXPAND(kind, ...) T_VA_ARGS_EXPAND_##kind(__VA_ARGS__)
176#define T_VA_ARGS_EXPAND_0U(first)
177#define T_VA_ARGS_EXPAND_4U(first, ...) , __VA_ARGS__
178#define T_VA_ARGS_KIND(...) \
179 T_VA_ARGS_SELECT(__VA_ARGS__, \
180 4U, 4U, 4U, 4U, 4U, 4U, 4U, 4U, 0U, throw_away)
181#define T_VA_ARGS_SELECT(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ...) a10
182
183void T_check(const T_check_context *, bool, ...);
184
185extern const T_check_context T_special;
186
187#define T_flags_true(flags, ...) \
188{ \
189 static const T_check_context T_check_instance = { \
190 T_FILE_NAME, __LINE__, \
191 (flags) | T_VA_ARGS_KIND(__VA_ARGS__) }; \
192 T_check(&T_check_instance, \
193 T_VA_ARGS_FIRST(__VA_ARGS__) T_VA_ARGS_MORE(__VA_ARGS__)); \
194}
195
196#define T_flags_eq(flags, a, ...) \
197 T_flags_true(flags, \
198 (a) == (T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
199
200#define T_flags_ne(flags, a, ...) \
201 T_flags_true(flags, \
202 (a) != (T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
203
204void T_check_eq_ptr(const T_check_context_msg *, uintptr_t, uintptr_t);
205
206#define T_flags_eq_ptr(a, e, flags, sa, se) \
207{ \
208 static const T_check_context_msg T_check_instance = { \
209 { T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, \
210 sa " == " se }; \
211 T_check_eq_ptr(&T_check_instance, (uintptr_t)a, (uintptr_t)e); \
212}
213
214void T_check_ne_ptr(const T_check_context_msg *, uintptr_t, uintptr_t);
215
216#define T_flags_ne_ptr(a, e, flags, sa, se) \
217{ \
218 static const T_check_context_msg T_check_instance = { \
219 { T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, \
220 sa " != " se }; \
221 T_check_ne_ptr(&T_check_instance, (uintptr_t)a, (uintptr_t)e); \
222}
223
224void T_check_null(const T_check_context_msg *, uintptr_t);
225
226#define T_flags_null(a, flags, sa) \
227{ \
228 static const T_check_context_msg T_check_instance = { \
229 { T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, sa }; \
230 T_check_null(&T_check_instance, (uintptr_t)a); \
231}
232
233void T_check_not_null(const T_check_context_msg *, uintptr_t);
234
235#define T_flags_not_null(a, flags, sa) \
236{ \
237 static const T_check_context_msg T_check_instance = { \
238 { T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, sa }; \
239 T_check_not_null(&T_check_instance, (uintptr_t)a); \
240}
241
242void T_check_eq_mem(const T_check_context_msg *, const void *, const void *,
243 size_t);
244
245#define T_flags_eq_mem(a, e, n, flags, sa, se, sn) \
246{ \
247 static const T_check_context_msg T_check_instance = { \
248 { T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, \
249 "memcmp(" sa ", " se ", " sn ") == 0" }; \
250 T_check_eq_mem(&T_check_instance, a, e, n); \
251}
252
253void T_check_ne_mem(const T_check_context_msg *, const void *, const void *,
254 size_t);
255
256#define T_flags_ne_mem(a, e, n, flags, sa, se, sn) \
257{ \
258 static const T_check_context_msg T_check_instance = { \
259 { T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, \
260 "memcmp(" sa ", " se ", " sn ") != 0" }; \
261 T_check_ne_mem(&T_check_instance, a, e, n); \
262}
263
264void T_check_eq_str(const T_check_context *, const char *, const char *);
265
266#define T_flags_eq_str(a, e, flags) \
267{ \
268 static const T_check_context T_check_instance = { \
269 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
270 T_check_eq_str(&T_check_instance, a, e); \
271}
272
273void T_check_ne_str(const T_check_context *, const char *, const char *);
274
275#define T_flags_ne_str(a, e, flags) \
276{ \
277 static const T_check_context T_check_instance = { \
278 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
279 T_check_ne_str(&T_check_instance, a, e); \
280}
281
282void T_check_eq_nstr(const T_check_context *, const char *, const char *,
283 size_t);
284
285#define T_flags_eq_nstr(a, e, n, flags) \
286{ \
287 static const T_check_context T_check_instance = { \
288 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
289 T_check_eq_nstr(&T_check_instance, a, e, n); \
290}
291
292void T_check_ne_nstr(const T_check_context *, const char *, const char *,
293 size_t);
294
295#define T_flags_ne_nstr(a, e, n, flags) \
296{ \
297 static const T_check_context T_check_instance = { \
298 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
299 T_check_ne_nstr(&T_check_instance, a, e, n); \
300}
301
302void T_check_eq_char(const T_check_context *, char, char);
303
304#define T_flags_eq_char(a, e, flags) \
305{ \
306 static const T_check_context T_check_instance = { \
307 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
308 T_check_eq_char(&T_check_instance, a, e); \
309}
310
311void T_check_ne_char(const T_check_context *, char, char);
312
313#define T_flags_ne_char(a, e, flags) \
314{ \
315 static const T_check_context T_check_instance = { \
316 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
317 T_check_ne_char(&T_check_instance, a, e); \
318}
319
320void T_check_eq_int(const T_check_context *, int, int);
321
322#define T_flags_eq_int(a, e, flags) \
323{ \
324 static const T_check_context T_check_instance = { \
325 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
326 T_check_eq_int(&T_check_instance, a, e); \
327}
328
329void T_check_ne_int(const T_check_context *, int, int);
330
331#define T_flags_ne_int(a, e, flags) \
332{ \
333 static const T_check_context T_check_instance = { \
334 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
335 T_check_ne_int(&T_check_instance, a, e); \
336}
337
338void T_check_ge_int(const T_check_context *, int, int);
339
340#define T_flags_ge_int(a, e, flags) \
341{ \
342 static const T_check_context T_check_instance = { \
343 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
344 T_check_ge_int(&T_check_instance, a, e); \
345}
346
347void T_check_gt_int(const T_check_context *, int, int);
348
349#define T_flags_gt_int(a, e, flags) \
350{ \
351 static const T_check_context T_check_instance = { \
352 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
353 T_check_gt_int(&T_check_instance, a, e); \
354}
355
356void T_check_le_int(const T_check_context *, int, int);
357
358#define T_flags_le_int(a, e, flags) \
359{ \
360 static const T_check_context T_check_instance = { \
361 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
362 T_check_le_int(&T_check_instance, a, e); \
363}
364
365void T_check_lt_int(const T_check_context *, int, int);
366
367#define T_flags_lt_int(a, e, flags) \
368{ \
369 static const T_check_context T_check_instance = { \
370 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
371 T_check_lt_int(&T_check_instance, a, e); \
372}
373
374void T_check_eq_uint(const T_check_context *, unsigned int, unsigned int);
375
376#define T_flags_eq_uint(a, e, flags) \
377{ \
378 static const T_check_context T_check_instance = { \
379 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
380 T_check_eq_uint(&T_check_instance, a, e); \
381}
382
383void T_check_ne_uint(const T_check_context *, unsigned int, unsigned int);
384
385#define T_flags_ne_uint(a, e, flags) \
386{ \
387 static const T_check_context T_check_instance = { \
388 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
389 T_check_ne_uint(&T_check_instance, a, e); \
390}
391
392void T_check_ge_uint(const T_check_context *, unsigned int, unsigned int);
393
394#define T_flags_ge_uint(a, e, flags) \
395{ \
396 static const T_check_context T_check_instance = { \
397 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
398 T_check_ge_uint(&T_check_instance, a, e); \
399}
400
401void T_check_gt_uint(const T_check_context *, unsigned int, unsigned int);
402
403#define T_flags_gt_uint(a, e, flags) \
404{ \
405 static const T_check_context T_check_instance = { \
406 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
407 T_check_gt_uint(&T_check_instance, a, e); \
408}
409
410void T_check_le_uint(const T_check_context *, unsigned int, unsigned int);
411
412#define T_flags_le_uint(a, e, flags) \
413{ \
414 static const T_check_context T_check_instance = { \
415 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
416 T_check_le_uint(&T_check_instance, a, e); \
417}
418
419void T_check_lt_uint(const T_check_context *, unsigned int, unsigned int);
420
421#define T_flags_lt_uint(a, e, flags) \
422{ \
423 static const T_check_context T_check_instance = { \
424 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
425 T_check_lt_uint(&T_check_instance, a, e); \
426}
427
428void T_check_eq_long(const T_check_context *, long, long);
429
430#define T_flags_eq_long(a, e, flags) \
431{ \
432 static const T_check_context T_check_instance = { \
433 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
434 T_check_eq_long(&T_check_instance, a, e); \
435}
436
437void T_check_ne_long(const T_check_context *, long, long);
438
439#define T_flags_ne_long(a, e, flags) \
440{ \
441 static const T_check_context T_check_instance = { \
442 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
443 T_check_ne_long(&T_check_instance, a, e); \
444}
445
446void T_check_ge_long(const T_check_context *, long, long);
447
448#define T_flags_ge_long(a, e, flags) \
449{ \
450 static const T_check_context T_check_instance = { \
451 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
452 T_check_ge_long(&T_check_instance, a, e); \
453}
454
455void T_check_gt_long(const T_check_context *, long, long);
456
457#define T_flags_gt_long(a, e, flags) \
458{ \
459 static const T_check_context T_check_instance = { \
460 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
461 T_check_gt_long(&T_check_instance, a, e); \
462}
463
464void T_check_le_long(const T_check_context *, long, long);
465
466#define T_flags_le_long(a, e, flags) \
467{ \
468 static const T_check_context T_check_instance = { \
469 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
470 T_check_le_long(&T_check_instance, a, e); \
471}
472
473void T_check_lt_long(const T_check_context *, long, long);
474
475#define T_flags_lt_long(a, e, flags) \
476{ \
477 static const T_check_context T_check_instance = { \
478 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
479 T_check_lt_long(&T_check_instance, a, e); \
480}
481
482void T_check_eq_ulong(const T_check_context *, unsigned long, unsigned long);
483
484#define T_flags_eq_ulong(a, e, flags) \
485{ \
486 static const T_check_context T_check_instance = { \
487 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
488 T_check_eq_ulong(&T_check_instance, a, e); \
489}
490
491void T_check_ne_ulong(const T_check_context *, unsigned long, unsigned long);
492
493#define T_flags_ne_ulong(a, e, flags) \
494{ \
495 static const T_check_context T_check_instance = { \
496 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
497 T_check_ne_ulong(&T_check_instance, a, e); \
498}
499
500void T_check_ge_ulong(const T_check_context *, unsigned long, unsigned long);
501
502#define T_flags_ge_ulong(a, e, flags) \
503{ \
504 static const T_check_context T_check_instance = { \
505 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
506 T_check_ge_ulong(&T_check_instance, a, e); \
507}
508
509void T_check_gt_ulong(const T_check_context *, unsigned long, unsigned long);
510
511#define T_flags_gt_ulong(a, e, flags) \
512{ \
513 static const T_check_context T_check_instance = { \
514 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
515 T_check_gt_ulong(&T_check_instance, a, e); \
516}
517
518void T_check_le_ulong(const T_check_context *, unsigned long, unsigned long);
519
520#define T_flags_le_ulong(a, e, flags) \
521{ \
522 static const T_check_context T_check_instance = { \
523 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
524 T_check_le_ulong(&T_check_instance, a, e); \
525}
526
527void T_check_lt_ulong(const T_check_context *, unsigned long, unsigned long);
528
529#define T_flags_lt_ulong(a, e, flags) \
530{ \
531 static const T_check_context T_check_instance = { \
532 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
533 T_check_lt_ulong(&T_check_instance, a, e); \
534}
535
536void T_check_eq_ll(const T_check_context *, long long, long long);
537
538#define T_flags_eq_ll(a, e, flags) \
539{ \
540 static const T_check_context T_check_instance = { \
541 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
542 T_check_eq_ll(&T_check_instance, a, e); \
543}
544
545void T_check_ne_ll(const T_check_context *, long long, long long);
546
547#define T_flags_ne_ll(a, e, flags) \
548{ \
549 static const T_check_context T_check_instance = { \
550 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
551 T_check_ne_ll(&T_check_instance, a, e); \
552}
553
554void T_check_ge_ll(const T_check_context *, long long, long long);
555
556#define T_flags_ge_ll(a, e, flags) \
557{ \
558 static const T_check_context T_check_instance = { \
559 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
560 T_check_ge_ll(&T_check_instance, a, e); \
561}
562
563void T_check_gt_ll(const T_check_context *, long long, long long);
564
565#define T_flags_gt_ll(a, e, flags) \
566{ \
567 static const T_check_context T_check_instance = { \
568 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
569 T_check_gt_ll(&T_check_instance, a, e); \
570}
571
572void T_check_le_ll(const T_check_context *, long long, long long);
573
574#define T_flags_le_ll(a, e, flags) \
575{ \
576 static const T_check_context T_check_instance = { \
577 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
578 T_check_le_ll(&T_check_instance, a, e); \
579}
580
581void T_check_lt_ll(const T_check_context *, long long, long long);
582
583#define T_flags_lt_ll(a, e, flags) \
584{ \
585 static const T_check_context T_check_instance = { \
586 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
587 T_check_lt_ll(&T_check_instance, a, e); \
588}
589
590void T_check_eq_ull(const T_check_context *, unsigned long long,
591 unsigned long long);
592
593#define T_flags_eq_ull(a, e, flags) \
594{ \
595 static const T_check_context T_check_instance = { \
596 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
597 T_check_eq_ull(&T_check_instance, a, e); \
598}
599
600void T_check_ne_ull(const T_check_context *, unsigned long long,
601 unsigned long long);
602
603#define T_flags_ne_ull(a, e, flags) \
604{ \
605 static const T_check_context T_check_instance = { \
606 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
607 T_check_ne_ull(&T_check_instance, a, e); \
608}
609
610void T_check_ge_ull(const T_check_context *, unsigned long long,
611 unsigned long long);
612
613#define T_flags_ge_ull(a, e, flags) \
614{ \
615 static const T_check_context T_check_instance = { \
616 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
617 T_check_ge_ull(&T_check_instance, a, e); \
618}
619
620void T_check_gt_ull(const T_check_context *, unsigned long long,
621 unsigned long long);
622
623#define T_flags_gt_ull(a, e, flags) \
624{ \
625 static const T_check_context T_check_instance = { \
626 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
627 T_check_gt_ull(&T_check_instance, a, e); \
628}
629
630void T_check_le_ull(const T_check_context *, unsigned long long,
631 unsigned long long);
632
633#define T_flags_le_ull(a, e, flags) \
634{ \
635 static const T_check_context T_check_instance = { \
636 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
637 T_check_le_ull(&T_check_instance, a, e); \
638}
639
640void T_check_lt_ull(const T_check_context *, unsigned long long,
641 unsigned long long);
642
643#define T_flags_lt_ull(a, e, flags) \
644{ \
645 static const T_check_context T_check_instance = { \
646 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
647 T_check_lt_ull(&T_check_instance, a, e); \
648}
649
650void T_check_eno(const T_check_context *, int, int);
651
652#define T_flags_eno(a, e, flags) \
653{ \
654 static const T_check_context T_check_instance = { \
655 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
656 T_check_eno(&T_check_instance, a, e); \
657}
658
659void T_check_eno_success(const T_check_context *, int);
660
661#define T_flags_eno_success(a, flags) \
662{ \
663 static const T_check_context T_check_instance = { \
664 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
665 T_check_eno_success(&T_check_instance, a); \
666}
667
668void T_check_psx_error(const T_check_context *, int, int);
669
670#define T_flags_psx_error(a, eno, flags) \
671{ \
672 static const T_check_context T_check_instance = { \
673 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
674 T_check_psx_error(&T_check_instance, a, eno); \
675}
676
677void T_check_psx_success(const T_check_context *, int);
678
679#define T_flags_psx_success(a, flags) \
680{ \
681 static const T_check_context T_check_instance = { \
682 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
683 T_check_psx_success(&T_check_instance, a); \
684}
685
688int T_printf(char const *, ...);
689
690int T_vprintf(char const *, va_list);
691
692int T_puts(const char *, size_t);
693
694int T_snprintf(char *, size_t, const char *, ...);
695
696void T_log(T_verbosity, char const *, ...);
697
698const char *T_case_name(void);
699
700T_verbosity T_set_verbosity(T_verbosity);
701
712#define T_true(...) T_flags_true(0, __VA_ARGS__)
713#define T_assert_true(...) T_flags_true(T_CHECK_STOP, __VA_ARGS__)
714#define T_quiet_true(...) T_flags_true(T_CHECK_QUIET, __VA_ARGS__)
715#define T_step_true(s, ...) T_flags_true(T_CHECK_STEP(s), __VA_ARGS__)
716#define T_step_assert_true(s, ...) \
717 T_flags_true(T_CHECK_STEP(s) | T_CHECK_STOP, __VA_ARGS__)
718
719#define T_false(...) \
720 T_flags_true(0, \
721 !(T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
722#define T_assert_false(...) \
723 T_flags_true(T_CHECK_STOP, \
724 !(T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
725#define T_quiet_false(...) \
726 T_flags_true(T_CHECK_QUIET, \
727 !(T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
728#define T_step_false(s, ...) \
729 T_flags_true(T_CHECK_STEP(s), \
730 !(T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
731#define T_step_assert_false(s, ...) \
732 T_flags_true(T_CHECK_STEP(s) | T_CHECK_STOP, \
733 !(T_VA_ARGS_FIRST(__VA_ARGS__)) T_VA_ARGS_MORE(__VA_ARGS__))
734
747#define T_eq(a, ...) T_flags_eq(0, a, __VA_ARGS__)
748#define T_assert_eq(a, ...) T_flags_eq(T_CHECK_STOP, a, __VA_ARGS__)
749#define T_quiet_eq(a, ...) T_flags_eq(T_CHECK_QUIET, a, __VA_ARGS__)
750#define T_step_eq(s, a, ...) T_flags_eq(T_CHECK_STEP(s), a, __VA_ARGS__)
751#define T_step_assert_eq(s, a, ...) \
752 T_flags_eq(T_CHECK_STEP(s) | T_CHECK_STOP, a, __VA_ARGS__)
753
754#define T_ne(a, ...) T_flags_ne(0, a, __VA_ARGS__)
755#define T_assert_ne(a, ...) T_flags_ne(T_CHECK_STOP, a, __VA_ARGS__)
756#define T_quiet_ne(a, ...) T_flags_ne(T_CHECK_QUIET, a, __VA_ARGS__)
757#define T_step_ne(s, a, ...) T_flags_ne(T_CHECK_STEP(s), a, __VA_ARGS__)
758#define T_step_assert_ne(s, a, ...) \
759 T_flags_ne(T_CHECK_STEP(s) | T_CHECK_STOP, a, __VA_ARGS__)
760
773#define T_eq_ptr(a, e) T_flags_eq_ptr(a, e, 0, #a, #e)
774#define T_assert_eq_ptr(a, e) T_flags_eq_ptr(a, e, T_CHECK_STOP, #a, #e)
775#define T_quiet_eq_ptr(a, e) T_flags_eq_ptr(a, e, T_CHECK_QUIET, #a, #e)
776#define T_step_eq_ptr(s, a, e) T_flags_eq_ptr(a, e, T_CHECK_STEP(s), #a, #e)
777#define T_step_assert_eq_ptr(s, a, e) \
778 T_flags_eq_ptr(a, e, T_CHECK_STEP(s) | T_CHECK_STOP, #a, #e)
779
780#define T_ne_ptr(a, e) T_flags_ne_ptr(a, e, 0, #a, #e)
781#define T_assert_ne_ptr(a, e) T_flags_ne_ptr(a, e, T_CHECK_STOP, #a, #e)
782#define T_quiet_ne_ptr(a, e) T_flags_ne_ptr(a, e, T_CHECK_QUIET, #a, #e)
783#define T_step_ne_ptr(s, a, e) T_flags_ne_ptr(a, e, T_CHECK_STEP(s), #a, #e)
784#define T_step_assert_ne_ptr(s, a, e) \
785 T_flags_ne_ptr(a, e, T_CHECK_STEP(s) | T_CHECK_STOP, #a, #e)
786
787#define T_null(a) T_flags_null(a, 0, #a)
788#define T_assert_null(a) T_flags_null(a, T_CHECK_STOP, #a)
789#define T_quiet_null(a) T_flags_null(a, T_CHECK_QUIET, #a)
790#define T_quiet_assert_null(a) \
791 T_flags_null(a, T_CHECK_QUIET | T_CHECK_STOP, #a)
792#define T_step_null(s, a) T_flags_null(a, T_CHECK_STEP(s), #a)
793#define T_step_assert_null(s, a) \
794 T_flags_null(a, T_CHECK_STEP(s) | T_CHECK_STOP, #a)
795
796#define T_not_null(a) T_flags_not_null(a, 0, #a)
797#define T_assert_not_null(a) T_flags_not_null(a, T_CHECK_STOP, #a)
798#define T_quiet_not_null(a) T_flags_not_null(a, T_CHECK_QUIET, #a)
799#define T_quiet_assert_not_null(a) \
800 T_flags_not_null(a, T_CHECK_QUIET | T_CHECK_STOP, #a)
801#define T_step_not_null(s, a) T_flags_not_null(a, T_CHECK_STEP(s), #a)
802#define T_step_assert_not_null(s, a) \
803 T_flags_not_null(a, T_CHECK_STEP(s) | T_CHECK_STOP, #a)
804
817#define T_eq_mem(a, e, n) T_flags_eq_mem(a, e, n, 0, #a, #e, #n)
818#define T_assert_eq_mem(a, e, n) \
819 T_flags_eq_mem(a, e, n, T_CHECK_STOP, #a, #e, #n)
820#define T_quiet_eq_mem(a, e, n) \
821 T_flags_eq_mem(a, e, n, T_CHECK_QUIET, #a, #e, #n)
822#define T_step_eq_mem(s, a, e, n) \
823 T_flags_eq_mem(a, e, n, T_CHECK_STEP(s), #a, #e, #n)
824#define T_step_assert_eq_mem(s, a, e, n) \
825 T_flags_eq_mem(a, e, n, T_CHECK_STEP(s) | T_CHECK_STOP, #a, #e, #n)
826
827#define T_ne_mem(a, e, n) T_flags_ne_mem(a, e, n, 0, #a, #e, #n)
828#define T_assert_ne_mem(a, e, n) \
829 T_flags_ne_mem(a, e, n, T_CHECK_STOP, #a, #e, #n)
830#define T_quiet_ne_mem(a, e, n) \
831 T_flags_ne_mem(a, e, n, T_CHECK_QUIET, #a, #e, #n)
832#define T_step_ne_mem(s, a, e, n) \
833 T_flags_ne_mem(a, e, n, T_CHECK_STEP(s), #a, #e, #n)
834#define T_step_assert_ne_mem(s, a, e, n) \
835 T_flags_ne_mem(a, e, n, T_CHECK_STEP(s) | T_CHECK_STOP, #a, #e, #n)
836
850#define T_eq_str(a, e) T_flags_eq_str(a, e, 0)
851#define T_assert_eq_str(a, e) T_flags_eq_str(a, e, T_CHECK_STOP)
852#define T_quiet_eq_str(a, e) T_flags_eq_str(a, e, T_CHECK_QUIET)
853#define T_step_eq_str(s, a, e) T_flags_eq_str(a, e, T_CHECK_STEP(s))
854#define T_step_assert_eq_str(s, a, e) \
855 T_flags_eq_str(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
856
857#define T_ne_str(a, e) T_flags_ne_str(a, e, 0)
858#define T_assert_ne_str(a, e) T_flags_ne_str(a, e, T_CHECK_STOP)
859#define T_quiet_ne_str(a, e) T_flags_ne_str(a, e, T_CHECK_QUIET)
860#define T_step_ne_str(s, a, e) T_flags_ne_str(a, e, T_CHECK_STEP(s))
861#define T_step_assert_ne_str(s, a, e) \
862 T_flags_ne_str(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
863
864#define T_eq_nstr(a, e, n) T_flags_eq_nstr(a, e, n, 0)
865#define T_assert_eq_nstr(a, e, n) T_flags_eq_nstr(a, e, n, T_CHECK_STOP)
866#define T_quiet_eq_nstr(a, e, n) T_flags_eq_nstr(a, e, n, T_CHECK_QUIET)
867#define T_step_eq_nstr(s, a, e, n) T_flags_eq_nstr(a, e, n, T_CHECK_STEP(s))
868#define T_step_assert_eq_nstr(s, a, e, n) \
869 T_flags_eq_nstr(a, e, n, T_CHECK_STEP(s) | T_CHECK_STOP)
870
871#define T_ne_nstr(a, e, n) T_flags_ne_nstr(a, e, n, 0)
872#define T_assert_ne_nstr(a, e, n) T_flags_ne_nstr(a, e, n, T_CHECK_STOP)
873#define T_quiet_ne_nstr(a, e, n) T_flags_ne_nstr(a, e, n, T_CHECK_QUIET)
874#define T_step_ne_nstr(s, a, e, n) T_flags_ne_nstr(a, e, n, T_CHECK_STEP(s))
875#define T_step_assert_ne_nstr(s, a, e, n) \
876 T_flags_ne_nstr(a, e, n, T_CHECK_STEP(s) | T_CHECK_STOP)
877
890#define T_eq_char(a, e) T_flags_eq_char(a, e, 0)
891#define T_assert_eq_char(a, e) T_flags_eq_char(a, e, T_CHECK_STOP)
892#define T_quiet_eq_char(a, e) T_flags_eq_char(a, e, T_CHECK_QUIET)
893#define T_step_eq_char(s, a, e) T_flags_eq_char(a, e, T_CHECK_STEP(s))
894#define T_step_assert_eq_char(s, a, e) \
895 T_flags_eq_char(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
896
897#define T_ne_char(a, e) T_flags_ne_char(a, e, 0)
898#define T_assert_ne_char(a, e) T_flags_ne_char(a, e, T_CHECK_STOP)
899#define T_quiet_ne_char(a, e) T_flags_ne_char(a, e, T_CHECK_QUIET)
900#define T_step_ne_char(s, a, e) T_flags_ne_char(a, e, T_CHECK_STEP(s))
901#define T_step_assert_ne_char(s, a, e) \
902 T_flags_ne_char(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
903
916#define T_eq_schar(a, e) T_flags_eq_int(a, e, 0)
917#define T_assert_eq_schar(a, e) T_flags_eq_int(a, e, T_CHECK_STOP)
918#define T_quiet_eq_schar(a, e) T_flags_eq_int(a, e, T_CHECK_QUIET)
919#define T_step_eq_schar(s, a, e) T_flags_eq_int(a, e, T_CHECK_STEP(s))
920#define T_step_assert_eq_schar(s, a, e) \
921 T_flags_eq_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
922
923#define T_ne_schar(a, e) T_flags_ne_int(a, e, 0)
924#define T_assert_ne_schar(a, e) T_flags_ne_int(a, e, T_CHECK_STOP)
925#define T_quiet_ne_schar(a, e) T_flags_ne_int(a, e, T_CHECK_QUIET)
926#define T_step_ne_schar(s, a, e) T_flags_ne_int(a, e, T_CHECK_STEP(s))
927#define T_step_assert_ne_schar(s, a, e) \
928 T_flags_ne_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
929
930#define T_ge_schar(a, e) T_flags_ge_int(a, e, 0)
931#define T_assert_ge_schar(a, e) T_flags_ge_int(a, e, T_CHECK_STOP)
932#define T_quiet_ge_schar(a, e) T_flags_ge_int(a, e, T_CHECK_QUIET)
933#define T_step_ge_schar(s, a, e) T_flags_ge_int(a, e, T_CHECK_STEP(s))
934#define T_step_assert_ge_schar(s, a, e) \
935 T_flags_ge_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
936
937#define T_gt_schar(a, e) T_flags_gt_int(a, e, 0)
938#define T_assert_gt_schar(a, e) T_flags_gt_int(a, e, T_CHECK_STOP)
939#define T_quiet_gt_schar(a, e) T_flags_gt_int(a, e, T_CHECK_QUIET)
940#define T_step_gt_schar(s, a, e) T_flags_gt_int(a, e, T_CHECK_STEP(s))
941#define T_step_assert_gt_schar(s, a, e) \
942 T_flags_gt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
943
944#define T_le_schar(a, e) T_flags_le_int(a, e, 0)
945#define T_assert_le_schar(a, e) T_flags_le_int(a, e, T_CHECK_STOP)
946#define T_quiet_le_schar(a, e) T_flags_le_int(a, e, T_CHECK_QUIET)
947#define T_step_le_schar(s, a, e) T_flags_le_int(a, e, T_CHECK_STEP(s))
948#define T_step_assert_le_schar(s, a, e) \
949 T_flags_le_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
950
951#define T_lt_schar(a, e) T_flags_lt_int(a, e, 0)
952#define T_assert_lt_schar(a, e) T_flags_lt_int(a, e, T_CHECK_STOP)
953#define T_quiet_lt_schar(a, e) T_flags_lt_int(a, e, T_CHECK_QUIET)
954#define T_step_lt_schar(s, a, e) T_flags_lt_int(a, e, T_CHECK_STEP(s))
955#define T_step_assert_lt_schar(s, a, e) \
956 T_flags_lt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
957
970#define T_eq_uchar(a, e) T_flags_eq_uint(a, e, 0)
971#define T_assert_eq_uchar(a, e) T_flags_eq_uint(a, e, T_CHECK_STOP)
972#define T_quiet_eq_uchar(a, e) T_flags_eq_uint(a, e, T_CHECK_QUIET)
973#define T_step_eq_uchar(s, a, e) T_flags_eq_uint(a, e, T_CHECK_STEP(s))
974#define T_step_assert_eq_uchar(s, a, e) \
975 T_flags_eq_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
976
977#define T_ne_uchar(a, e) T_flags_ne_uint(a, e, 0)
978#define T_assert_ne_uchar(a, e) T_flags_ne_uint(a, e, T_CHECK_STOP)
979#define T_quiet_ne_uchar(a, e) T_flags_ne_uint(a, e, T_CHECK_QUIET)
980#define T_step_ne_uchar(s, a, e) T_flags_ne_uint(a, e, T_CHECK_STEP(s))
981#define T_step_assert_ne_uchar(s, a, e) \
982 T_flags_ne_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
983
984#define T_ge_uchar(a, e) T_flags_ge_uint(a, e, 0)
985#define T_assert_ge_uchar(a, e) T_flags_ge_uint(a, e, T_CHECK_STOP)
986#define T_quiet_ge_uchar(a, e) T_flags_ge_uint(a, e, T_CHECK_QUIET)
987#define T_step_ge_uchar(s, a, e) T_flags_ge_uint(a, e, T_CHECK_STEP(s))
988#define T_step_assert_ge_uchar(s, a, e) \
989 T_flags_ge_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
990
991#define T_gt_uchar(a, e) T_flags_gt_uint(a, e, 0)
992#define T_assert_gt_uchar(a, e) T_flags_gt_uint(a, e, T_CHECK_STOP)
993#define T_quiet_gt_uchar(a, e) T_flags_gt_uint(a, e, T_CHECK_QUIET)
994#define T_step_gt_uchar(s, a, e) T_flags_gt_uint(a, e, T_CHECK_STEP(s))
995#define T_step_assert_gt_uchar(s, a, e) \
996 T_flags_gt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
997
998#define T_le_uchar(a, e) T_flags_le_uint(a, e, 0)
999#define T_assert_le_uchar(a, e) T_flags_le_uint(a, e, T_CHECK_STOP)
1000#define T_quiet_le_uchar(a, e) T_flags_le_uint(a, e, T_CHECK_QUIET)
1001#define T_step_le_uchar(s, a, e) T_flags_le_uint(a, e, T_CHECK_STEP(s))
1002#define T_step_assert_le_uchar(s, a, e) \
1003 T_flags_le_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1004
1005#define T_lt_uchar(a, e) T_flags_lt_uint(a, e, 0)
1006#define T_assert_lt_uchar(a, e) T_flags_lt_uint(a, e, T_CHECK_STOP)
1007#define T_quiet_lt_uchar(a, e) T_flags_lt_uint(a, e, T_CHECK_QUIET)
1008#define T_step_lt_uchar(s, a, e) T_flags_lt_uint(a, e, T_CHECK_STEP(s))
1009#define T_step_assert_lt_uchar(s, a, e) \
1010 T_flags_lt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1011
1024#define T_eq_short(a, e) T_flags_eq_int(a, e, 0)
1025#define T_assert_eq_short(a, e) T_flags_eq_int(a, e, T_CHECK_STOP)
1026#define T_quiet_eq_short(a, e) T_flags_eq_int(a, e, T_CHECK_QUIET)
1027#define T_step_eq_short(s, a, e) T_flags_eq_int(a, e, T_CHECK_STEP(s))
1028#define T_step_assert_eq_short(s, a, e) \
1029 T_flags_eq_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1030
1031#define T_ne_short(a, e) T_flags_ne_int(a, e, 0)
1032#define T_assert_ne_short(a, e) T_flags_ne_int(a, e, T_CHECK_STOP)
1033#define T_quiet_ne_short(a, e) T_flags_ne_int(a, e, T_CHECK_QUIET)
1034#define T_step_ne_short(s, a, e) T_flags_ne_int(a, e, T_CHECK_STEP(s))
1035#define T_step_assert_ne_short(s, a, e) \
1036 T_flags_ne_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1037
1038#define T_ge_short(a, e) T_flags_ge_int(a, e, 0)
1039#define T_assert_ge_short(a, e) T_flags_ge_int(a, e, T_CHECK_STOP)
1040#define T_quiet_ge_short(a, e) T_flags_ge_int(a, e, T_CHECK_QUIET)
1041#define T_step_ge_short(s, a, e) T_flags_ge_int(a, e, T_CHECK_STEP(s))
1042#define T_step_assert_ge_short(s, a, e) \
1043 T_flags_ge_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1044
1045#define T_gt_short(a, e) T_flags_gt_int(a, e, 0)
1046#define T_assert_gt_short(a, e) T_flags_gt_int(a, e, T_CHECK_STOP)
1047#define T_quiet_gt_short(a, e) T_flags_gt_int(a, e, T_CHECK_QUIET)
1048#define T_step_gt_short(s, a, e) T_flags_gt_int(a, e, T_CHECK_STEP(s))
1049#define T_step_assert_gt_short(s, a, e) \
1050 T_flags_gt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1051
1052#define T_le_short(a, e) T_flags_le_int(a, e, 0)
1053#define T_assert_le_short(a, e) T_flags_le_int(a, e, T_CHECK_STOP)
1054#define T_quiet_le_short(a, e) T_flags_le_int(a, e, T_CHECK_QUIET)
1055#define T_step_le_short(s, a, e) T_flags_le_int(a, e, T_CHECK_STEP(s))
1056#define T_step_assert_le_short(s, a, e) \
1057 T_flags_le_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1058
1059#define T_lt_short(a, e) T_flags_lt_int(a, e, 0)
1060#define T_assert_lt_short(a, e) T_flags_lt_int(a, e, T_CHECK_STOP)
1061#define T_quiet_lt_short(a, e) T_flags_lt_int(a, e, T_CHECK_QUIET)
1062#define T_step_lt_short(s, a, e) T_flags_lt_int(a, e, T_CHECK_STEP(s))
1063#define T_step_assert_lt_short(s, a, e) \
1064 T_flags_lt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1065
1078#define T_eq_ushort(a, e) T_flags_eq_uint(a, e, 0)
1079#define T_assert_eq_ushort(a, e) T_flags_eq_uint(a, e, T_CHECK_STOP)
1080#define T_quiet_eq_ushort(a, e) T_flags_eq_uint(a, e, T_CHECK_QUIET)
1081#define T_step_eq_ushort(s, a, e) T_flags_eq_uint(a, e, T_CHECK_STEP(s))
1082#define T_step_assert_eq_ushort(s, a, e) \
1083 T_flags_eq_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1084
1085#define T_ne_ushort(a, e) T_flags_ne_uint(a, e, 0)
1086#define T_assert_ne_ushort(a, e) T_flags_ne_uint(a, e, T_CHECK_STOP)
1087#define T_quiet_ne_ushort(a, e) T_flags_ne_uint(a, e, T_CHECK_QUIET)
1088#define T_step_ne_ushort(s, a, e) T_flags_ne_uint(a, e, T_CHECK_STEP(s))
1089#define T_step_assert_ne_ushort(s, a, e) \
1090 T_flags_ne_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1091
1092#define T_ge_ushort(a, e) T_flags_ge_uint(a, e, 0)
1093#define T_assert_ge_ushort(a, e) T_flags_ge_uint(a, e, T_CHECK_STOP)
1094#define T_quiet_ge_ushort(a, e) T_flags_ge_uint(a, e, T_CHECK_QUIET)
1095#define T_step_ge_ushort(s, a, e) T_flags_ge_uint(a, e, T_CHECK_STEP(s))
1096#define T_step_assert_ge_ushort(s, a, e) \
1097 T_flags_ge_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1098
1099#define T_gt_ushort(a, e) T_flags_gt_uint(a, e, 0)
1100#define T_assert_gt_ushort(a, e) T_flags_gt_uint(a, e, T_CHECK_STOP)
1101#define T_quiet_gt_ushort(a, e) T_flags_gt_uint(a, e, T_CHECK_QUIET)
1102#define T_step_gt_ushort(s, a, e) T_flags_gt_uint(a, e, T_CHECK_STEP(s))
1103#define T_step_assert_gt_ushort(s, a, e) \
1104 T_flags_gt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1105
1106#define T_le_ushort(a, e) T_flags_le_uint(a, e, 0)
1107#define T_assert_le_ushort(a, e) T_flags_le_uint(a, e, T_CHECK_STOP)
1108#define T_quiet_le_ushort(a, e) T_flags_le_uint(a, e, T_CHECK_QUIET)
1109#define T_step_le_ushort(s, a, e) T_flags_le_uint(a, e, T_CHECK_STEP(s))
1110#define T_step_assert_le_ushort(s, a, e) \
1111 T_flags_le_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1112
1113#define T_lt_ushort(a, e) T_flags_lt_uint(a, e, 0)
1114#define T_assert_lt_ushort(a, e) T_flags_lt_uint(a, e, T_CHECK_STOP)
1115#define T_quiet_lt_ushort(a, e) T_flags_lt_uint(a, e, T_CHECK_QUIET)
1116#define T_step_lt_ushort(s, a, e) T_flags_lt_uint(a, e, T_CHECK_STEP(s))
1117#define T_step_assert_lt_ushort(s, a, e) \
1118 T_flags_lt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1119
1132#define T_eq_int(a, e) T_flags_eq_int(a, e, 0)
1133#define T_assert_eq_int(a, e) T_flags_eq_int(a, e, T_CHECK_STOP)
1134#define T_quiet_eq_int(a, e) T_flags_eq_int(a, e, T_CHECK_QUIET)
1135#define T_step_eq_int(s, a, e) T_flags_eq_int(a, e, T_CHECK_STEP(s))
1136#define T_step_assert_eq_int(s, a, e) \
1137 T_flags_eq_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1138
1139#define T_ne_int(a, e) T_flags_ne_int(a, e, 0)
1140#define T_assert_ne_int(a, e) T_flags_ne_int(a, e, T_CHECK_STOP)
1141#define T_quiet_ne_int(a, e) T_flags_ne_int(a, e, T_CHECK_QUIET)
1142#define T_step_ne_int(s, a, e) T_flags_ne_int(a, e, T_CHECK_STEP(s))
1143#define T_step_assert_ne_int(s, a, e) \
1144 T_flags_ne_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1145
1146#define T_ge_int(a, e) T_flags_ge_int(a, e, 0)
1147#define T_assert_ge_int(a, e) T_flags_ge_int(a, e, T_CHECK_STOP)
1148#define T_quiet_ge_int(a, e) T_flags_ge_int(a, e, T_CHECK_QUIET)
1149#define T_step_ge_int(s, a, e) T_flags_ge_int(a, e, T_CHECK_STEP(s))
1150#define T_step_assert_ge_int(s, a, e) \
1151 T_flags_ge_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1152
1153#define T_gt_int(a, e) T_flags_gt_int(a, e, 0)
1154#define T_assert_gt_int(a, e) T_flags_gt_int(a, e, T_CHECK_STOP)
1155#define T_quiet_gt_int(a, e) T_flags_gt_int(a, e, T_CHECK_QUIET)
1156#define T_step_gt_int(s, a, e) T_flags_gt_int(a, e, T_CHECK_STEP(s))
1157#define T_step_assert_gt_int(s, a, e) \
1158 T_flags_gt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1159
1160#define T_le_int(a, e) T_flags_le_int(a, e, 0)
1161#define T_assert_le_int(a, e) T_flags_le_int(a, e, T_CHECK_STOP)
1162#define T_quiet_le_int(a, e) T_flags_le_int(a, e, T_CHECK_QUIET)
1163#define T_step_le_int(s, a, e) T_flags_le_int(a, e, T_CHECK_STEP(s))
1164#define T_step_assert_le_int(s, a, e) \
1165 T_flags_le_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1166
1167#define T_lt_int(a, e) T_flags_lt_int(a, e, 0)
1168#define T_assert_lt_int(a, e) T_flags_lt_int(a, e, T_CHECK_STOP)
1169#define T_quiet_lt_int(a, e) T_flags_lt_int(a, e, T_CHECK_QUIET)
1170#define T_step_lt_int(s, a, e) T_flags_lt_int(a, e, T_CHECK_STEP(s))
1171#define T_step_assert_lt_int(s, a, e) \
1172 T_flags_lt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1173
1186#define T_eq_uint(a, e) T_flags_eq_uint(a, e, 0)
1187#define T_assert_eq_uint(a, e) T_flags_eq_uint(a, e, T_CHECK_STOP)
1188#define T_quiet_eq_uint(a, e) T_flags_eq_uint(a, e, T_CHECK_QUIET)
1189#define T_step_eq_uint(s, a, e) T_flags_eq_uint(a, e, T_CHECK_STEP(s))
1190#define T_step_assert_eq_uint(s, a, e) \
1191 T_flags_eq_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1192
1193#define T_ne_uint(a, e) T_flags_ne_uint(a, e, 0)
1194#define T_assert_ne_uint(a, e) T_flags_ne_uint(a, e, T_CHECK_STOP)
1195#define T_quiet_ne_uint(a, e) T_flags_ne_uint(a, e, T_CHECK_QUIET)
1196#define T_step_ne_uint(s, a, e) T_flags_ne_uint(a, e, T_CHECK_STEP(s))
1197#define T_step_assert_ne_uint(s, a, e) \
1198 T_flags_ne_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1199
1200#define T_ge_uint(a, e) T_flags_ge_uint(a, e, 0)
1201#define T_assert_ge_uint(a, e) T_flags_ge_uint(a, e, T_CHECK_STOP)
1202#define T_quiet_ge_uint(a, e) T_flags_ge_uint(a, e, T_CHECK_QUIET)
1203#define T_step_ge_uint(s, a, e) T_flags_ge_uint(a, e, T_CHECK_STEP(s))
1204#define T_step_assert_ge_uint(s, a, e) \
1205 T_flags_ge_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1206
1207#define T_gt_uint(a, e) T_flags_gt_uint(a, e, 0)
1208#define T_assert_gt_uint(a, e) T_flags_gt_uint(a, e, T_CHECK_STOP)
1209#define T_quiet_gt_uint(a, e) T_flags_gt_uint(a, e, T_CHECK_QUIET)
1210#define T_step_gt_uint(s, a, e) T_flags_gt_uint(a, e, T_CHECK_STEP(s))
1211#define T_step_assert_gt_uint(s, a, e) \
1212 T_flags_gt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1213
1214#define T_le_uint(a, e) T_flags_le_uint(a, e, 0)
1215#define T_assert_le_uint(a, e) T_flags_le_uint(a, e, T_CHECK_STOP)
1216#define T_quiet_le_uint(a, e) T_flags_le_uint(a, e, T_CHECK_QUIET)
1217#define T_step_le_uint(s, a, e) T_flags_le_uint(a, e, T_CHECK_STEP(s))
1218#define T_step_assert_le_uint(s, a, e) \
1219 T_flags_le_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1220
1221#define T_lt_uint(a, e) T_flags_lt_uint(a, e, 0)
1222#define T_assert_lt_uint(a, e) T_flags_lt_uint(a, e, T_CHECK_STOP)
1223#define T_quiet_lt_uint(a, e) T_flags_lt_uint(a, e, T_CHECK_QUIET)
1224#define T_step_lt_uint(s, a, e) T_flags_lt_uint(a, e, T_CHECK_STEP(s))
1225#define T_step_assert_lt_uint(s, a, e) \
1226 T_flags_lt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1227
1240#define T_eq_long(a, e) T_flags_eq_long(a, e, 0)
1241#define T_assert_eq_long(a, e) T_flags_eq_long(a, e, T_CHECK_STOP)
1242#define T_quiet_eq_long(a, e) T_flags_eq_long(a, e, T_CHECK_QUIET)
1243#define T_step_eq_long(s, a, e) T_flags_eq_long(a, e, T_CHECK_STEP(s))
1244#define T_step_assert_eq_long(s, a, e) \
1245 T_flags_eq_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1246
1247#define T_ne_long(a, e) T_flags_ne_long(a, e, 0)
1248#define T_assert_ne_long(a, e) T_flags_ne_long(a, e, T_CHECK_STOP)
1249#define T_quiet_ne_long(a, e) T_flags_ne_long(a, e, T_CHECK_QUIET)
1250#define T_step_ne_long(s, a, e) T_flags_ne_long(a, e, T_CHECK_STEP(s))
1251#define T_step_assert_ne_long(s, a, e) \
1252 T_flags_ne_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1253
1254#define T_ge_long(a, e) T_flags_ge_long(a, e, 0)
1255#define T_assert_ge_long(a, e) T_flags_ge_long(a, e, T_CHECK_STOP)
1256#define T_quiet_ge_long(a, e) T_flags_ge_long(a, e, T_CHECK_QUIET)
1257#define T_step_ge_long(s, a, e) T_flags_ge_long(a, e, T_CHECK_STEP(s))
1258#define T_step_assert_ge_long(s, a, e) \
1259 T_flags_ge_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1260
1261#define T_gt_long(a, e) T_flags_gt_long(a, e, 0)
1262#define T_assert_gt_long(a, e) T_flags_gt_long(a, e, T_CHECK_STOP)
1263#define T_quiet_gt_long(a, e) T_flags_gt_long(a, e, T_CHECK_QUIET)
1264#define T_step_gt_long(s, a, e) T_flags_gt_long(a, e, T_CHECK_STEP(s))
1265#define T_step_assert_gt_long(s, a, e) \
1266 T_flags_gt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1267
1268#define T_le_long(a, e) T_flags_le_long(a, e, 0)
1269#define T_assert_le_long(a, e) T_flags_le_long(a, e, T_CHECK_STOP)
1270#define T_quiet_le_long(a, e) T_flags_le_long(a, e, T_CHECK_QUIET)
1271#define T_step_le_long(s, a, e) T_flags_le_long(a, e, T_CHECK_STEP(s))
1272#define T_step_assert_le_long(s, a, e) \
1273 T_flags_le_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1274
1275#define T_lt_long(a, e) T_flags_lt_long(a, e, 0)
1276#define T_assert_lt_long(a, e) T_flags_lt_long(a, e, T_CHECK_STOP)
1277#define T_quiet_lt_long(a, e) T_flags_lt_long(a, e, T_CHECK_QUIET)
1278#define T_step_lt_long(s, a, e) T_flags_lt_long(a, e, T_CHECK_STEP(s))
1279#define T_step_assert_lt_long(s, a, e) \
1280 T_flags_lt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1281
1294#define T_eq_ulong(a, e) T_flags_eq_ulong(a, e, 0)
1295#define T_assert_eq_ulong(a, e) T_flags_eq_ulong(a, e, T_CHECK_STOP)
1296#define T_quiet_eq_ulong(a, e) T_flags_eq_ulong(a, e, T_CHECK_QUIET)
1297#define T_step_eq_ulong(s, a, e) T_flags_eq_ulong(a, e, T_CHECK_STEP(s))
1298#define T_step_assert_eq_ulong(s, a, e) \
1299 T_flags_eq_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1300
1301#define T_ne_ulong(a, e) T_flags_ne_ulong(a, e, 0)
1302#define T_assert_ne_ulong(a, e) T_flags_ne_ulong(a, e, T_CHECK_STOP)
1303#define T_quiet_ne_ulong(a, e) T_flags_ne_ulong(a, e, T_CHECK_QUIET)
1304#define T_step_ne_ulong(s, a, e) T_flags_ne_ulong(a, e, T_CHECK_STEP(s))
1305#define T_step_assert_ne_ulong(s, a, e) \
1306 T_flags_ne_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1307
1308#define T_ge_ulong(a, e) T_flags_ge_ulong(a, e, 0)
1309#define T_assert_ge_ulong(a, e) T_flags_ge_ulong(a, e, T_CHECK_STOP)
1310#define T_quiet_ge_ulong(a, e) T_flags_ge_ulong(a, e, T_CHECK_QUIET)
1311#define T_step_ge_ulong(s, a, e) T_flags_ge_ulong(a, e, T_CHECK_STEP(s))
1312#define T_step_assert_ge_ulong(s, a, e) \
1313 T_flags_ge_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1314
1315#define T_gt_ulong(a, e) T_flags_gt_ulong(a, e, 0)
1316#define T_assert_gt_ulong(a, e) T_flags_gt_ulong(a, e, T_CHECK_STOP)
1317#define T_quiet_gt_ulong(a, e) T_flags_gt_ulong(a, e, T_CHECK_QUIET)
1318#define T_step_gt_ulong(s, a, e) T_flags_gt_ulong(a, e, T_CHECK_STEP(s))
1319#define T_step_assert_gt_ulong(s, a, e) \
1320 T_flags_gt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1321
1322#define T_le_ulong(a, e) T_flags_le_ulong(a, e, 0)
1323#define T_assert_le_ulong(a, e) T_flags_le_ulong(a, e, T_CHECK_STOP)
1324#define T_quiet_le_ulong(a, e) T_flags_le_ulong(a, e, T_CHECK_QUIET)
1325#define T_step_le_ulong(s, a, e) T_flags_le_ulong(a, e, T_CHECK_STEP(s))
1326#define T_step_assert_le_ulong(s, a, e) \
1327 T_flags_le_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1328
1329#define T_lt_ulong(a, e) T_flags_lt_ulong(a, e, 0)
1330#define T_assert_lt_ulong(a, e) T_flags_lt_ulong(a, e, T_CHECK_STOP)
1331#define T_quiet_lt_ulong(a, e) T_flags_lt_ulong(a, e, T_CHECK_QUIET)
1332#define T_step_lt_ulong(s, a, e) T_flags_lt_ulong(a, e, T_CHECK_STEP(s))
1333#define T_step_assert_lt_ulong(s, a, e) \
1334 T_flags_lt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1335
1348#define T_eq_ll(a, e) T_flags_eq_ll(a, e, 0)
1349#define T_assert_eq_ll(a, e) T_flags_eq_ll(a, e, T_CHECK_STOP)
1350#define T_quiet_eq_ll(a, e) T_flags_eq_ll(a, e, T_CHECK_QUIET)
1351#define T_step_eq_ll(s, a, e) T_flags_eq_ll(a, e, T_CHECK_STEP(s))
1352#define T_step_assert_eq_ll(s, a, e) \
1353 T_flags_eq_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1354
1355#define T_ne_ll(a, e) T_flags_ne_ll(a, e, 0)
1356#define T_assert_ne_ll(a, e) T_flags_ne_ll(a, e, T_CHECK_STOP)
1357#define T_quiet_ne_ll(a, e) T_flags_ne_ll(a, e, T_CHECK_QUIET)
1358#define T_step_ne_ll(s, a, e) T_flags_ne_ll(a, e, T_CHECK_STEP(s))
1359#define T_step_assert_ne_ll(s, a, e) \
1360 T_flags_ne_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1361
1362#define T_ge_ll(a, e) T_flags_ge_ll(a, e, 0)
1363#define T_assert_ge_ll(a, e) T_flags_ge_ll(a, e, T_CHECK_STOP)
1364#define T_quiet_ge_ll(a, e) T_flags_ge_ll(a, e, T_CHECK_QUIET)
1365#define T_step_ge_ll(s, a, e) T_flags_ge_ll(a, e, T_CHECK_STEP(s))
1366#define T_step_assert_ge_ll(s, a, e) \
1367 T_flags_ge_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1368
1369#define T_gt_ll(a, e) T_flags_gt_ll(a, e, 0)
1370#define T_assert_gt_ll(a, e) T_flags_gt_ll(a, e, T_CHECK_STOP)
1371#define T_quiet_gt_ll(a, e) T_flags_gt_ll(a, e, T_CHECK_QUIET)
1372#define T_step_gt_ll(s, a, e) T_flags_gt_ll(a, e, T_CHECK_STEP(s))
1373#define T_step_assert_gt_ll(s, a, e) \
1374 T_flags_gt_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1375
1376#define T_le_ll(a, e) T_flags_le_ll(a, e, 0)
1377#define T_assert_le_ll(a, e) T_flags_le_ll(a, e, T_CHECK_STOP)
1378#define T_quiet_le_ll(a, e) T_flags_le_ll(a, e, T_CHECK_QUIET)
1379#define T_step_le_ll(s, a, e) T_flags_le_ll(a, e, T_CHECK_STEP(s))
1380#define T_step_assert_le_ll(s, a, e) \
1381 T_flags_le_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1382
1383#define T_lt_ll(a, e) T_flags_lt_ll(a, e, 0)
1384#define T_assert_lt_ll(a, e) T_flags_lt_ll(a, e, T_CHECK_STOP)
1385#define T_quiet_lt_ll(a, e) T_flags_lt_ll(a, e, T_CHECK_QUIET)
1386#define T_step_lt_ll(s, a, e) T_flags_lt_ll(a, e, T_CHECK_STEP(s))
1387#define T_step_assert_lt_ll(s, a, e) \
1388 T_flags_lt_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1389
1402#define T_eq_ull(a, e) T_flags_eq_ull(a, e, 0)
1403#define T_assert_eq_ull(a, e) T_flags_eq_ull(a, e, T_CHECK_STOP)
1404#define T_quiet_eq_ull(a, e) T_flags_eq_ull(a, e, T_CHECK_QUIET)
1405#define T_step_eq_ull(s, a, e) T_flags_eq_ull(a, e, T_CHECK_STEP(s))
1406#define T_step_assert_eq_ull(s, a, e) \
1407 T_flags_eq_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1408
1409#define T_ne_ull(a, e) T_flags_ne_ull(a, e, 0)
1410#define T_assert_ne_ull(a, e) T_flags_ne_ull(a, e, T_CHECK_STOP)
1411#define T_quiet_ne_ull(a, e) T_flags_ne_ull(a, e, T_CHECK_QUIET)
1412#define T_step_ne_ull(s, a, e) T_flags_ne_ull(a, e, T_CHECK_STEP(s))
1413#define T_step_assert_ne_ull(s, a, e) \
1414 T_flags_ne_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1415
1416#define T_ge_ull(a, e) T_flags_ge_ull(a, e, 0)
1417#define T_assert_ge_ull(a, e) T_flags_ge_ull(a, e, T_CHECK_STOP)
1418#define T_quiet_ge_ull(a, e) T_flags_ge_ull(a, e, T_CHECK_QUIET)
1419#define T_step_ge_ull(s, a, e) T_flags_ge_ull(a, e, T_CHECK_STEP(s))
1420#define T_step_assert_ge_ull(s, a, e) \
1421 T_flags_ge_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1422
1423#define T_gt_ull(a, e) T_flags_gt_ull(a, e, 0)
1424#define T_assert_gt_ull(a, e) T_flags_gt_ull(a, e, T_CHECK_STOP)
1425#define T_quiet_gt_ull(a, e) T_flags_gt_ull(a, e, T_CHECK_QUIET)
1426#define T_step_gt_ull(s, a, e) T_flags_gt_ull(a, e, T_CHECK_STEP(s))
1427#define T_step_assert_gt_ull(s, a, e) \
1428 T_flags_gt_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1429
1430#define T_le_ull(a, e) T_flags_le_ull(a, e, 0)
1431#define T_assert_le_ull(a, e) T_flags_le_ull(a, e, T_CHECK_STOP)
1432#define T_quiet_le_ull(a, e) T_flags_le_ull(a, e, T_CHECK_QUIET)
1433#define T_step_le_ull(s, a, e) T_flags_le_ull(a, e, T_CHECK_STEP(s))
1434#define T_step_assert_le_ull(s, a, e) \
1435 T_flags_le_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1436
1437#define T_lt_ull(a, e) T_flags_lt_ull(a, e, 0)
1438#define T_assert_lt_ull(a, e) T_flags_lt_ull(a, e, T_CHECK_STOP)
1439#define T_quiet_lt_ull(a, e) T_flags_lt_ull(a, e, T_CHECK_QUIET)
1440#define T_step_lt_ull(s, a, e) T_flags_lt_ull(a, e, T_CHECK_STEP(s))
1441#define T_step_assert_lt_ull(s, a, e) \
1442 T_flags_lt_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1443
1456#define T_eq_i8(a, e) T_flags_eq_int(a, e, 0)
1457#define T_assert_eq_i8(a, e) T_flags_eq_int(a, e, T_CHECK_STOP)
1458#define T_quiet_eq_i8(a, e) T_flags_eq_int(a, e, T_CHECK_QUIET)
1459#define T_step_eq_i8(s, a, e) T_flags_eq_int(a, e, T_CHECK_STEP(s))
1460#define T_step_assert_eq_i8(s, a, e) \
1461 T_flags_eq_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1462
1463#define T_ne_i8(a, e) T_flags_ne_int(a, e, 0)
1464#define T_assert_ne_i8(a, e) T_flags_ne_int(a, e, T_CHECK_STOP)
1465#define T_quiet_ne_i8(a, e) T_flags_ne_int(a, e, T_CHECK_QUIET)
1466#define T_step_ne_i8(s, a, e) T_flags_ne_int(a, e, T_CHECK_STEP(s))
1467#define T_step_assert_ne_i8(s, a, e) \
1468 T_flags_ne_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1469
1470#define T_ge_i8(a, e) T_flags_ge_int(a, e, 0)
1471#define T_assert_ge_i8(a, e) T_flags_ge_int(a, e, T_CHECK_STOP)
1472#define T_quiet_ge_i8(a, e) T_flags_ge_int(a, e, T_CHECK_QUIET)
1473#define T_step_ge_i8(s, a, e) T_flags_ge_int(a, e, T_CHECK_STEP(s))
1474#define T_step_assert_ge_i8(s, a, e) \
1475 T_flags_ge_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1476
1477#define T_gt_i8(a, e) T_flags_gt_int(a, e, 0)
1478#define T_assert_gt_i8(a, e) T_flags_gt_int(a, e, T_CHECK_STOP)
1479#define T_quiet_gt_i8(a, e) T_flags_gt_int(a, e, T_CHECK_QUIET)
1480#define T_step_gt_i8(s, a, e) T_flags_gt_int(a, e, T_CHECK_STEP(s))
1481#define T_step_assert_gt_i8(s, a, e) \
1482 T_flags_gt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1483
1484#define T_le_i8(a, e) T_flags_le_int(a, e, 0)
1485#define T_assert_le_i8(a, e) T_flags_le_int(a, e, T_CHECK_STOP)
1486#define T_quiet_le_i8(a, e) T_flags_le_int(a, e, T_CHECK_QUIET)
1487#define T_step_le_i8(s, a, e) T_flags_le_int(a, e, T_CHECK_STEP(s))
1488#define T_step_assert_le_i8(s, a, e) \
1489 T_flags_le_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1490
1491#define T_lt_i8(a, e) T_flags_lt_int(a, e, 0)
1492#define T_assert_lt_i8(a, e) T_flags_lt_int(a, e, T_CHECK_STOP)
1493#define T_quiet_lt_i8(a, e) T_flags_lt_int(a, e, T_CHECK_QUIET)
1494#define T_step_lt_i8(s, a, e) T_flags_lt_int(a, e, T_CHECK_STEP(s))
1495#define T_step_assert_lt_i8(s, a, e) \
1496 T_flags_lt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1497
1510#define T_eq_u8(a, e) T_flags_eq_uint(a, e, 0)
1511#define T_assert_eq_u8(a, e) T_flags_eq_uint(a, e, T_CHECK_STOP)
1512#define T_quiet_eq_u8(a, e) T_flags_eq_uint(a, e, T_CHECK_QUIET)
1513#define T_step_eq_u8(s, a, e) T_flags_eq_uint(a, e, T_CHECK_STEP(s))
1514#define T_step_assert_eq_u8(s, a, e) \
1515 T_flags_eq_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1516
1517#define T_ne_u8(a, e) T_flags_ne_uint(a, e, 0)
1518#define T_assert_ne_u8(a, e) T_flags_ne_uint(a, e, T_CHECK_STOP)
1519#define T_quiet_ne_u8(a, e) T_flags_ne_uint(a, e, T_CHECK_QUIET)
1520#define T_step_ne_u8(s, a, e) T_flags_ne_uint(a, e, T_CHECK_STEP(s))
1521#define T_step_assert_ne_u8(s, a, e) \
1522 T_flags_ne_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1523
1524#define T_ge_u8(a, e) T_flags_ge_uint(a, e, 0)
1525#define T_assert_ge_u8(a, e) T_flags_ge_uint(a, e, T_CHECK_STOP)
1526#define T_quiet_ge_u8(a, e) T_flags_ge_uint(a, e, T_CHECK_QUIET)
1527#define T_step_ge_u8(s, a, e) T_flags_ge_uint(a, e, T_CHECK_STEP(s))
1528#define T_step_assert_ge_u8(s, a, e) \
1529 T_flags_ge_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1530
1531#define T_gt_u8(a, e) T_flags_gt_uint(a, e, 0)
1532#define T_assert_gt_u8(a, e) T_flags_gt_uint(a, e, T_CHECK_STOP)
1533#define T_quiet_gt_u8(a, e) T_flags_gt_uint(a, e, T_CHECK_QUIET)
1534#define T_step_gt_u8(s, a, e) T_flags_gt_uint(a, e, T_CHECK_STEP(s))
1535#define T_step_assert_gt_u8(s, a, e) \
1536 T_flags_gt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1537
1538#define T_le_u8(a, e) T_flags_le_uint(a, e, 0)
1539#define T_assert_le_u8(a, e) T_flags_le_uint(a, e, T_CHECK_STOP)
1540#define T_quiet_le_u8(a, e) T_flags_le_uint(a, e, T_CHECK_QUIET)
1541#define T_step_le_u8(s, a, e) T_flags_le_uint(a, e, T_CHECK_STEP(s))
1542#define T_step_assert_le_u8(s, a, e) \
1543 T_flags_le_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1544
1545#define T_lt_u8(a, e) T_flags_lt_uint(a, e, 0)
1546#define T_assert_lt_u8(a, e) T_flags_lt_uint(a, e, T_CHECK_STOP)
1547#define T_quiet_lt_u8(a, e) T_flags_lt_uint(a, e, T_CHECK_QUIET)
1548#define T_step_lt_u8(s, a, e) T_flags_lt_uint(a, e, T_CHECK_STEP(s))
1549#define T_step_assert_lt_u8(s, a, e) \
1550 T_flags_lt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1551
1564#define T_eq_i16(a, e) T_flags_eq_int(a, e, 0)
1565#define T_assert_eq_i16(a, e) T_flags_eq_int(a, e, T_CHECK_STOP)
1566#define T_quiet_eq_i16(a, e) T_flags_eq_int(a, e, T_CHECK_QUIET)
1567#define T_step_eq_i16(s, a, e) T_flags_eq_int(a, e, T_CHECK_STEP(s))
1568#define T_step_assert_eq_i16(s, a, e) \
1569 T_flags_eq_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1570
1571#define T_ne_i16(a, e) T_flags_ne_int(a, e, 0)
1572#define T_assert_ne_i16(a, e) T_flags_ne_int(a, e, T_CHECK_STOP)
1573#define T_quiet_ne_i16(a, e) T_flags_ne_int(a, e, T_CHECK_QUIET)
1574#define T_step_ne_i16(s, a, e) T_flags_ne_int(a, e, T_CHECK_STEP(s))
1575#define T_step_assert_ne_i16(s, a, e) \
1576 T_flags_ne_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1577
1578#define T_ge_i16(a, e) T_flags_ge_int(a, e, 0)
1579#define T_assert_ge_i16(a, e) T_flags_ge_int(a, e, T_CHECK_STOP)
1580#define T_quiet_ge_i16(a, e) T_flags_ge_int(a, e, T_CHECK_QUIET)
1581#define T_step_ge_i16(s, a, e) T_flags_ge_int(a, e, T_CHECK_STEP(s))
1582#define T_step_assert_ge_i16(s, a, e) \
1583 T_flags_ge_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1584
1585#define T_gt_i16(a, e) T_flags_gt_int(a, e, 0)
1586#define T_assert_gt_i16(a, e) T_flags_gt_int(a, e, T_CHECK_STOP)
1587#define T_quiet_gt_i16(a, e) T_flags_gt_int(a, e, T_CHECK_QUIET)
1588#define T_step_gt_i16(s, a, e) T_flags_gt_int(a, e, T_CHECK_STEP(s))
1589#define T_step_assert_gt_i16(s, a, e) \
1590 T_flags_gt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1591
1592#define T_le_i16(a, e) T_flags_le_int(a, e, 0)
1593#define T_assert_le_i16(a, e) T_flags_le_int(a, e, T_CHECK_STOP)
1594#define T_quiet_le_i16(a, e) T_flags_le_int(a, e, T_CHECK_QUIET)
1595#define T_step_le_i16(s, a, e) T_flags_le_int(a, e, T_CHECK_STEP(s))
1596#define T_step_assert_le_i16(s, a, e) \
1597 T_flags_le_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1598
1599#define T_lt_i16(a, e) T_flags_lt_int(a, e, 0)
1600#define T_assert_lt_i16(a, e) T_flags_lt_int(a, e, T_CHECK_STOP)
1601#define T_quiet_lt_i16(a, e) T_flags_lt_int(a, e, T_CHECK_QUIET)
1602#define T_step_lt_i16(s, a, e) T_flags_lt_int(a, e, T_CHECK_STEP(s))
1603#define T_step_assert_lt_i16(s, a, e) \
1604 T_flags_lt_int(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1605
1618#define T_eq_u16(a, e) T_flags_eq_uint(a, e, 0)
1619#define T_assert_eq_u16(a, e) T_flags_eq_uint(a, e, T_CHECK_STOP)
1620#define T_quiet_eq_u16(a, e) T_flags_eq_uint(a, e, T_CHECK_QUIET)
1621#define T_step_eq_u16(s, a, e) T_flags_eq_uint(a, e, T_CHECK_STEP(s))
1622#define T_step_assert_eq_u16(s, a, e) \
1623 T_flags_eq_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1624
1625#define T_ne_u16(a, e) T_flags_ne_uint(a, e, 0)
1626#define T_assert_ne_u16(a, e) T_flags_ne_uint(a, e, T_CHECK_STOP)
1627#define T_quiet_ne_u16(a, e) T_flags_ne_uint(a, e, T_CHECK_QUIET)
1628#define T_step_ne_u16(s, a, e) T_flags_ne_uint(a, e, T_CHECK_STEP(s))
1629#define T_step_assert_ne_u16(s, a, e) \
1630 T_flags_ne_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1631
1632#define T_ge_u16(a, e) T_flags_ge_uint(a, e, 0)
1633#define T_assert_ge_u16(a, e) T_flags_ge_uint(a, e, T_CHECK_STOP)
1634#define T_quiet_ge_u16(a, e) T_flags_ge_uint(a, e, T_CHECK_QUIET)
1635#define T_step_ge_u16(s, a, e) T_flags_ge_uint(a, e, T_CHECK_STEP(s))
1636#define T_step_assert_ge_u16(s, a, e) \
1637 T_flags_ge_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1638
1639#define T_gt_u16(a, e) T_flags_gt_uint(a, e, 0)
1640#define T_assert_gt_u16(a, e) T_flags_gt_uint(a, e, T_CHECK_STOP)
1641#define T_quiet_gt_u16(a, e) T_flags_gt_uint(a, e, T_CHECK_QUIET)
1642#define T_step_gt_u16(s, a, e) T_flags_gt_uint(a, e, T_CHECK_STEP(s))
1643#define T_step_assert_gt_u16(s, a, e) \
1644 T_flags_gt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1645
1646#define T_le_u16(a, e) T_flags_le_uint(a, e, 0)
1647#define T_assert_le_u16(a, e) T_flags_le_uint(a, e, T_CHECK_STOP)
1648#define T_quiet_le_u16(a, e) T_flags_le_uint(a, e, T_CHECK_QUIET)
1649#define T_step_le_u16(s, a, e) T_flags_le_uint(a, e, T_CHECK_STEP(s))
1650#define T_step_assert_le_u16(s, a, e) \
1651 T_flags_le_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1652
1653#define T_lt_u16(a, e) T_flags_lt_uint(a, e, 0)
1654#define T_assert_lt_u16(a, e) T_flags_lt_uint(a, e, T_CHECK_STOP)
1655#define T_quiet_lt_u16(a, e) T_flags_lt_uint(a, e, T_CHECK_QUIET)
1656#define T_step_lt_u16(s, a, e) T_flags_lt_uint(a, e, T_CHECK_STEP(s))
1657#define T_step_assert_lt_u16(s, a, e) \
1658 T_flags_lt_uint(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1659
1672#define T_eq_i32(a, e) T_flags_eq_long(a, e, 0)
1673#define T_assert_eq_i32(a, e) T_flags_eq_long(a, e, T_CHECK_STOP)
1674#define T_quiet_eq_i32(a, e) T_flags_eq_long(a, e, T_CHECK_QUIET)
1675#define T_step_eq_i32(s, a, e) T_flags_eq_long(a, e, T_CHECK_STEP(s))
1676#define T_step_assert_eq_i32(s, a, e) \
1677 T_flags_eq_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1678
1679#define T_ne_i32(a, e) T_flags_ne_long(a, e, 0)
1680#define T_assert_ne_i32(a, e) T_flags_ne_long(a, e, T_CHECK_STOP)
1681#define T_quiet_ne_i32(a, e) T_flags_ne_long(a, e, T_CHECK_QUIET)
1682#define T_step_ne_i32(s, a, e) T_flags_ne_long(a, e, T_CHECK_STEP(s))
1683#define T_step_assert_ne_i32(s, a, e) \
1684 T_flags_ne_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1685
1686#define T_ge_i32(a, e) T_flags_ge_long(a, e, 0)
1687#define T_assert_ge_i32(a, e) T_flags_ge_long(a, e, T_CHECK_STOP)
1688#define T_quiet_ge_i32(a, e) T_flags_ge_long(a, e, T_CHECK_QUIET)
1689#define T_step_ge_i32(s, a, e) T_flags_ge_long(a, e, T_CHECK_STEP(s))
1690#define T_step_assert_ge_i32(s, a, e) \
1691 T_flags_ge_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1692
1693#define T_gt_i32(a, e) T_flags_gt_long(a, e, 0)
1694#define T_assert_gt_i32(a, e) T_flags_gt_long(a, e, T_CHECK_STOP)
1695#define T_quiet_gt_i32(a, e) T_flags_gt_long(a, e, T_CHECK_QUIET)
1696#define T_step_gt_i32(s, a, e) T_flags_gt_long(a, e, T_CHECK_STEP(s))
1697#define T_step_assert_gt_i32(s, a, e) \
1698 T_flags_gt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1699
1700#define T_le_i32(a, e) T_flags_le_long(a, e, 0)
1701#define T_assert_le_i32(a, e) T_flags_le_long(a, e, T_CHECK_STOP)
1702#define T_quiet_le_i32(a, e) T_flags_le_long(a, e, T_CHECK_QUIET)
1703#define T_step_le_i32(s, a, e) T_flags_le_long(a, e, T_CHECK_STEP(s))
1704#define T_step_assert_le_i32(s, a, e) \
1705 T_flags_le_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1706
1707#define T_lt_i32(a, e) T_flags_lt_long(a, e, 0)
1708#define T_assert_lt_i32(a, e) T_flags_lt_long(a, e, T_CHECK_STOP)
1709#define T_quiet_lt_i32(a, e) T_flags_lt_long(a, e, T_CHECK_QUIET)
1710#define T_step_lt_i32(s, a, e) T_flags_lt_long(a, e, T_CHECK_STEP(s))
1711#define T_step_assert_lt_i32(s, a, e) \
1712 T_flags_lt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1713
1726#define T_eq_u32(a, e) T_flags_eq_ulong(a, e, 0)
1727#define T_assert_eq_u32(a, e) T_flags_eq_ulong(a, e, T_CHECK_STOP)
1728#define T_quiet_eq_u32(a, e) T_flags_eq_ulong(a, e, T_CHECK_QUIET)
1729#define T_step_eq_u32(s, a, e) T_flags_eq_ulong(a, e, T_CHECK_STEP(s))
1730#define T_step_assert_eq_u32(s, a, e) \
1731 T_flags_eq_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1732
1733#define T_ne_u32(a, e) T_flags_ne_ulong(a, e, 0)
1734#define T_assert_ne_u32(a, e) T_flags_ne_ulong(a, e, T_CHECK_STOP)
1735#define T_quiet_ne_u32(a, e) T_flags_ne_ulong(a, e, T_CHECK_QUIET)
1736#define T_step_ne_u32(s, a, e) T_flags_ne_ulong(a, e, T_CHECK_STEP(s))
1737#define T_step_assert_ne_u32(s, a, e) \
1738 T_flags_ne_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1739
1740#define T_ge_u32(a, e) T_flags_ge_ulong(a, e, 0)
1741#define T_assert_ge_u32(a, e) T_flags_ge_ulong(a, e, T_CHECK_STOP)
1742#define T_quiet_ge_u32(a, e) T_flags_ge_ulong(a, e, T_CHECK_QUIET)
1743#define T_step_ge_u32(s, a, e) T_flags_ge_ulong(a, e, T_CHECK_STEP(s))
1744#define T_step_assert_ge_u32(s, a, e) \
1745 T_flags_ge_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1746
1747#define T_gt_u32(a, e) T_flags_gt_ulong(a, e, 0)
1748#define T_assert_gt_u32(a, e) T_flags_gt_ulong(a, e, T_CHECK_STOP)
1749#define T_quiet_gt_u32(a, e) T_flags_gt_ulong(a, e, T_CHECK_QUIET)
1750#define T_step_gt_u32(s, a, e) T_flags_gt_ulong(a, e, T_CHECK_STEP(s))
1751#define T_step_assert_gt_u32(s, a, e) \
1752 T_flags_gt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1753
1754#define T_le_u32(a, e) T_flags_le_ulong(a, e, 0)
1755#define T_assert_le_u32(a, e) T_flags_le_ulong(a, e, T_CHECK_STOP)
1756#define T_quiet_le_u32(a, e) T_flags_le_ulong(a, e, T_CHECK_QUIET)
1757#define T_step_le_u32(s, a, e) T_flags_le_ulong(a, e, T_CHECK_STEP(s))
1758#define T_step_assert_le_u32(s, a, e) \
1759 T_flags_le_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1760
1761#define T_lt_u32(a, e) T_flags_lt_ulong(a, e, 0)
1762#define T_assert_lt_u32(a, e) T_flags_lt_ulong(a, e, T_CHECK_STOP)
1763#define T_quiet_lt_u32(a, e) T_flags_lt_ulong(a, e, T_CHECK_QUIET)
1764#define T_step_lt_u32(s, a, e) T_flags_lt_ulong(a, e, T_CHECK_STEP(s))
1765#define T_step_assert_lt_u32(s, a, e) \
1766 T_flags_lt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1767
1780#define T_eq_i64(a, e) T_flags_eq_ll(a, e, 0)
1781#define T_assert_eq_i64(a, e) T_flags_eq_ll(a, e, T_CHECK_STOP)
1782#define T_quiet_eq_i64(a, e) T_flags_eq_ll(a, e, T_CHECK_QUIET)
1783#define T_step_eq_i64(s, a, e) T_flags_eq_ll(a, e, T_CHECK_STEP(s))
1784#define T_step_assert_eq_i64(s, a, e) \
1785 T_flags_eq_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1786
1787#define T_ne_i64(a, e) T_flags_ne_ll(a, e, 0)
1788#define T_assert_ne_i64(a, e) T_flags_ne_ll(a, e, T_CHECK_STOP)
1789#define T_quiet_ne_i64(a, e) T_flags_ne_ll(a, e, T_CHECK_QUIET)
1790#define T_step_ne_i64(s, a, e) T_flags_ne_ll(a, e, T_CHECK_STEP(s))
1791#define T_step_assert_ne_i64(s, a, e) \
1792 T_flags_ne_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1793
1794#define T_ge_i64(a, e) T_flags_ge_ll(a, e, 0)
1795#define T_assert_ge_i64(a, e) T_flags_ge_ll(a, e, T_CHECK_STOP)
1796#define T_quiet_ge_i64(a, e) T_flags_ge_ll(a, e, T_CHECK_QUIET)
1797#define T_step_ge_i64(s, a, e) T_flags_ge_ll(a, e, T_CHECK_STEP(s))
1798#define T_step_assert_ge_i64(s, a, e) \
1799 T_flags_ge_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1800
1801#define T_gt_i64(a, e) T_flags_gt_ll(a, e, 0)
1802#define T_assert_gt_i64(a, e) T_flags_gt_ll(a, e, T_CHECK_STOP)
1803#define T_quiet_gt_i64(a, e) T_flags_gt_ll(a, e, T_CHECK_QUIET)
1804#define T_step_gt_i64(s, a, e) T_flags_gt_ll(a, e, T_CHECK_STEP(s))
1805#define T_step_assert_gt_i64(s, a, e) \
1806 T_flags_gt_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1807
1808#define T_le_i64(a, e) T_flags_le_ll(a, e, 0)
1809#define T_assert_le_i64(a, e) T_flags_le_ll(a, e, T_CHECK_STOP)
1810#define T_quiet_le_i64(a, e) T_flags_le_ll(a, e, T_CHECK_QUIET)
1811#define T_step_le_i64(s, a, e) T_flags_le_ll(a, e, T_CHECK_STEP(s))
1812#define T_step_assert_le_i64(s, a, e) \
1813 T_flags_le_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1814
1815#define T_lt_i64(a, e) T_flags_lt_ll(a, e, 0)
1816#define T_assert_lt_i64(a, e) T_flags_lt_ll(a, e, T_CHECK_STOP)
1817#define T_quiet_lt_i64(a, e) T_flags_lt_ll(a, e, T_CHECK_QUIET)
1818#define T_step_lt_i64(s, a, e) T_flags_lt_ll(a, e, T_CHECK_STEP(s))
1819#define T_step_assert_lt_i64(s, a, e) \
1820 T_flags_lt_ll(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1821
1834#define T_eq_u64(a, e) T_flags_eq_ull(a, e, 0)
1835#define T_assert_eq_u64(a, e) T_flags_eq_ull(a, e, T_CHECK_STOP)
1836#define T_quiet_eq_u64(a, e) T_flags_eq_ull(a, e, T_CHECK_QUIET)
1837#define T_step_eq_u64(s, a, e) T_flags_eq_ull(a, e, T_CHECK_STEP(s))
1838#define T_step_assert_eq_u64(s, a, e) \
1839 T_flags_eq_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1840
1841#define T_ne_u64(a, e) T_flags_ne_ull(a, e, 0)
1842#define T_assert_ne_u64(a, e) T_flags_ne_ull(a, e, T_CHECK_STOP)
1843#define T_quiet_ne_u64(a, e) T_flags_ne_ull(a, e, T_CHECK_QUIET)
1844#define T_step_ne_u64(s, a, e) T_flags_ne_ull(a, e, T_CHECK_STEP(s))
1845#define T_step_assert_ne_u64(s, a, e) \
1846 T_flags_ne_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1847
1848#define T_ge_u64(a, e) T_flags_ge_ull(a, e, 0)
1849#define T_assert_ge_u64(a, e) T_flags_ge_ull(a, e, T_CHECK_STOP)
1850#define T_quiet_ge_u64(a, e) T_flags_ge_ull(a, e, T_CHECK_QUIET)
1851#define T_step_ge_u64(s, a, e) T_flags_ge_ull(a, e, T_CHECK_STEP(s))
1852#define T_step_assert_ge_u64(s, a, e) \
1853 T_flags_ge_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1854
1855#define T_gt_u64(a, e) T_flags_gt_ull(a, e, 0)
1856#define T_assert_gt_u64(a, e) T_flags_gt_ull(a, e, T_CHECK_STOP)
1857#define T_quiet_gt_u64(a, e) T_flags_gt_ull(a, e, T_CHECK_QUIET)
1858#define T_step_gt_u64(s, a, e) T_flags_gt_ull(a, e, T_CHECK_STEP(s))
1859#define T_step_assert_gt_u64(s, a, e) \
1860 T_flags_gt_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1861
1862#define T_le_u64(a, e) T_flags_le_ull(a, e, 0)
1863#define T_assert_le_u64(a, e) T_flags_le_ull(a, e, T_CHECK_STOP)
1864#define T_quiet_le_u64(a, e) T_flags_le_ull(a, e, T_CHECK_QUIET)
1865#define T_step_le_u64(s, a, e) T_flags_le_ull(a, e, T_CHECK_STEP(s))
1866#define T_step_assert_le_u64(s, a, e) \
1867 T_flags_le_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1868
1869#define T_lt_u64(a, e) T_flags_lt_ull(a, e, 0)
1870#define T_assert_lt_u64(a, e) T_flags_lt_ull(a, e, T_CHECK_STOP)
1871#define T_quiet_lt_u64(a, e) T_flags_lt_ull(a, e, T_CHECK_QUIET)
1872#define T_step_lt_u64(s, a, e) T_flags_lt_ull(a, e, T_CHECK_STEP(s))
1873#define T_step_assert_lt_u64(s, a, e) \
1874 T_flags_lt_ull(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1875
1888#define T_eq_iptr(a, e) T_flags_eq_long(a, e, 0)
1889#define T_assert_eq_iptr(a, e) T_flags_eq_long(a, e, T_CHECK_STOP)
1890#define T_quiet_eq_iptr(a, e) T_flags_eq_long(a, e, T_CHECK_QUIET)
1891#define T_step_eq_iptr(s, a, e) T_flags_eq_long(a, e, T_CHECK_STEP(s))
1892#define T_step_assert_eq_iptr(s, a, e) \
1893 T_flags_eq_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1894
1895#define T_ne_iptr(a, e) T_flags_ne_long(a, e, 0)
1896#define T_assert_ne_iptr(a, e) T_flags_ne_long(a, e, T_CHECK_STOP)
1897#define T_quiet_ne_iptr(a, e) T_flags_ne_long(a, e, T_CHECK_QUIET)
1898#define T_step_ne_iptr(s, a, e) T_flags_ne_long(a, e, T_CHECK_STEP(s))
1899#define T_step_assert_ne_iptr(s, a, e) \
1900 T_flags_ne_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1901
1902#define T_ge_iptr(a, e) T_flags_ge_long(a, e, 0)
1903#define T_assert_ge_iptr(a, e) T_flags_ge_long(a, e, T_CHECK_STOP)
1904#define T_quiet_ge_iptr(a, e) T_flags_ge_long(a, e, T_CHECK_QUIET)
1905#define T_step_ge_iptr(s, a, e) T_flags_ge_long(a, e, T_CHECK_STEP(s))
1906#define T_step_assert_ge_iptr(s, a, e) \
1907 T_flags_ge_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1908
1909#define T_gt_iptr(a, e) T_flags_gt_long(a, e, 0)
1910#define T_assert_gt_iptr(a, e) T_flags_gt_long(a, e, T_CHECK_STOP)
1911#define T_quiet_gt_iptr(a, e) T_flags_gt_long(a, e, T_CHECK_QUIET)
1912#define T_step_gt_iptr(s, a, e) T_flags_gt_long(a, e, T_CHECK_STEP(s))
1913#define T_step_assert_gt_iptr(s, a, e) \
1914 T_flags_gt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1915
1916#define T_le_iptr(a, e) T_flags_le_long(a, e, 0)
1917#define T_assert_le_iptr(a, e) T_flags_le_long(a, e, T_CHECK_STOP)
1918#define T_quiet_le_iptr(a, e) T_flags_le_long(a, e, T_CHECK_QUIET)
1919#define T_step_le_iptr(s, a, e) T_flags_le_long(a, e, T_CHECK_STEP(s))
1920#define T_step_assert_le_iptr(s, a, e) \
1921 T_flags_le_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1922
1923#define T_lt_iptr(a, e) T_flags_lt_long(a, e, 0)
1924#define T_assert_lt_iptr(a, e) T_flags_lt_long(a, e, T_CHECK_STOP)
1925#define T_quiet_lt_iptr(a, e) T_flags_lt_long(a, e, T_CHECK_QUIET)
1926#define T_step_lt_iptr(s, a, e) T_flags_lt_long(a, e, T_CHECK_STEP(s))
1927#define T_step_assert_lt_iptr(s, a, e) \
1928 T_flags_lt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1929
1942#define T_eq_uptr(a, e) T_flags_eq_ulong(a, e, 0)
1943#define T_assert_eq_uptr(a, e) T_flags_eq_ulong(a, e, T_CHECK_STOP)
1944#define T_quiet_eq_uptr(a, e) T_flags_eq_ulong(a, e, T_CHECK_QUIET)
1945#define T_step_eq_uptr(s, a, e) T_flags_eq_ulong(a, e, T_CHECK_STEP(s))
1946#define T_step_assert_eq_uptr(s, a, e) \
1947 T_flags_eq_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1948
1949#define T_ne_uptr(a, e) T_flags_ne_ulong(a, e, 0)
1950#define T_assert_ne_uptr(a, e) T_flags_ne_ulong(a, e, T_CHECK_STOP)
1951#define T_quiet_ne_uptr(a, e) T_flags_ne_ulong(a, e, T_CHECK_QUIET)
1952#define T_step_ne_uptr(s, a, e) T_flags_ne_ulong(a, e, T_CHECK_STEP(s))
1953#define T_step_assert_ne_uptr(s, a, e) \
1954 T_flags_ne_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1955
1956#define T_ge_uptr(a, e) T_flags_ge_ulong(a, e, 0)
1957#define T_assert_ge_uptr(a, e) T_flags_ge_ulong(a, e, T_CHECK_STOP)
1958#define T_quiet_ge_uptr(a, e) T_flags_ge_ulong(a, e, T_CHECK_QUIET)
1959#define T_step_ge_uptr(s, a, e) T_flags_ge_ulong(a, e, T_CHECK_STEP(s))
1960#define T_step_assert_ge_uptr(s, a, e) \
1961 T_flags_ge_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1962
1963#define T_gt_uptr(a, e) T_flags_gt_ulong(a, e, 0)
1964#define T_assert_gt_uptr(a, e) T_flags_gt_ulong(a, e, T_CHECK_STOP)
1965#define T_quiet_gt_uptr(a, e) T_flags_gt_ulong(a, e, T_CHECK_QUIET)
1966#define T_step_gt_uptr(s, a, e) T_flags_gt_ulong(a, e, T_CHECK_STEP(s))
1967#define T_step_assert_gt_uptr(s, a, e) \
1968 T_flags_gt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1969
1970#define T_le_uptr(a, e) T_flags_le_ulong(a, e, 0)
1971#define T_assert_le_uptr(a, e) T_flags_le_ulong(a, e, T_CHECK_STOP)
1972#define T_quiet_le_uptr(a, e) T_flags_le_ulong(a, e, T_CHECK_QUIET)
1973#define T_step_le_uptr(s, a, e) T_flags_le_ulong(a, e, T_CHECK_STEP(s))
1974#define T_step_assert_le_uptr(s, a, e) \
1975 T_flags_le_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1976
1977#define T_lt_uptr(a, e) T_flags_lt_ulong(a, e, 0)
1978#define T_assert_lt_uptr(a, e) T_flags_lt_ulong(a, e, T_CHECK_STOP)
1979#define T_quiet_lt_uptr(a, e) T_flags_lt_ulong(a, e, T_CHECK_QUIET)
1980#define T_step_lt_uptr(s, a, e) T_flags_lt_ulong(a, e, T_CHECK_STEP(s))
1981#define T_step_assert_lt_uptr(s, a, e) \
1982 T_flags_lt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
1983
1996#define T_eq_ssz(a, e) T_flags_eq_long(a, e, 0)
1997#define T_assert_eq_ssz(a, e) T_flags_eq_long(a, e, T_CHECK_STOP)
1998#define T_quiet_eq_ssz(a, e) T_flags_eq_long(a, e, T_CHECK_QUIET)
1999#define T_step_eq_ssz(s, a, e) T_flags_eq_long(a, e, T_CHECK_STEP(s))
2000#define T_step_assert_eq_ssz(s, a, e) \
2001 T_flags_eq_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2002
2003#define T_ne_ssz(a, e) T_flags_ne_long(a, e, 0)
2004#define T_assert_ne_ssz(a, e) T_flags_ne_long(a, e, T_CHECK_STOP)
2005#define T_quiet_ne_ssz(a, e) T_flags_ne_long(a, e, T_CHECK_QUIET)
2006#define T_step_ne_ssz(s, a, e) T_flags_ne_long(a, e, T_CHECK_STEP(s))
2007#define T_step_assert_ne_ssz(s, a, e) \
2008 T_flags_ne_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2009
2010#define T_ge_ssz(a, e) T_flags_ge_long(a, e, 0)
2011#define T_assert_ge_ssz(a, e) T_flags_ge_long(a, e, T_CHECK_STOP)
2012#define T_quiet_ge_ssz(a, e) T_flags_ge_long(a, e, T_CHECK_QUIET)
2013#define T_step_ge_ssz(s, a, e) T_flags_ge_long(a, e, T_CHECK_STEP(s))
2014#define T_step_assert_ge_ssz(s, a, e) \
2015 T_flags_ge_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2016
2017#define T_gt_ssz(a, e) T_flags_gt_long(a, e, 0)
2018#define T_assert_gt_ssz(a, e) T_flags_gt_long(a, e, T_CHECK_STOP)
2019#define T_quiet_gt_ssz(a, e) T_flags_gt_long(a, e, T_CHECK_QUIET)
2020#define T_step_gt_ssz(s, a, e) T_flags_gt_long(a, e, T_CHECK_STEP(s))
2021#define T_step_assert_gt_ssz(s, a, e) \
2022 T_flags_gt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2023
2024#define T_le_ssz(a, e) T_flags_le_long(a, e, 0)
2025#define T_assert_le_ssz(a, e) T_flags_le_long(a, e, T_CHECK_STOP)
2026#define T_quiet_le_ssz(a, e) T_flags_le_long(a, e, T_CHECK_QUIET)
2027#define T_step_le_ssz(s, a, e) T_flags_le_long(a, e, T_CHECK_STEP(s))
2028#define T_step_assert_le_ssz(s, a, e) \
2029 T_flags_le_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2030
2031#define T_lt_ssz(a, e) T_flags_lt_long(a, e, 0)
2032#define T_assert_lt_ssz(a, e) T_flags_lt_long(a, e, T_CHECK_STOP)
2033#define T_quiet_lt_ssz(a, e) T_flags_lt_long(a, e, T_CHECK_QUIET)
2034#define T_step_lt_ssz(s, a, e) T_flags_lt_long(a, e, T_CHECK_STEP(s))
2035#define T_step_assert_lt_ssz(s, a, e) \
2036 T_flags_lt_long(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2037
2050#define T_eq_sz(a, e) T_flags_eq_ulong(a, e, 0)
2051#define T_assert_eq_sz(a, e) T_flags_eq_ulong(a, e, T_CHECK_STOP)
2052#define T_quiet_eq_sz(a, e) T_flags_eq_ulong(a, e, T_CHECK_QUIET)
2053#define T_step_eq_sz(s, a, e) T_flags_eq_ulong(a, e, T_CHECK_STEP(s))
2054#define T_step_assert_eq_sz(s, a, e) \
2055 T_flags_eq_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2056
2057#define T_ne_sz(a, e) T_flags_ne_ulong(a, e, 0)
2058#define T_assert_ne_sz(a, e) T_flags_ne_ulong(a, e, T_CHECK_STOP)
2059#define T_quiet_ne_sz(a, e) T_flags_ne_ulong(a, e, T_CHECK_QUIET)
2060#define T_step_ne_sz(s, a, e) T_flags_ne_ulong(a, e, T_CHECK_STEP(s))
2061#define T_step_assert_ne_sz(s, a, e) \
2062 T_flags_ne_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2063
2064#define T_ge_sz(a, e) T_flags_ge_ulong(a, e, 0)
2065#define T_assert_ge_sz(a, e) T_flags_ge_ulong(a, e, T_CHECK_STOP)
2066#define T_quiet_ge_sz(a, e) T_flags_ge_ulong(a, e, T_CHECK_QUIET)
2067#define T_step_ge_sz(s, a, e) T_flags_ge_ulong(a, e, T_CHECK_STEP(s))
2068#define T_step_assert_ge_sz(s, a, e) \
2069 T_flags_ge_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2070
2071#define T_gt_sz(a, e) T_flags_gt_ulong(a, e, 0)
2072#define T_assert_gt_sz(a, e) T_flags_gt_ulong(a, e, T_CHECK_STOP)
2073#define T_quiet_gt_sz(a, e) T_flags_gt_ulong(a, e, T_CHECK_QUIET)
2074#define T_step_gt_sz(s, a, e) T_flags_gt_ulong(a, e, T_CHECK_STEP(s))
2075#define T_step_assert_gt_sz(s, a, e) \
2076 T_flags_gt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2077
2078#define T_le_sz(a, e) T_flags_le_ulong(a, e, 0)
2079#define T_assert_le_sz(a, e) T_flags_le_ulong(a, e, T_CHECK_STOP)
2080#define T_quiet_le_sz(a, e) T_flags_le_ulong(a, e, T_CHECK_QUIET)
2081#define T_step_le_sz(s, a, e) T_flags_le_ulong(a, e, T_CHECK_STEP(s))
2082#define T_step_assert_le_sz(s, a, e) \
2083 T_flags_le_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2084
2085#define T_lt_sz(a, e) T_flags_lt_ulong(a, e, 0)
2086#define T_assert_lt_sz(a, e) T_flags_lt_ulong(a, e, T_CHECK_STOP)
2087#define T_quiet_lt_sz(a, e) T_flags_lt_ulong(a, e, T_CHECK_QUIET)
2088#define T_step_lt_sz(s, a, e) T_flags_lt_ulong(a, e, T_CHECK_STEP(s))
2089#define T_step_assert_lt_sz(s, a, e) \
2090 T_flags_lt_ulong(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2091
2104const char *T_strerror(int);
2105
2106#define T_eno(a, e) T_flags_eno(a, e, 0)
2107#define T_assert_eno(a, e) T_flags_eno(a, e, T_CHECK_STOP)
2108#define T_quiet_eno(a, e) T_flags_eno(a, e, T_CHECK_QUIET)
2109#define T_step_eno(s, a, e) T_flags_eno(a, e, T_CHECK_STEP(s))
2110#define T_step_assert_eno(s, a, e) \
2111 T_flags_eno(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2112
2113#define T_eno_success(a) T_flags_eno_success(a, 0)
2114#define T_assert_eno_success(a) T_flags_eno_success(a, T_CHECK_STOP)
2115#define T_quiet_eno_success(a) T_flags_eno_success(a, T_CHECK_QUIET)
2116#define T_step_eno_success(s, a) T_flags_eno_success(a, T_CHECK_STEP(s))
2117#define T_step_assert_eno_success(s, a) \
2118 T_flags_eno_success(a, T_CHECK_STEP(s) | T_CHECK_STOP)
2119
2120#define T_psx_error(a, eno) T_flags_psx_error(a, eno, 0)
2121#define T_assert_psx_error(a, eno) T_flags_psx_error(a, eno, T_CHECK_STOP)
2122#define T_quiet_psx_error(a, eno) T_flags_psx_error(a, eno, T_CHECK_QUIET)
2123#define T_step_psx_error(s, a, eno) T_flags_psx_error(a, eno, T_CHECK_STEP(s))
2124#define T_step_assert_psx_error(s, a, eno) \
2125 T_flags_psx_error(a, eno, T_CHECK_STEP(s) | T_CHECK_STOP)
2126
2127#define T_psx_success(a) T_flags_psx_success(a, 0)
2128#define T_assert_psx_success(a) T_flags_psx_success(a, T_CHECK_STOP)
2129#define T_quiet_psx_success(a) T_flags_psx_success(a, T_CHECK_QUIET)
2130#define T_step_psx_success(s, a) T_flags_psx_success(a, T_CHECK_STEP(s))
2131#define T_step_assert_psx_success(s, a) \
2132 T_flags_psx_success(a, T_CHECK_STEP(s) | T_CHECK_STOP)
2133
2136#ifdef __rtems__
2137void T_check_rsc(const T_check_context *, uint32_t, uint32_t);
2138
2139#define T_flags_rsc(a, e, flags) \
2140{ \
2141 static const T_check_context T_check_instance = { \
2142 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
2143 T_check_rsc(&T_check_instance, a, e); \
2144}
2145
2146void T_check_rsc_success(const T_check_context *, uint32_t);
2147
2148#define T_flags_rsc_success(a, flags) \
2149{ \
2150 static const T_check_context T_check_instance = { \
2151 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
2152 T_check_rsc_success(&T_check_instance, a); \
2153}
2154
2165#define T_rsc(a, e) T_flags_rsc(a, e, 0)
2166#define T_assert_rsc(a, e) T_flags_rsc(a, e, T_CHECK_STOP)
2167#define T_quiet_rsc(a, e) T_flags_rsc(a, e, T_CHECK_QUIET)
2168#define T_step_rsc(s, a, e) T_flags_rsc(a, e, T_CHECK_STEP(s))
2169#define T_step_assert_rsc(s, a, e) \
2170 T_flags_rsc(a, e, T_CHECK_STEP(s) | T_CHECK_STOP)
2171
2172#define T_rsc_success(a) T_flags_rsc_success(a, 0)
2173#define T_assert_rsc_success(a) T_flags_rsc_success(a, T_CHECK_STOP)
2174#define T_quiet_rsc_success(a) T_flags_rsc_success(a, T_CHECK_QUIET)
2175#define T_step_rsc_success(s, a) T_flags_rsc_success(a, T_CHECK_STEP(s))
2176#define T_step_assert_rsc_success(s, a) \
2177 T_flags_rsc_success(a, T_CHECK_STEP(s) | T_CHECK_STOP)
2178
2180#endif /* __rtems__ */
2181
2182void T_plan(unsigned int);
2183
2184extern const T_fixture T_empty_fixture;
2185
2186void T_push_plan(T_fixture_node *, unsigned int);
2187
2188void T_pop_plan(void);
2189
2190void T_check_step(const T_check_context *, unsigned int);
2191
2192#define T_flags_step(a, flags) \
2193{ \
2194 static const T_check_context T_check_instance = { \
2195 T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }; \
2196 T_check_step(&T_check_instance, a); \
2197}
2198
2199#define T_step(e) T_flags_step(e, 0)
2200#define T_step_assert(e) T_flags_step(e, T_CHECK_STOP)
2201
2212#ifdef __rtems__
2213typedef CPU_Counter_ticks T_ticks;
2214#else
2215typedef unsigned long T_ticks;
2216#endif
2217
2218typedef uint64_t T_time;
2219
2220/* More than enough for sizeof("18446744073.709552765") */
2221typedef char T_time_string[24];
2222
2223const char *T_time_to_string_ns(T_time, T_time_string);
2224
2225const char *T_time_to_string_us(T_time, T_time_string);
2226
2227const char *T_time_to_string_ms(T_time, T_time_string);
2228
2229const char *T_time_to_string_s(T_time, T_time_string);
2230
2231const char *T_ticks_to_string_ns(T_ticks, T_time_string);
2232
2233const char *T_ticks_to_string_us(T_ticks, T_time_string);
2234
2235const char *T_ticks_to_string_ms(T_ticks, T_time_string);
2236
2237const char *T_ticks_to_string_s(T_ticks, T_time_string);
2238
2239T_time T_ticks_to_time(T_ticks);
2240
2241T_ticks T_time_to_ticks(T_time);
2242
2243T_time T_seconds_and_nanoseconds_to_time(uint32_t, uint32_t);
2244
2245void T_time_to_seconds_and_nanoseconds(T_time, uint32_t *, uint32_t *);
2246
2247T_time T_now(void);
2248
2249#ifdef __rtems__
2250static inline T_ticks
2251T_tick(void)
2252{
2253 return _CPU_Counter_read();
2254}
2255#else
2256T_ticks T_tick(void);
2257#endif
2258
2259T_time T_now_clock(void);
2260
2261T_time T_now_dummy(void);
2262
2263T_time T_now_tick(void);
2264
2265T_time T_case_begin_time(void);
2266
2269void *T_malloc(size_t);
2270
2271void *T_calloc(size_t, size_t);
2272
2273void *T_zalloc(size_t, void (*)(void *));
2274
2275void T_free(void *);
2276
2277void T_register(void);
2278
2279typedef enum {
2280 T_EVENT_RUN_INITIALIZE_EARLY,
2281 T_EVENT_RUN_INITIALIZE_LATE,
2282 T_EVENT_CASE_EARLY,
2283 T_EVENT_CASE_BEGIN,
2284 T_EVENT_CASE_END,
2285 T_EVENT_CASE_LATE,
2286 T_EVENT_CASE_STOP,
2287 T_EVENT_RUN_FINALIZE_EARLY,
2288 T_EVENT_RUN_FINALIZE_LATE
2289} T_event;
2290
2291typedef void (*T_action)(T_event, const char *);
2292
2293typedef void (*T_putchar)(int, void *);
2294
2295typedef struct {
2296 const char *name;
2297 char *buf;
2298 size_t buf_size;
2299 T_putchar putchar;
2300 void *putchar_arg;
2301 T_verbosity verbosity;
2302 T_time (*now)(void);
2303 void *(*allocate)(size_t);
2304 void (*deallocate)(void *);
2305 size_t action_count;
2306 const T_action *actions;
2307} T_config;
2308
2309void T_putchar_default(int, void *);
2310
2311int T_main(const T_config *);
2312
2313void T_make_runner(void);
2314
2315bool T_is_runner(void);
2316
2317void T_run_initialize(const T_config *);
2318
2319void T_run_all(void);
2320
2321void T_run_by_name(const char *);
2322
2323void *T_case_begin(const char *, const T_fixture *);
2324
2325void T_case_end(void);
2326
2327bool T_run_finalize(void);
2328
2329void T_set_putchar(T_putchar, void *, T_putchar *, void **);
2330
2331void *T_fixture_context(void);
2332
2333void T_set_fixture_context(void *);
2334
2335void T_add_remark(T_remark *);
2336
2337void *T_push_fixture(T_fixture_node *, const T_fixture *);
2338
2339void T_pop_fixture(void);
2340
2341T_NO_RETURN void T_stop(void);
2342
2343#define T_unreachable() \
2344 do { T_true(false, "Unreachable"); T_stop(); } while (0)
2345
2365size_t T_get_scope(
2366 const char * const * const *desc,
2367 char *buf,
2368 size_t n,
2369 const size_t *second_indices
2370);
2371
2372size_t T_str_copy(char *, const char *, size_t);
2373
2374#ifdef __rtems__
2375#define T_TEST_CASE_FIXTURE(name, fixture) \
2376void T_case_body_##name(void); \
2377T_case_context T_case_instance_##name = { \
2378 #name, \
2379 T_case_body_##name, \
2380 fixture, \
2381 NULL \
2382}; \
2383static T_case_context * const T_case_item_##name \
2384__attribute__((__section__(".rtemsroset._T.content.0." #name))) \
2385__attribute__((__used__)) = &T_case_instance_##name; \
2386void T_case_body_##name(void)
2387#else /* __rtems__ */
2388#define T_TEST_CASE_FIXTURE(name, fixture) \
2389void T_case_body_##name(void); \
2390T_case_context T_case_instance_##name = { \
2391 #name, \
2392 T_case_body_##name, \
2393 fixture, \
2394 NULL \
2395}; \
2396__attribute__((__constructor__)) static void \
2397T_case_register_##name(void) \
2398{ \
2399 T_case_register(&T_case_instance_##name); \
2400} \
2401void T_case_body_##name(void)
2402#endif /* __rtems__ */
2403
2404#define T_TEST_CASE(name) T_TEST_CASE_FIXTURE(name, NULL)
2405
2406void T_busy(uint_fast32_t);
2407
2408uint_fast32_t T_get_one_clock_tick_busy(void);
2409
2410typedef enum {
2411 T_INTERRUPT_TEST_INITIAL,
2412 T_INTERRUPT_TEST_ACTION,
2413 T_INTERRUPT_TEST_BLOCKED,
2414 T_INTERRUPT_TEST_CONTINUE,
2415 T_INTERRUPT_TEST_DONE,
2416 T_INTERRUPT_TEST_EARLY,
2417 T_INTERRUPT_TEST_INTERRUPT,
2418 T_INTERRUPT_TEST_LATE,
2419 T_INTERRUPT_TEST_TIMEOUT
2420} T_interrupt_test_state;
2421
2422typedef struct {
2423 void (*prepare)(void *);
2424 void (*action)(void *);
2425 T_interrupt_test_state (*interrupt)(void *);
2426 void (*blocked)(void *);
2427 uint32_t max_iteration_count;
2429
2430T_interrupt_test_state T_interrupt_test_change_state(T_interrupt_test_state,
2431 T_interrupt_test_state);
2432
2433T_interrupt_test_state T_interrupt_test_get_state(void);
2434
2435void T_interrupt_test_busy_wait_for_interrupt(void);
2436
2437T_interrupt_test_state T_interrupt_test(const T_interrupt_test_config *config,
2438 void *arg);
2439
2440typedef struct {
2441 uint32_t executing;
2442 uint32_t heir;
2443 uint32_t cpu;
2444 T_time instant;
2446
2447typedef struct {
2448 size_t recorded;
2449 size_t capacity;
2450 uint64_t switches;
2452
2453typedef struct {
2455 T_thread_switch_event events[T_ZERO_LENGTH_ARRAY];
2457
2458typedef struct {
2460 T_thread_switch_event events[2];
2462
2463typedef struct {
2465 T_thread_switch_event events[4];
2467
2468typedef struct {
2470 T_thread_switch_event events[10];
2472
2473T_thread_switch_log *T_thread_switch_record(T_thread_switch_log *);
2474
2475T_thread_switch_log *T_thread_switch_record_2(T_thread_switch_log_2 *);
2476
2477T_thread_switch_log *T_thread_switch_record_4(T_thread_switch_log_4 *);
2478
2479T_thread_switch_log *T_thread_switch_record_10(T_thread_switch_log_10 *);
2480
2481void T_report_hash_sha256(T_event, const char *);
2482
2483void T_report_hash_sha256_update(char c);
2484
2485void T_check_heap(T_event, const char *);
2486
2487#ifdef __rtems__
2488void T_memory_action(T_event, const char *);
2489
2490void *T_memory_allocate(size_t);
2491
2492void T_memory_deallocate(void *);
2493
2494void T_check_task_context(T_event, const char *);
2495
2496void T_check_file_descriptors(T_event, const char *);
2497
2498void T_check_rtems_barriers(T_event, const char *);
2499
2500void T_check_rtems_extensions(T_event, const char *);
2501
2502void T_check_rtems_message_queues(T_event, const char *);
2503
2504void T_check_rtems_partitions(T_event, const char *);
2505
2506void T_check_rtems_periods(T_event, const char *);
2507
2508void T_check_rtems_regions(T_event, const char *);
2509
2510void T_check_rtems_semaphores(T_event, const char *);
2511
2512void T_check_rtems_tasks(T_event, const char *);
2513
2514void T_check_rtems_timers(T_event, const char *);
2515
2516void T_check_posix_keys(T_event, const char *);
2517
2518void T_check_posix_message_queues(T_event, const char *);
2519
2520void T_check_posix_semaphores(T_event, const char *);
2521
2522void T_check_posix_shms(T_event, const char *);
2523
2524void T_check_posix_threads(T_event, const char *);
2525
2526void T_check_posix_timers(T_event, const char *);
2527
2528typedef enum {
2529 T_THREAD_TIMER_NO_THREAD,
2530 T_THREAD_TIMER_SCHEDULED,
2531 T_THREAD_TIMER_PENDING,
2532 T_THREAD_TIMER_INACTIVE
2533} T_thread_timer_state;
2534
2535T_thread_timer_state T_get_thread_timer_state(uint32_t);
2536
2537void *T_seize_objects(rtems_status_code (*)(void *, uint32_t *), void *);
2538
2539void T_surrender_objects(void **, rtems_status_code (*)(uint32_t));
2540#endif /* __rtems__ */
2541
2552typedef struct T_destructor {
2553 struct {
2554 struct T_destructor *le_next;
2555 struct T_destructor **le_prev;
2556 } node;
2557 void (*destroy)(struct T_destructor *);
2558} T_destructor;
2559
2560void T_add_destructor(T_destructor *, void (*)(T_destructor *));
2561
2562void T_remove_destructor(T_destructor *);
2563
2577
2578typedef struct {
2579 size_t sample_count;
2581
2582typedef struct {
2583 const char *name;
2584 int flags;
2585 void (*setup)(void *);
2586 void (*body)(void *);
2587 bool (*teardown)(void *, T_ticks *, uint32_t, uint32_t, unsigned int);
2588 void *arg;
2590
2591#define T_MEASURE_RUNTIME_ALLOW_CLOCK_ISR 0x1
2592
2593#define T_MEASURE_RUNTIME_REPORT_SAMPLES 0x2
2594
2595#define T_MEASURE_RUNTIME_DISABLE_FULL_CACHE 0x10
2596
2597#define T_MEASURE_RUNTIME_DISABLE_HOT_CACHE 0x20
2598
2599#define T_MEASURE_RUNTIME_DISABLE_DIRTY_CACHE 0x40
2600
2601#define T_MEASURE_RUNTIME_DISABLE_MINOR_LOAD 0x80
2602
2603#define T_MEASURE_RUNTIME_DISABLE_MAX_LOAD 0x100
2604
2605T_measure_runtime_context *T_measure_runtime_create(
2606 const T_measure_runtime_config *);
2607
2608void T_measure_runtime(T_measure_runtime_context *,
2610
2613#ifdef __cplusplus
2614}
2615#endif /* __cplusplus */
2616
2617#endif /* THE_T_TEST_FRAMEWORK_H */
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
CPU_Counter_ticks _CPU_Counter_read(void)
Gets the current CPU counter value.
Definition: system-clocks.c:130
This header file provides the status codes of Classic API directives and support functions.
Definition: test.h:128
Definition: test.h:158
Definition: test.h:152
Definition: test.h:2295
Definition: test.h:2552
Definition: test.h:79
Definition: test.h:71
Definition: test.h:2422
Definition: test.h:2578
Definition: t-test-rtems-measure.c:55
Definition: test.h:2582
Definition: test.h:89
Definition: test.h:2440
Definition: test.h:2447
Definition: test.h:2468
Definition: test.h:2458
Definition: test.h:2463
Definition: test.h:2453
Definition: deflate.c:114
Definition: mongoose.c:448
Definition: b1553brm.c:94
size_t T_get_scope(const char *const *const *desc, char *buf, size_t n, const size_t *second_indices)
Gets the scope for nested fixtures.
Definition: t-test.c:1329