blob: fb45478634a310e2170409fc4e0af8ad915b9742 [file] [log] [blame]
Ronald Cron4b8b1992020-06-09 13:52:23 +02001/**
2 * \file macros.h
3 *
4 * \brief This file contains generic macros for the purpose of testing.
5 */
6
Bence Szépkúti86974652020-06-15 11:59:37 +02007/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02008 * Copyright The Mbed TLS Contributors
Ronald Cron4b8b1992020-06-09 13:52:23 +02009 * SPDX-License-Identifier: Apache-2.0
10 *
11 * Licensed under the Apache License, Version 2.0 (the "License"); you may
12 * not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
14 *
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
Ronald Cron4b8b1992020-06-09 13:52:23 +020022 */
23
24#ifndef TEST_MACROS_H
25#define TEST_MACROS_H
26
27#if !defined(MBEDTLS_CONFIG_FILE)
28#include "mbedtls/config.h"
29#else
30#include MBEDTLS_CONFIG_FILE
31#endif
32
Ronald Cron849930a2020-06-03 08:06:47 +020033#include <stdlib.h>
34
Ronald Cron849930a2020-06-03 08:06:47 +020035#include "mbedtls/platform.h"
Ronald Cron849930a2020-06-03 08:06:47 +020036
37#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
38#include "mbedtls/memory_buffer_alloc.h"
39#endif
40
Chris Jonesa6d155f2021-02-09 12:09:33 +000041/**
42 * \brief This macro tests the expression passed to it as a test step or
43 * individual test in a test case.
44 *
45 * It allows a library function to return a value and return an error
46 * code that can be tested.
47 *
48 * When MBEDTLS_CHECK_PARAMS is enabled, calls to the parameter failure
49 * callback, MBEDTLS_PARAM_FAILED(), will be assumed to be a test
50 * failure.
51 *
52 * This macro is not suitable for negative parameter validation tests,
53 * as it assumes the test step will not create an error.
54 *
55 * Failing the test means:
56 * - Mark this test case as failed.
57 * - Print a message identifying the failure.
58 * - Jump to the \c exit label.
59 *
60 * This macro expands to an instruction, not an expression.
61 * It may jump to the \c exit label.
62 *
63 * \param TEST The test expression to be tested.
64 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +010065#define TEST_ASSERT(TEST) \
Chris Jonesa6d155f2021-02-09 12:09:33 +000066 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +010067 if (!(TEST)) \
68 { \
69 mbedtls_test_fail( #TEST, __LINE__, __FILE__); \
70 goto exit; \
71 } \
72 } while (0)
Chris Jonesa6d155f2021-02-09 12:09:33 +000073
Agathiyan Bragadeesh27e29892023-07-14 17:28:27 +010074/** This macro asserts fails the test with given output message.
75 *
76 * \param MESSAGE The message to be outputed on assertion
77 */
78#define TEST_FAIL(MESSAGE) \
79 do { \
80 mbedtls_test_fail(MESSAGE, __LINE__, __FILE__); \
Agathiyan Bragadeesh1dd20a32023-07-21 17:07:00 +010081 goto exit; \
82 } while (0)
Agathiyan Bragadeesh27e29892023-07-14 17:28:27 +010083
Gilles Peskineb4366492021-04-29 20:28:54 +020084/** Evaluate two integer expressions and fail the test case if they have
85 * different values.
Chris Jonesa6d155f2021-02-09 12:09:33 +000086 *
Gilles Peskineb4366492021-04-29 20:28:54 +020087 * The two expressions should have the same signedness, otherwise the
88 * comparison is not meaningful if the signed value is negative.
89 *
90 * \param expr1 An integral-typed expression to evaluate.
91 * \param expr2 Another integral-typed expression to evaluate.
Chris Jonesa6d155f2021-02-09 12:09:33 +000092 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +010093#define TEST_EQUAL(expr1, expr2) \
Gilles Peskineb4366492021-04-29 20:28:54 +020094 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +010095 if (!mbedtls_test_equal( #expr1 " == " #expr2, __LINE__, __FILE__, \
96 expr1, expr2)) \
97 goto exit; \
98 } while (0)
Chris Jonesa6d155f2021-02-09 12:09:33 +000099
Gilles Peskine063700d2022-04-13 23:59:52 +0200100/** Evaluate two unsigned integer expressions and fail the test case
101 * if they are not in increasing order (left <= right).
102 *
103 * \param expr1 An integral-typed expression to evaluate.
104 * \param expr2 Another integral-typed expression to evaluate.
105 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100106#define TEST_LE_U(expr1, expr2) \
Gilles Peskine063700d2022-04-13 23:59:52 +0200107 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100108 if (!mbedtls_test_le_u( #expr1 " <= " #expr2, __LINE__, __FILE__, \
109 expr1, expr2)) \
110 goto exit; \
111 } while (0)
Gilles Peskine063700d2022-04-13 23:59:52 +0200112
113/** Evaluate two signed integer expressions and fail the test case
114 * if they are not in increasing order (left <= right).
115 *
116 * \param expr1 An integral-typed expression to evaluate.
117 * \param expr2 Another integral-typed expression to evaluate.
118 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100119#define TEST_LE_S(expr1, expr2) \
Gilles Peskine063700d2022-04-13 23:59:52 +0200120 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100121 if (!mbedtls_test_le_s( #expr1 " <= " #expr2, __LINE__, __FILE__, \
122 expr1, expr2)) \
123 goto exit; \
124 } while (0)
Gilles Peskine063700d2022-04-13 23:59:52 +0200125
Chris Jonesa6d155f2021-02-09 12:09:33 +0000126/** Allocate memory dynamically and fail the test case if this fails.
127 * The allocated memory will be filled with zeros.
128 *
129 * You must set \p pointer to \c NULL before calling this macro and
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100130 * put `mbedtls_free(pointer)` in the test's cleanup code.
Chris Jonesa6d155f2021-02-09 12:09:33 +0000131 *
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100132 * If \p item_count is zero, the resulting \p pointer will be \c NULL.
Chris Jonesa6d155f2021-02-09 12:09:33 +0000133 * This is usually what we want in tests since API functions are
134 * supposed to accept null pointers when a buffer size is zero.
135 *
136 * This macro expands to an instruction, not an expression.
137 * It may jump to the \c exit label.
138 *
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100139 * \param pointer An lvalue where the address of the allocated buffer
140 * will be stored.
141 * This expression may be evaluated multiple times.
142 * \param item_count Number of elements to allocate.
143 * This expression may be evaluated multiple times.
Chris Jonesa6d155f2021-02-09 12:09:33 +0000144 *
145 */
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100146#define TEST_CALLOC(pointer, item_count) \
Tom Cosgrove13575022023-09-04 11:05:59 +0100147 do { \
148 TEST_ASSERT((pointer) == NULL); \
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100149 if ((item_count) != 0) { \
Tom Cosgrove13575022023-09-04 11:05:59 +0100150 (pointer) = mbedtls_calloc(sizeof(*(pointer)), \
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100151 (item_count)); \
Tom Cosgrove13575022023-09-04 11:05:59 +0100152 TEST_ASSERT((pointer) != NULL); \
153 } \
154 } while (0)
155
Dave Rodgman72aa6832023-09-19 17:34:39 +0100156/** Allocate memory dynamically and fail the test case if this fails.
157 * The allocated memory will be filled with zeros.
158 *
159 * You must set \p pointer to \c NULL before calling this macro and
160 * put `mbedtls_free(pointer)` in the test's cleanup code.
161 *
162 * If \p item_count is zero, the resulting \p pointer will not be \c NULL.
163 *
164 * This macro expands to an instruction, not an expression.
165 * It may jump to the \c exit label.
166 *
167 * \param pointer An lvalue where the address of the allocated buffer
168 * will be stored.
169 * This expression may be evaluated multiple times.
170 * \param item_count Number of elements to allocate.
171 * This expression may be evaluated multiple times.
172 *
173 */
174#define TEST_CALLOC_NONNULL(pointer, item_count) \
175 do { \
176 TEST_ASSERT((pointer) == NULL); \
177 (pointer) = mbedtls_calloc(sizeof(*(pointer)), \
178 (item_count)); \
179 TEST_ASSERT((pointer) != NULL); \
180 } while (0)
181
Tom Cosgrove13575022023-09-04 11:05:59 +0100182/* For backwards compatibility */
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100183#define ASSERT_ALLOC(pointer, item_count) TEST_CALLOC(pointer, item_count)
Chris Jonesa6d155f2021-02-09 12:09:33 +0000184
185/** Allocate memory dynamically. If the allocation fails, skip the test case.
186 *
Tom Cosgrove30ceb232023-09-04 11:20:19 +0100187 * This macro behaves like #TEST_CALLOC, except that if the allocation
Chris Jonesa6d155f2021-02-09 12:09:33 +0000188 * fails, it marks the test as skipped rather than failed.
189 */
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100190#define TEST_CALLOC_OR_SKIP(pointer, item_count) \
Tom Cosgrove20e27de2023-09-04 11:09:08 +0100191 do { \
192 TEST_ASSERT((pointer) == NULL); \
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100193 if ((item_count) != 0) { \
Tom Cosgrove20e27de2023-09-04 11:09:08 +0100194 (pointer) = mbedtls_calloc(sizeof(*(pointer)), \
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100195 (item_count)); \
Tom Cosgrove20e27de2023-09-04 11:09:08 +0100196 TEST_ASSUME((pointer) != NULL); \
197 } \
198 } while (0)
199
200/* For backwards compatibility */
Tom Cosgrovecd5a7c72023-07-21 11:34:44 +0100201#define ASSERT_ALLOC_WEAK(pointer, item_count) TEST_CALLOC_OR_SKIP(pointer, item_count)
Chris Jonesa6d155f2021-02-09 12:09:33 +0000202
203/** Compare two buffers and fail the test case if they differ.
204 *
205 * This macro expands to an instruction, not an expression.
206 * It may jump to the \c exit label.
207 *
208 * \param p1 Pointer to the start of the first buffer.
209 * \param size1 Size of the first buffer in bytes.
210 * This expression may be evaluated multiple times.
211 * \param p2 Pointer to the start of the second buffer.
212 * \param size2 Size of the second buffer in bytes.
213 * This expression may be evaluated multiple times.
214 */
Tom Cosgroveba3b14d2023-09-04 11:23:02 +0100215#define TEST_MEMORY_COMPARE(p1, size1, p2, size2) \
Tom Cosgrovef88ee8b2023-09-04 11:04:40 +0100216 do { \
Manuel Pégourié-Gonnard3c301912023-02-09 09:15:04 +0100217 TEST_EQUAL((size1), (size2)); \
Tom Cosgrovef88ee8b2023-09-04 11:04:40 +0100218 if ((size1) != 0) { \
219 TEST_ASSERT(memcmp((p1), (p2), (size1)) == 0); \
220 } \
221 } while (0)
222
223/* For backwards compatibility */
Tom Cosgroveba3b14d2023-09-04 11:23:02 +0100224#define ASSERT_COMPARE(p1, size1, p2, size2) TEST_MEMORY_COMPARE(p1, size1, p2, size2)
Chris Jonesa6d155f2021-02-09 12:09:33 +0000225
226/**
227 * \brief This macro tests the expression passed to it and skips the
228 * running test if it doesn't evaluate to 'true'.
229 *
230 * \param TEST The test expression to be tested.
231 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100232#define TEST_ASSUME(TEST) \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000233 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100234 if (!(TEST)) \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000235 { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100236 mbedtls_test_skip( #TEST, __LINE__, __FILE__); \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000237 goto exit; \
238 } \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100239 } while (0)
Chris Jonesa6d155f2021-02-09 12:09:33 +0000240
241#if defined(MBEDTLS_CHECK_PARAMS) && !defined(MBEDTLS_PARAM_FAILED_ALT)
242/**
243 * \brief This macro tests the statement passed to it as a test step or
244 * individual test in a test case. The macro assumes the test will fail
245 * and will generate an error.
246 *
247 * It allows a library function to return a value and tests the return
248 * code on return to confirm the given error code was returned.
249 *
250 * When MBEDTLS_CHECK_PARAMS is enabled, calls to the parameter failure
251 * callback, MBEDTLS_PARAM_FAILED(), are assumed to indicate the
252 * expected failure, and the test will pass.
253 *
254 * This macro is intended for negative parameter validation tests,
255 * where the failing function may return an error value or call
256 * MBEDTLS_PARAM_FAILED() to indicate the error.
257 *
258 * \param PARAM_ERROR_VALUE The expected error code.
259 *
260 * \param TEST The test expression to be tested.
261 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100262#define TEST_INVALID_PARAM_RET(PARAM_ERR_VALUE, TEST) \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000263 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100264 mbedtls_test_param_failed_expect_call(); \
265 if (((TEST) != (PARAM_ERR_VALUE)) || \
266 (mbedtls_test_param_failed_check_expected_call() != 0)) \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000267 { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100268 mbedtls_test_fail( #TEST, __LINE__, __FILE__); \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000269 goto exit; \
270 } \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100271 mbedtls_test_param_failed_check_expected_call(); \
272 } while (0)
Chris Jonesa6d155f2021-02-09 12:09:33 +0000273
274/**
275 * \brief This macro tests the statement passed to it as a test step or
276 * individual test in a test case. The macro assumes the test will fail
277 * and will generate an error.
278 *
279 * It assumes the library function under test cannot return a value and
280 * assumes errors can only be indicated byt calls to
281 * MBEDTLS_PARAM_FAILED().
282 *
283 * When MBEDTLS_CHECK_PARAMS is enabled, calls to the parameter failure
284 * callback, MBEDTLS_PARAM_FAILED(), are assumed to indicate the
285 * expected failure. If MBEDTLS_CHECK_PARAMS is not enabled, no test
286 * can be made.
287 *
288 * This macro is intended for negative parameter validation tests,
289 * where the failing function can only return an error by calling
290 * MBEDTLS_PARAM_FAILED() to indicate the error.
291 *
292 * \param TEST The test expression to be tested.
293 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100294#define TEST_INVALID_PARAM(TEST) \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000295 do { \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100296 memcpy(jmp_tmp, mbedtls_test_param_failed_get_state_buf(), \
297 sizeof(jmp_tmp)); \
298 if (setjmp(mbedtls_test_param_failed_get_state_buf()) == 0) \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000299 { \
300 TEST; \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100301 mbedtls_test_fail( #TEST, __LINE__, __FILE__); \
Chris Jonesa6d155f2021-02-09 12:09:33 +0000302 goto exit; \
303 } \
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100304 mbedtls_test_param_failed_reset_state(); \
305 } while (0)
Chris Jonesa6d155f2021-02-09 12:09:33 +0000306#endif /* MBEDTLS_CHECK_PARAMS && !MBEDTLS_PARAM_FAILED_ALT */
307
308/**
309 * \brief This macro tests the statement passed to it as a test step or
310 * individual test in a test case. The macro assumes the test will not fail.
311 *
312 * It assumes the library function under test cannot return a value and
313 * assumes errors can only be indicated by calls to
314 * MBEDTLS_PARAM_FAILED().
315 *
316 * When MBEDTLS_CHECK_PARAMS is enabled, calls to the parameter failure
317 * callback, MBEDTLS_PARAM_FAILED(), are assumed to indicate the
318 * expected failure. If MBEDTLS_CHECK_PARAMS is not enabled, no test
319 * can be made.
320 *
321 * This macro is intended to test that functions returning void
322 * accept all of the parameter values they're supposed to accept - eg
323 * that they don't call MBEDTLS_PARAM_FAILED() when a parameter
324 * that's allowed to be NULL happens to be NULL.
325 *
326 * Note: for functions that return something other that void,
327 * checking that they accept all the parameters they're supposed to
328 * accept is best done by using TEST_ASSERT() and checking the return
329 * value as well.
330 *
331 * Note: this macro is available even when #MBEDTLS_CHECK_PARAMS is
332 * disabled, as it makes sense to check that the functions accept all
333 * legal values even if this option is disabled - only in that case,
334 * the test is more about whether the function segfaults than about
335 * whether it invokes MBEDTLS_PARAM_FAILED().
336 *
337 * \param TEST The test expression to be tested.
338 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100339#define TEST_VALID_PARAM(TEST) \
340 TEST_ASSERT((TEST, 1));
Chris Jonesa6d155f2021-02-09 12:09:33 +0000341
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100342#define TEST_HELPER_ASSERT(a) if (!(a)) \
343 { \
344 mbedtls_fprintf(stderr, "Assertion Failed at %s:%d - %s\n", \
345 __FILE__, __LINE__, #a); \
346 mbedtls_exit(1); \
347 }
Ronald Cron849930a2020-06-03 08:06:47 +0200348
Gilles Peskinec86a1652021-02-15 12:17:00 +0100349/** \def ARRAY_LENGTH
350 * Return the number of elements of a static or stack array.
351 *
352 * \param array A value of array (not pointer) type.
353 *
354 * \return The number of elements of the array.
355 */
356/* A correct implementation of ARRAY_LENGTH, but which silently gives
357 * a nonsensical result if called with a pointer rather than an array. */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100358#define ARRAY_LENGTH_UNSAFE(array) \
359 (sizeof(array) / sizeof(*(array)))
Gilles Peskinec86a1652021-02-15 12:17:00 +0100360
Ronald Cron849930a2020-06-03 08:06:47 +0200361#if defined(__GNUC__)
362/* Test if arg and &(arg)[0] have the same type. This is true if arg is
363 * an array but not if it's a pointer. */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100364#define IS_ARRAY_NOT_POINTER(arg) \
365 (!__builtin_types_compatible_p(__typeof__(arg), \
366 __typeof__(&(arg)[0])))
Ronald Cron849930a2020-06-03 08:06:47 +0200367/* A compile-time constant with the value 0. If `const_expr` is not a
368 * compile-time constant with a nonzero value, cause a compile-time error. */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100369#define STATIC_ASSERT_EXPR(const_expr) \
370 (0 && sizeof(struct { unsigned int STATIC_ASSERT : 1 - 2 * !(const_expr); }))
Gilles Peskinec86a1652021-02-15 12:17:00 +0100371
Ronald Cron849930a2020-06-03 08:06:47 +0200372/* Return the scalar value `value` (possibly promoted). This is a compile-time
373 * constant if `value` is. `condition` must be a compile-time constant.
374 * If `condition` is false, arrange to cause a compile-time error. */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100375#define STATIC_ASSERT_THEN_RETURN(condition, value) \
376 (STATIC_ASSERT_EXPR(condition) ? 0 : (value))
Ronald Cron849930a2020-06-03 08:06:47 +0200377
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100378#define ARRAY_LENGTH(array) \
379 (STATIC_ASSERT_THEN_RETURN(IS_ARRAY_NOT_POINTER(array), \
380 ARRAY_LENGTH_UNSAFE(array)))
Ronald Cron849930a2020-06-03 08:06:47 +0200381
Gilles Peskinec86a1652021-02-15 12:17:00 +0100382#else
383/* If we aren't sure the compiler supports our non-standard tricks,
384 * fall back to the unsafe implementation. */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100385#define ARRAY_LENGTH(array) ARRAY_LENGTH_UNSAFE(array)
Gilles Peskinec86a1652021-02-15 12:17:00 +0100386#endif
387
Ronald Cron849930a2020-06-03 08:06:47 +0200388/** Return the smaller of two values.
389 *
390 * \param x An integer-valued expression without side effects.
391 * \param y An integer-valued expression without side effects.
392 *
393 * \return The smaller of \p x and \p y.
394 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100395#define MIN(x, y) ((x) < (y) ? (x) : (y))
Ronald Cron849930a2020-06-03 08:06:47 +0200396
397/** Return the larger of two values.
398 *
399 * \param x An integer-valued expression without side effects.
400 * \param y An integer-valued expression without side effects.
401 *
402 * \return The larger of \p x and \p y.
403 */
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100404#define MAX(x, y) ((x) > (y) ? (x) : (y))
Ronald Cron849930a2020-06-03 08:06:47 +0200405
406/*
407 * 32-bit integer manipulation macros (big endian)
408 */
409#ifndef GET_UINT32_BE
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100410#define GET_UINT32_BE(n, b, i) \
411 { \
412 (n) = ((uint32_t) (b)[(i)] << 24) \
413 | ((uint32_t) (b)[(i) + 1] << 16) \
414 | ((uint32_t) (b)[(i) + 2] << 8) \
415 | ((uint32_t) (b)[(i) + 3]); \
416 }
Ronald Cron849930a2020-06-03 08:06:47 +0200417#endif
418
419#ifndef PUT_UINT32_BE
Gilles Peskine1b6c09a2023-01-11 14:52:35 +0100420#define PUT_UINT32_BE(n, b, i) \
421 { \
422 (b)[(i)] = (unsigned char) ((n) >> 24); \
423 (b)[(i) + 1] = (unsigned char) ((n) >> 16); \
424 (b)[(i) + 2] = (unsigned char) ((n) >> 8); \
425 (b)[(i) + 3] = (unsigned char) ((n)); \
426 }
Ronald Cron849930a2020-06-03 08:06:47 +0200427#endif
428
Ronald Cron4b8b1992020-06-09 13:52:23 +0200429#endif /* TEST_MACROS_H */