File indexing completed on 2025-05-11 08:24:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #include <rtems/test.h>
0038
0039 #include <inttypes.h>
0040
0041 void
0042 T_check_eq_ptr(const T_check_context_msg *t, uintptr_t a, uintptr_t e)
0043 {
0044 T_check(&t->base, a == e, "%s", t->msg);
0045 }
0046
0047 void
0048 T_check_ne_ptr(const T_check_context_msg *t, uintptr_t a, uintptr_t e)
0049 {
0050 T_check(&t->base, a != e, "%s", t->msg);
0051 }
0052
0053 void
0054 T_check_null(const T_check_context_msg *t, uintptr_t a)
0055 {
0056 T_check(&t->base, a == 0, "%s == NULL", t->msg);
0057 }
0058
0059 void
0060 T_check_not_null(const T_check_context_msg *t, uintptr_t a)
0061 {
0062 T_check(&t->base, a != 0, "%s != NULL", t->msg);
0063 }
0064
0065 void
0066 T_check_eq_mem(const T_check_context_msg *t, const void *a, const void *e,
0067 size_t n)
0068 {
0069 T_check(&t->base, memcmp(a, e, n) == 0, "%s", t->msg);
0070 }
0071
0072 void
0073 T_check_ne_mem(const T_check_context_msg *t, const void *a, const void *e,
0074 size_t n)
0075 {
0076 T_check(&t->base, memcmp(a, e, n) != 0, "%s", t->msg);
0077 }
0078
0079 void
0080 T_check_eq_str(const T_check_context *t, const char *a, const char *e)
0081 {
0082 T_check(t, strcmp(a, e) == 0, "\"%s\" == \"%s\"", a, e);
0083 }
0084
0085 void
0086 T_check_ne_str(const T_check_context *t, const char *a, const char *e)
0087 {
0088 T_check(t, strcmp(a, e) != 0, "\"%s\" != \"%s\"", a, e);
0089 }
0090
0091 void
0092 T_check_eq_nstr(const T_check_context *t, const char *a, const char *e, size_t n)
0093 {
0094 T_check(t, strncmp(a, e, n) == 0, "\"%.*s\" == \"%.*s\"", (int)n, a,
0095 (int)n, e);
0096 }
0097
0098 void
0099 T_check_ne_nstr(const T_check_context *t, const char *a, const char *e, size_t n)
0100 {
0101 T_check(t, strncmp(a, e, n) != 0, "\"%.*s\" != \"%.*s\"", (int)n, a,
0102 (int)n, e);
0103 }
0104
0105 void
0106 T_check_eq_char(const T_check_context *t, char a, char e)
0107 {
0108 T_check(t, a == e, "'%c' == '%c'", a, e);
0109 }
0110
0111 void
0112 T_check_ne_char(const T_check_context *t, char a, char e)
0113 {
0114 T_check(t, a != e, "'%c' != '%c'", a, e);
0115 }
0116
0117 void
0118 T_check_eq_int(const T_check_context *t, int a, int e)
0119 {
0120 T_check(t, a == e, "%i == %i", a, e);
0121 }
0122
0123 void
0124 T_check_ne_int(const T_check_context *t, int a, int e)
0125 {
0126 T_check(t, a != e, "%i != %i", a, e);
0127 }
0128
0129 void
0130 T_check_ge_int(const T_check_context *t, int a, int e)
0131 {
0132 T_check(t, a >= e, "%i >= %i", a, e);
0133 }
0134
0135 void
0136 T_check_gt_int(const T_check_context *t, int a, int e)
0137 {
0138 T_check(t, a > e, "%i > %i", a, e);
0139 }
0140
0141 void
0142 T_check_le_int(const T_check_context *t, int a, int e)
0143 {
0144 T_check(t, a <= e, "%i <= %i", a, e);
0145 }
0146
0147 void
0148 T_check_lt_int(const T_check_context *t, int a, int e)
0149 {
0150 T_check(t, a < e, "%i < %i", a, e);
0151 }
0152
0153 void
0154 T_check_eq_uint(const T_check_context *t, unsigned int a, unsigned int e)
0155 {
0156 T_check(t, a == e, "%u == %u", a, e);
0157 }
0158
0159 void
0160 T_check_ne_uint(const T_check_context *t, unsigned int a, unsigned int e)
0161 {
0162 T_check(t, a != e, "%u != %u", a, e);
0163 }
0164
0165 void
0166 T_check_ge_uint(const T_check_context *t, unsigned int a, unsigned int e)
0167 {
0168 T_check(t, a >= e, "%u >= %u", a, e);
0169 }
0170
0171 void
0172 T_check_gt_uint(const T_check_context *t, unsigned int a, unsigned int e)
0173 {
0174 T_check(t, a > e, "%u > %u", a, e);
0175 }
0176
0177 void
0178 T_check_le_uint(const T_check_context *t, unsigned int a, unsigned int e)
0179 {
0180 T_check(t, a <= e, "%u <= %u", a, e);
0181 }
0182
0183 void
0184 T_check_lt_uint(const T_check_context *t, unsigned int a, unsigned int e)
0185 {
0186 T_check(t, a < e, "%u < %u", a, e);
0187 }
0188
0189 void
0190 T_check_eq_long(const T_check_context *t, long a, long e)
0191 {
0192 T_check(t, a == e, "%li == %li", a, e);
0193 }
0194
0195 void
0196 T_check_ne_long(const T_check_context *t, long a, long e)
0197 {
0198 T_check(t, a != e, "%li != %li", a, e);
0199 }
0200
0201 void
0202 T_check_ge_long(const T_check_context *t, long a, long e)
0203 {
0204 T_check(t, a >= e, "%li >= %li", a, e);
0205 }
0206
0207 void
0208 T_check_gt_long(const T_check_context *t, long a, long e)
0209 {
0210 T_check(t, a > e, "%li > %li", a, e);
0211 }
0212
0213 void
0214 T_check_le_long(const T_check_context *t, long a, long e)
0215 {
0216 T_check(t, a <= e, "%li <= %li", a, e);
0217 }
0218
0219 void
0220 T_check_lt_long(const T_check_context *t, long a, long e)
0221 {
0222 T_check(t, a < e, "%li < %li", a, e);
0223 }
0224
0225 void
0226 T_check_eq_ulong(const T_check_context *t, unsigned long a, unsigned long e)
0227 {
0228 T_check(t, a == e, "%lu == %lu", a, e);
0229 }
0230
0231 void
0232 T_check_ne_ulong(const T_check_context *t, unsigned long a, unsigned long e)
0233 {
0234 T_check(t, a != e, "%lu != %lu", a, e);
0235 }
0236
0237 void
0238 T_check_ge_ulong(const T_check_context *t, unsigned long a, unsigned long e)
0239 {
0240 T_check(t, a >= e, "%lu >= %lu", a, e);
0241 }
0242
0243 void
0244 T_check_gt_ulong(const T_check_context *t, unsigned long a, unsigned long e)
0245 {
0246 T_check(t, a > e, "%lu > %lu", a, e);
0247 }
0248
0249 void
0250 T_check_le_ulong(const T_check_context *t, unsigned long a, unsigned long e)
0251 {
0252 T_check(t, a <= e, "%lu <= %lu", a, e);
0253 }
0254
0255 void
0256 T_check_lt_ulong(const T_check_context *t, unsigned long a, unsigned long e)
0257 {
0258 T_check(t, a < e, "%lu < %lu", a, e);
0259 }
0260
0261 void
0262 T_check_eq_ll(const T_check_context *t, long long a, long long e)
0263 {
0264 T_check(t, a == e, "%lli == %lli", a, e);
0265 }
0266
0267 void
0268 T_check_ne_ll(const T_check_context *t, long long a, long long e)
0269 {
0270 T_check(t, a != e, "%lli != %lli", a, e);
0271 }
0272
0273 void
0274 T_check_ge_ll(const T_check_context *t, long long a, long long e)
0275 {
0276 T_check(t, a >= e, "%lli >= %lli", a, e);
0277 }
0278
0279 void
0280 T_check_gt_ll(const T_check_context *t, long long a, long long e)
0281 {
0282 T_check(t, a > e, "%lli > %lli", a, e);
0283 }
0284
0285 void
0286 T_check_le_ll(const T_check_context *t, long long a, long long e)
0287 {
0288 T_check(t, a <= e, "%lli <= %lli", a, e);
0289 }
0290
0291 void
0292 T_check_lt_ll(const T_check_context *t, long long a, long long e)
0293 {
0294 T_check(t, a < e, "%lli < %lli", a, e);
0295 }
0296
0297 void
0298 T_check_eq_ull(const T_check_context *t, unsigned long long a,
0299 unsigned long long e)
0300 {
0301 T_check(t, a == e, "%llu == %llu", a, e);
0302 }
0303
0304 void
0305 T_check_ne_ull(const T_check_context *t, unsigned long long a,
0306 unsigned long long e)
0307 {
0308 T_check(t, a != e, "%llu != %llu", a, e);
0309 }
0310
0311 void
0312 T_check_ge_ull(const T_check_context *t, unsigned long long a,
0313 unsigned long long e)
0314 {
0315 T_check(t, a >= e, "%llu >= %llu", a, e);
0316 }
0317
0318 void
0319 T_check_gt_ull(const T_check_context *t, unsigned long long a,
0320 unsigned long long e)
0321 {
0322 T_check(t, a > e, "%llu > %llu", a, e);
0323 }
0324
0325 void
0326 T_check_le_ull(const T_check_context *t, unsigned long long a,
0327 unsigned long long e)
0328 {
0329 T_check(t, a <= e, "%llu <= %llu", a, e);
0330 }
0331
0332 void
0333 T_check_lt_ull(const T_check_context *t, unsigned long long a,
0334 unsigned long long e)
0335 {
0336 T_check(t, a < e, "%llu < %llu", a, e);
0337 }