ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
Loading...
Searching...
No Matches
unity_internals.h
1/* ==========================================
2 Unity Project - A Test Framework for C
3 Copyright (c) 2007-19 Mike Karlesky, Mark VanderVoord, Greg Williams
4 [Released under MIT License. Please refer to license.txt for details]
5========================================== */
6
7#ifndef UNITY_INTERNALS_H
8#define UNITY_INTERNALS_H
9
10#ifdef UNITY_INCLUDE_CONFIG_H
11#include "unity_config.h"
12#endif
13
14#ifndef UNITY_EXCLUDE_SETJMP_H
15#include <setjmp.h>
16#endif
17
18#ifndef UNITY_EXCLUDE_MATH_H
19#include <math.h>
20#endif
21
22#ifndef UNITY_EXCLUDE_STDDEF_H
23#include <stddef.h>
24#endif
25
26#ifdef UNITY_INCLUDE_PRINT_FORMATTED
27#include <stdarg.h>
28#endif
29
30/* Unity Attempts to Auto-Detect Integer Types
31 * Attempt 1: UINT_MAX, ULONG_MAX in <limits.h>, or default to 32 bits
32 * Attempt 2: UINTPTR_MAX in <stdint.h>, or default to same size as long
33 * The user may override any of these derived constants:
34 * UNITY_INT_WIDTH, UNITY_LONG_WIDTH, UNITY_POINTER_WIDTH */
35#ifndef UNITY_EXCLUDE_STDINT_H
36#include <stdint.h>
37#endif
38
39#ifndef UNITY_EXCLUDE_LIMITS_H
40#include <limits.h>
41#endif
42
43/*-------------------------------------------------------
44 * Guess Widths If Not Specified
45 *-------------------------------------------------------*/
46
47/* Determine the size of an int, if not already specified.
48 * We cannot use sizeof(int), because it is not yet defined
49 * at this stage in the translation of the C program.
50 * Also sizeof(int) does return the size in addressable units on all platforms,
51 * which may not necessarily be the size in bytes.
52 * Therefore, infer it from UINT_MAX if possible. */
53#ifndef UNITY_INT_WIDTH
54#ifdef UINT_MAX
55#if (UINT_MAX == 0xFFFF)
56#define UNITY_INT_WIDTH (16)
57#elif (UINT_MAX == 0xFFFFFFFF)
58#define UNITY_INT_WIDTH (32)
59#elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
60#define UNITY_INT_WIDTH (64)
61#endif
62#else /* Set to default */
63#define UNITY_INT_WIDTH (32)
64#endif /* UINT_MAX */
65#endif
66
67/* Determine the size of a long, if not already specified. */
68#ifndef UNITY_LONG_WIDTH
69#ifdef ULONG_MAX
70#if (ULONG_MAX == 0xFFFF)
71#define UNITY_LONG_WIDTH (16)
72#elif (ULONG_MAX == 0xFFFFFFFF)
73#define UNITY_LONG_WIDTH (32)
74#elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF)
75#define UNITY_LONG_WIDTH (64)
76#endif
77#else /* Set to default */
78#define UNITY_LONG_WIDTH (32)
79#endif /* ULONG_MAX */
80#endif
81
82/* Determine the size of a pointer, if not already specified. */
83#ifndef UNITY_POINTER_WIDTH
84#ifdef UINTPTR_MAX
85#if (UINTPTR_MAX <= 0xFFFF)
86#define UNITY_POINTER_WIDTH (16)
87#elif (UINTPTR_MAX <= 0xFFFFFFFF)
88#define UNITY_POINTER_WIDTH (32)
89#elif (UINTPTR_MAX <= 0xFFFFFFFFFFFFFFFF)
90#define UNITY_POINTER_WIDTH (64)
91#endif
92#else /* Set to default */
93#define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH
94#endif /* UINTPTR_MAX */
95#endif
96
97/*-------------------------------------------------------
98 * Int Support (Define types based on detected sizes)
99 *-------------------------------------------------------*/
100
101#if (UNITY_INT_WIDTH == 32)
102typedef unsigned char UNITY_UINT8;
103typedef unsigned short UNITY_UINT16;
104typedef unsigned int UNITY_UINT32;
105typedef signed char UNITY_INT8;
106typedef signed short UNITY_INT16;
107typedef signed int UNITY_INT32;
108#elif (UNITY_INT_WIDTH == 16)
109typedef unsigned char UNITY_UINT8;
110typedef unsigned int UNITY_UINT16;
111typedef unsigned long UNITY_UINT32;
112typedef signed char UNITY_INT8;
113typedef signed int UNITY_INT16;
114typedef signed long UNITY_INT32;
115#else
116#error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported)
117#endif
118
119/*-------------------------------------------------------
120 * 64-bit Support
121 *-------------------------------------------------------*/
122
123/* Auto-detect 64 Bit Support */
124#ifndef UNITY_SUPPORT_64
125#if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64
126#define UNITY_SUPPORT_64
127#endif
128#endif
129
130/* 64-Bit Support Dependent Configuration */
131#ifndef UNITY_SUPPORT_64
132/* No 64-bit Support */
133typedef UNITY_UINT32 UNITY_UINT;
134typedef UNITY_INT32 UNITY_INT;
135#define UNITY_MAX_NIBBLES \
136 (8) /* Maximum number of nibbles in a UNITY_(U)INT \
137 */
138#else
139/* 64-bit Support */
140#if (UNITY_LONG_WIDTH == 32)
141typedef unsigned long long UNITY_UINT64;
142typedef signed long long UNITY_INT64;
143#elif (UNITY_LONG_WIDTH == 64)
144typedef unsigned long UNITY_UINT64;
145typedef signed long UNITY_INT64;
146#else
147#error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported)
148#endif
149typedef UNITY_UINT64 UNITY_UINT;
150typedef UNITY_INT64 UNITY_INT;
151#define UNITY_MAX_NIBBLES \
152 (16) /* Maximum number of nibbles in a UNITY_(U)INT \
153 */
154#endif
155
156/*-------------------------------------------------------
157 * Pointer Support
158 *-------------------------------------------------------*/
159
160#if (UNITY_POINTER_WIDTH == 32)
161#define UNITY_PTR_TO_INT UNITY_INT32
162#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32
163#elif (UNITY_POINTER_WIDTH == 64)
164#define UNITY_PTR_TO_INT UNITY_INT64
165#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64
166#elif (UNITY_POINTER_WIDTH == 16)
167#define UNITY_PTR_TO_INT UNITY_INT16
168#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16
169#else
170#error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported)
171#endif
172
173#ifndef UNITY_PTR_ATTRIBUTE
174#define UNITY_PTR_ATTRIBUTE
175#endif
176
177#ifndef UNITY_INTERNAL_PTR
178#define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const void *
179#endif
180
181/*-------------------------------------------------------
182 * Float Support
183 *-------------------------------------------------------*/
184
185#ifdef UNITY_EXCLUDE_FLOAT
186
187/* No Floating Point Support */
188#ifndef UNITY_EXCLUDE_DOUBLE
189#define UNITY_EXCLUDE_DOUBLE /* Remove double when excluding float support */
190#endif
191#ifndef UNITY_EXCLUDE_FLOAT_PRINT
192#define UNITY_EXCLUDE_FLOAT_PRINT
193#endif
194
195#else
196
197/* Floating Point Support */
198#ifndef UNITY_FLOAT_PRECISION
199#define UNITY_FLOAT_PRECISION (0.00001f)
200#endif
201#ifndef UNITY_FLOAT_TYPE
202#define UNITY_FLOAT_TYPE float
203#endif
204typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
205
206/* isinf & isnan macros should be provided by math.h */
207#ifndef isinf
208/* The value of Inf - Inf is NaN */
209#define isinf(n) (isnan((n) - (n)) && !isnan(n))
210#endif
211
212#ifndef isnan
213/* NaN is the only floating point value that does NOT equal itself.
214 * Therefore if n != n, then it is NaN. */
215#define isnan(n) ((n != n) ? 1 : 0)
216#endif
217
218#endif
219
220/*-------------------------------------------------------
221 * Double Float Support
222 *-------------------------------------------------------*/
223
224/* unlike float, we DON'T include by default */
225#if defined(UNITY_EXCLUDE_DOUBLE) || !defined(UNITY_INCLUDE_DOUBLE)
226
227/* No Floating Point Support */
228#ifndef UNITY_EXCLUDE_DOUBLE
229#define UNITY_EXCLUDE_DOUBLE
230#else
231#undef UNITY_INCLUDE_DOUBLE
232#endif
233
234#ifndef UNITY_EXCLUDE_FLOAT
235#ifndef UNITY_DOUBLE_TYPE
236#define UNITY_DOUBLE_TYPE double
237#endif
238typedef UNITY_FLOAT UNITY_DOUBLE;
239/* For parameter in UnityPrintFloat(UNITY_DOUBLE), which aliases to double or
240 * float */
241#endif
242
243#else
244
245/* Double Floating Point Support */
246#ifndef UNITY_DOUBLE_PRECISION
247#define UNITY_DOUBLE_PRECISION (1e-12)
248#endif
249
250#ifndef UNITY_DOUBLE_TYPE
251#define UNITY_DOUBLE_TYPE double
252#endif
253typedef UNITY_DOUBLE_TYPE UNITY_DOUBLE;
254
255#endif
256
257/*-------------------------------------------------------
258 * Output Method: stdout (DEFAULT)
259 *-------------------------------------------------------*/
260#ifndef UNITY_OUTPUT_CHAR
261/* Default to using putchar, which is defined in stdio.h */
262#include <stdio.h>
263#define UNITY_OUTPUT_CHAR(a) (void)putchar(a)
264#else
265/* If defined as something else, make sure we declare it here so it's ready for
266 * use */
267#ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION
268extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION;
269#endif
270#endif
271
272#ifndef UNITY_OUTPUT_FLUSH
273#ifdef UNITY_USE_FLUSH_STDOUT
274/* We want to use the stdout flush utility */
275#include <stdio.h>
276#define UNITY_OUTPUT_FLUSH() (void)fflush(stdout)
277#else
278/* We've specified nothing, therefore flush should just be ignored */
279#define UNITY_OUTPUT_FLUSH()
280#endif
281#else
282/* If defined as something else, make sure we declare it here so it's ready for
283 * use */
284#ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION
285extern void UNITY_OUTPUT_FLUSH_HEADER_DECLARATION;
286#endif
287#endif
288
289#ifndef UNITY_OUTPUT_FLUSH
290#define UNITY_FLUSH_CALL()
291#else
292#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH()
293#endif
294
295#ifndef UNITY_PRINT_EOL
296#define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n')
297#endif
298
299#ifndef UNITY_OUTPUT_START
300#define UNITY_OUTPUT_START()
301#endif
302
303#ifndef UNITY_OUTPUT_COMPLETE
304#define UNITY_OUTPUT_COMPLETE()
305#endif
306
307#ifdef UNITY_INCLUDE_EXEC_TIME
308#if !defined(UNITY_EXEC_TIME_START) && !defined(UNITY_EXEC_TIME_STOP) && \
309 !defined(UNITY_PRINT_EXEC_TIME) && !defined(UNITY_TIME_TYPE)
310/* If none any of these macros are defined then try to provide a default
311 * implementation */
312
313#if defined(UNITY_CLOCK_MS)
314/* This is a simple way to get a default implementation on platforms that
315 * support getting a millisecond counter */
316#define UNITY_TIME_TYPE UNITY_UINT
317#define UNITY_EXEC_TIME_START() Unity.CurrentTestStartTime = UNITY_CLOCK_MS()
318#define UNITY_EXEC_TIME_STOP() Unity.CurrentTestStopTime = UNITY_CLOCK_MS()
319#define UNITY_PRINT_EXEC_TIME() \
320 { \
321 UNITY_UINT execTimeMs = \
322 (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \
323 UnityPrint(" ("); \
324 UnityPrintNumberUnsigned(execTimeMs); \
325 UnityPrint(" ms)"); \
326 }
327#elif defined(_WIN32)
328#include <time.h>
329#define UNITY_TIME_TYPE clock_t
330#define UNITY_GET_TIME(t) t = (clock_t)((clock() * 1000) / CLOCKS_PER_SEC)
331#define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime)
332#define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime)
333#define UNITY_PRINT_EXEC_TIME() \
334 { \
335 UNITY_UINT execTimeMs = \
336 (Unity.CurrentTestStopTime - Unity.CurrentTestStartTime); \
337 UnityPrint(" ("); \
338 UnityPrintNumberUnsigned(execTimeMs); \
339 UnityPrint(" ms)"); \
340 }
341#elif defined(__unix__)
342#include <time.h>
343#define UNITY_TIME_TYPE struct timespec
344#define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t)
345#define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime)
346#define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime)
347#define UNITY_PRINT_EXEC_TIME() \
348 { \
349 UNITY_UINT execTimeMs = ((Unity.CurrentTestStopTime.tv_sec - \
350 Unity.CurrentTestStartTime.tv_sec) * \
351 1000L); \
352 execTimeMs += ((Unity.CurrentTestStopTime.tv_nsec - \
353 Unity.CurrentTestStartTime.tv_nsec) / \
354 1000000L); \
355 UnityPrint(" ("); \
356 UnityPrintNumberUnsigned(execTimeMs); \
357 UnityPrint(" ms)"); \
358 }
359#endif
360#endif
361#endif
362
363#ifndef UNITY_EXEC_TIME_START
364#define UNITY_EXEC_TIME_START() \
365 do { \
366 } while (0)
367#endif
368
369#ifndef UNITY_EXEC_TIME_STOP
370#define UNITY_EXEC_TIME_STOP() \
371 do { \
372 } while (0)
373#endif
374
375#ifndef UNITY_TIME_TYPE
376#define UNITY_TIME_TYPE UNITY_UINT
377#endif
378
379#ifndef UNITY_PRINT_EXEC_TIME
380#define UNITY_PRINT_EXEC_TIME() \
381 do { \
382 } while (0)
383#endif
384
385/*-------------------------------------------------------
386 * Footprint
387 *-------------------------------------------------------*/
388
389#ifndef UNITY_LINE_TYPE
390#define UNITY_LINE_TYPE UNITY_UINT
391#endif
392
393#ifndef UNITY_COUNTER_TYPE
394#define UNITY_COUNTER_TYPE UNITY_UINT
395#endif
396
397/*-------------------------------------------------------
398 * Internal Structs Needed
399 *-------------------------------------------------------*/
400
401typedef void (*UnityTestFunction)(void);
402
403#define UNITY_DISPLAY_RANGE_INT (0x10)
404#define UNITY_DISPLAY_RANGE_UINT (0x20)
405#define UNITY_DISPLAY_RANGE_HEX (0x40)
406#define UNITY_DISPLAY_RANGE_CHAR (0x80)
407
408typedef enum {
409 UNITY_DISPLAY_STYLE_INT = (UNITY_INT_WIDTH / 8) + UNITY_DISPLAY_RANGE_INT,
410 UNITY_DISPLAY_STYLE_INT8 = 1 + UNITY_DISPLAY_RANGE_INT,
411 UNITY_DISPLAY_STYLE_INT16 = 2 + UNITY_DISPLAY_RANGE_INT,
412 UNITY_DISPLAY_STYLE_INT32 = 4 + UNITY_DISPLAY_RANGE_INT,
413#ifdef UNITY_SUPPORT_64
414 UNITY_DISPLAY_STYLE_INT64 = 8 + UNITY_DISPLAY_RANGE_INT,
415#endif
416
417 UNITY_DISPLAY_STYLE_UINT = (UNITY_INT_WIDTH / 8) + UNITY_DISPLAY_RANGE_UINT,
418 UNITY_DISPLAY_STYLE_UINT8 = 1 + UNITY_DISPLAY_RANGE_UINT,
419 UNITY_DISPLAY_STYLE_UINT16 = 2 + UNITY_DISPLAY_RANGE_UINT,
420 UNITY_DISPLAY_STYLE_UINT32 = 4 + UNITY_DISPLAY_RANGE_UINT,
421#ifdef UNITY_SUPPORT_64
422 UNITY_DISPLAY_STYLE_UINT64 = 8 + UNITY_DISPLAY_RANGE_UINT,
423#endif
424
425 UNITY_DISPLAY_STYLE_HEX8 = 1 + UNITY_DISPLAY_RANGE_HEX,
426 UNITY_DISPLAY_STYLE_HEX16 = 2 + UNITY_DISPLAY_RANGE_HEX,
427 UNITY_DISPLAY_STYLE_HEX32 = 4 + UNITY_DISPLAY_RANGE_HEX,
428#ifdef UNITY_SUPPORT_64
429 UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX,
430#endif
431
432 UNITY_DISPLAY_STYLE_CHAR =
433 1 + UNITY_DISPLAY_RANGE_CHAR + UNITY_DISPLAY_RANGE_INT,
434
435 UNITY_DISPLAY_STYLE_UNKNOWN
436} UNITY_DISPLAY_STYLE_T;
437
438typedef enum {
439 UNITY_WITHIN = 0x0,
440 UNITY_EQUAL_TO = 0x1,
441 UNITY_GREATER_THAN = 0x2,
442 UNITY_GREATER_OR_EQUAL = 0x2 + UNITY_EQUAL_TO,
443 UNITY_SMALLER_THAN = 0x4,
444 UNITY_SMALLER_OR_EQUAL = 0x4 + UNITY_EQUAL_TO,
445 UNITY_NOT_EQUAL = 0x0,
446 UNITY_UNKNOWN
447} UNITY_COMPARISON_T;
448
449#ifndef UNITY_EXCLUDE_FLOAT
450typedef enum UNITY_FLOAT_TRAIT {
451 UNITY_FLOAT_IS_NOT_INF = 0,
452 UNITY_FLOAT_IS_INF,
453 UNITY_FLOAT_IS_NOT_NEG_INF,
454 UNITY_FLOAT_IS_NEG_INF,
455 UNITY_FLOAT_IS_NOT_NAN,
456 UNITY_FLOAT_IS_NAN,
457 UNITY_FLOAT_IS_NOT_DET,
458 UNITY_FLOAT_IS_DET,
459 UNITY_FLOAT_INVALID_TRAIT
460} UNITY_FLOAT_TRAIT_T;
461#endif
462
463typedef enum {
464 UNITY_ARRAY_TO_VAL = 0,
465 UNITY_ARRAY_TO_ARRAY,
466 UNITY_ARRAY_UNKNOWN
467} UNITY_FLAGS_T;
469struct UNITY_STORAGE_T {
470 const char *TestFile;
471 const char *CurrentTestName;
472#ifndef UNITY_EXCLUDE_DETAILS
473 const char *CurrentDetail1;
474 const char *CurrentDetail2;
475#endif
476 UNITY_LINE_TYPE CurrentTestLineNumber;
477 UNITY_COUNTER_TYPE NumberOfTests;
478 UNITY_COUNTER_TYPE TestFailures;
479 UNITY_COUNTER_TYPE TestIgnores;
480 UNITY_COUNTER_TYPE CurrentTestFailed;
481 UNITY_COUNTER_TYPE CurrentTestIgnored;
482#ifdef UNITY_INCLUDE_EXEC_TIME
483 UNITY_TIME_TYPE CurrentTestStartTime;
484 UNITY_TIME_TYPE CurrentTestStopTime;
485#endif
486#ifndef UNITY_EXCLUDE_SETJMP_H
487 jmp_buf AbortFrame;
488#endif
489};
490
491extern struct UNITY_STORAGE_T Unity;
492
493/*-------------------------------------------------------
494 * Test Suite Management
495 *-------------------------------------------------------*/
496
497void UnityBegin(const char *filename);
498int UnityEnd(void);
499void UnitySetTestFile(const char *filename);
500void UnityConcludeTest(void);
501
502#ifndef RUN_TEST
503void UnityDefaultTestRun(UnityTestFunction Func, const char *FuncName,
504 const int FuncLineNum);
505#else
506#define UNITY_SKIP_DEFAULT_RUNNER
507#endif
508
509/*-------------------------------------------------------
510 * Details Support
511 *-------------------------------------------------------*/
512
513#ifdef UNITY_EXCLUDE_DETAILS
514#define UNITY_CLR_DETAILS()
515#define UNITY_SET_DETAIL(d1)
516#define UNITY_SET_DETAILS(d1, d2)
517#else
518#define UNITY_CLR_DETAILS() \
519 { \
520 Unity.CurrentDetail1 = 0; \
521 Unity.CurrentDetail2 = 0; \
522 }
523#define UNITY_SET_DETAIL(d1) \
524 { \
525 Unity.CurrentDetail1 = (d1); \
526 Unity.CurrentDetail2 = 0; \
527 }
528#define UNITY_SET_DETAILS(d1, d2) \
529 { \
530 Unity.CurrentDetail1 = (d1); \
531 Unity.CurrentDetail2 = (d2); \
532 }
533
534#ifndef UNITY_DETAIL1_NAME
535#define UNITY_DETAIL1_NAME "Function"
536#endif
537
538#ifndef UNITY_DETAIL2_NAME
539#define UNITY_DETAIL2_NAME "Argument"
540#endif
541#endif
542
543#ifdef UNITY_PRINT_TEST_CONTEXT
544void UNITY_PRINT_TEST_CONTEXT(void);
545#endif
546
547/*-------------------------------------------------------
548 * Test Output
549 *-------------------------------------------------------*/
550
551void UnityPrint(const char *string);
552
553#ifdef UNITY_INCLUDE_PRINT_FORMATTED
554void UnityPrintF(const UNITY_LINE_TYPE line, const char *format, ...);
555#endif
556
557void UnityPrintLen(const char *string, const UNITY_UINT32 length);
558void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number);
559void UnityPrintNumberByStyle(const UNITY_INT number,
560 const UNITY_DISPLAY_STYLE_T style);
561void UnityPrintNumber(const UNITY_INT number_to_print);
562void UnityPrintNumberUnsigned(const UNITY_UINT number);
563void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print);
564
565#ifndef UNITY_EXCLUDE_FLOAT_PRINT
566void UnityPrintFloat(const UNITY_DOUBLE input_number);
567#endif
568
569/*-------------------------------------------------------
570 * Test Assertion Functions
571 *-------------------------------------------------------
572 * Use the macros below this section instead of calling
573 * these directly. The macros have a consistent naming
574 * convention and will pull in file and line information
575 * for you. */
576
577void UnityAssertEqualNumber(const UNITY_INT expected, const UNITY_INT actual,
578 const char *msg, const UNITY_LINE_TYPE lineNumber,
579 const UNITY_DISPLAY_STYLE_T style);
580
581void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold,
582 const UNITY_INT actual,
583 const UNITY_COMPARISON_T compare,
584 const char *msg,
585 const UNITY_LINE_TYPE lineNumber,
586 const UNITY_DISPLAY_STYLE_T style);
587
588void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
589 UNITY_INTERNAL_PTR actual,
590 const UNITY_UINT32 num_elements, const char *msg,
591 const UNITY_LINE_TYPE lineNumber,
592 const UNITY_DISPLAY_STYLE_T style,
593 const UNITY_FLAGS_T flags);
594
595void UnityAssertBits(const UNITY_INT mask, const UNITY_INT expected,
596 const UNITY_INT actual, const char *msg,
597 const UNITY_LINE_TYPE lineNumber);
598
599void UnityAssertEqualString(const char *expected, const char *actual,
600 const char *msg, const UNITY_LINE_TYPE lineNumber);
601
602void UnityAssertEqualStringLen(const char *expected, const char *actual,
603 const UNITY_UINT32 length, const char *msg,
604 const UNITY_LINE_TYPE lineNumber);
605
606void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
607 const char **actual,
608 const UNITY_UINT32 num_elements,
609 const char *msg,
610 const UNITY_LINE_TYPE lineNumber,
611 const UNITY_FLAGS_T flags);
612
613void UnityAssertEqualMemory(UNITY_INTERNAL_PTR expected,
614 UNITY_INTERNAL_PTR actual,
615 const UNITY_UINT32 length,
616 const UNITY_UINT32 num_elements, const char *msg,
617 const UNITY_LINE_TYPE lineNumber,
618 const UNITY_FLAGS_T flags);
619
620void UnityAssertNumbersWithin(const UNITY_UINT delta, const UNITY_INT expected,
621 const UNITY_INT actual, const char *msg,
622 const UNITY_LINE_TYPE lineNumber,
623 const UNITY_DISPLAY_STYLE_T style);
624
625void UnityAssertNumbersArrayWithin(
626 const UNITY_UINT delta, UNITY_INTERNAL_PTR expected,
627 UNITY_INTERNAL_PTR actual, const UNITY_UINT32 num_elements, const char *msg,
628 const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style,
629 const UNITY_FLAGS_T flags);
630
631void UnityFail(const char *message, const UNITY_LINE_TYPE line);
632void UnityIgnore(const char *message, const UNITY_LINE_TYPE line);
633void UnityMessage(const char *message, const UNITY_LINE_TYPE line);
634
635#ifndef UNITY_EXCLUDE_FLOAT
636void UnityAssertFloatsWithin(const UNITY_FLOAT delta,
637 const UNITY_FLOAT expected,
638 const UNITY_FLOAT actual, const char *msg,
639 const UNITY_LINE_TYPE lineNumber);
640
641void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT *expected,
642 UNITY_PTR_ATTRIBUTE const UNITY_FLOAT *actual,
643 const UNITY_UINT32 num_elements,
644 const char *msg,
645 const UNITY_LINE_TYPE lineNumber,
646 const UNITY_FLAGS_T flags);
647
648void UnityAssertFloatSpecial(const UNITY_FLOAT actual, const char *msg,
649 const UNITY_LINE_TYPE lineNumber,
650 const UNITY_FLOAT_TRAIT_T style);
651#endif
652
653#ifndef UNITY_EXCLUDE_DOUBLE
654void UnityAssertDoublesWithin(const UNITY_DOUBLE delta,
655 const UNITY_DOUBLE expected,
656 const UNITY_DOUBLE actual, const char *msg,
657 const UNITY_LINE_TYPE lineNumber);
658
659void UnityAssertEqualDoubleArray(
660 UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE *expected,
661 UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE *actual,
662 const UNITY_UINT32 num_elements, const char *msg,
663 const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags);
664
665void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, const char *msg,
666 const UNITY_LINE_TYPE lineNumber,
667 const UNITY_FLOAT_TRAIT_T style);
668#endif
669
670/*-------------------------------------------------------
671 * Helpers
672 *-------------------------------------------------------*/
673
674UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size);
675#ifndef UNITY_EXCLUDE_FLOAT
676UNITY_INTERNAL_PTR UnityFloatToPtr(const float num);
677#endif
678#ifndef UNITY_EXCLUDE_DOUBLE
679UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num);
680#endif
681
682/*-------------------------------------------------------
683 * Error Strings We Might Need
684 *-------------------------------------------------------*/
685
686extern const char UnityStrOk[];
687extern const char UnityStrPass[];
688extern const char UnityStrFail[];
689extern const char UnityStrIgnore[];
690
691extern const char UnityStrErrFloat[];
692extern const char UnityStrErrDouble[];
693extern const char UnityStrErr64[];
694extern const char UnityStrErrShorthand[];
695
696/*-------------------------------------------------------
697 * Test Running Macros
698 *-------------------------------------------------------*/
699
700#ifndef UNITY_EXCLUDE_SETJMP_H
701#define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0)
702#define TEST_ABORT() longjmp(Unity.AbortFrame, 1)
703#else
704#define TEST_PROTECT() 1
705#define TEST_ABORT() return
706#endif
707
708/* This tricky series of macros gives us an optional line argument to treat it
709 * as RUN_TEST(func, num=__LINE__) */
710#ifndef RUN_TEST
711#ifdef __STDC_VERSION__
712#if __STDC_VERSION__ >= 199901L
713#define UNITY_SUPPORT_VARIADIC_MACROS
714#endif
715#endif
716#ifdef UNITY_SUPPORT_VARIADIC_MACROS
717#define RUN_TEST(...) \
718 UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__))
719#define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway)
720#define RUN_TEST_FIRST_HELPER(first, ...) (first), #first
721#define RUN_TEST_SECOND(...) \
722 RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway)
723#define RUN_TEST_SECOND_HELPER(first, second, ...) (second)
724#endif
725#endif
726
727/* If we can't do the tricky version, we'll just have to require them to always
728 * include the line number */
729#ifndef RUN_TEST
730#ifdef CMOCK
731#define RUN_TEST(func, num) UnityDefaultTestRun(func, #func, num)
732#else
733#define RUN_TEST(func) UnityDefaultTestRun(func, #func, __LINE__)
734#endif
735#endif
736
737#define TEST_LINE_NUM (Unity.CurrentTestLineNumber)
738#define TEST_IS_IGNORED (Unity.CurrentTestIgnored)
739#define UNITY_NEW_TEST(a) \
740 Unity.CurrentTestName = (a); \
741 Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)(__LINE__); \
742 Unity.NumberOfTests++;
743
744#ifndef UNITY_BEGIN
745#define UNITY_BEGIN() UnityBegin(__FILE__)
746#endif
747
748#ifndef UNITY_END
749#define UNITY_END() UnityEnd()
750#endif
751
752#ifndef UNITY_SHORTHAND_AS_INT
753#ifndef UNITY_SHORTHAND_AS_MEM
754#ifndef UNITY_SHORTHAND_AS_NONE
755#ifndef UNITY_SHORTHAND_AS_RAW
756#define UNITY_SHORTHAND_AS_OLD
757#endif
758#endif
759#endif
760#endif
761
762/*-----------------------------------------------
763 * Command Line Argument Support
764 *-----------------------------------------------*/
765
766#ifdef UNITY_USE_COMMAND_LINE_ARGS
767int UnityParseOptions(int argc, char **argv);
768int UnityTestMatches(void);
769#endif
770
771/*-------------------------------------------------------
772 * Basic Fail and Ignore
773 *-------------------------------------------------------*/
774
775#define UNITY_TEST_FAIL(line, message) \
776 UnityFail((message), (UNITY_LINE_TYPE)(line))
777#define UNITY_TEST_IGNORE(line, message) \
778 UnityIgnore((message), (UNITY_LINE_TYPE)(line))
779
780/*-------------------------------------------------------
781 * Test Asserts
782 *-------------------------------------------------------*/
783
784#define UNITY_TEST_ASSERT(condition, line, message) \
785 do { \
786 if (condition) { \
787 } else { \
788 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message)); \
789 } \
790 } while (0)
791#define UNITY_TEST_ASSERT_NULL(pointer, line, message) \
792 UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message))
793#define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) \
794 UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message))
795#define UNITY_TEST_ASSERT_EMPTY(pointer, line, message) \
796 UNITY_TEST_ASSERT(((pointer[0]) == 0), (UNITY_LINE_TYPE)(line), (message))
797#define UNITY_TEST_ASSERT_NOT_EMPTY(pointer, line, message) \
798 UNITY_TEST_ASSERT(((pointer[0]) != 0), (UNITY_LINE_TYPE)(line), (message))
799
800#define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) \
801 UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), \
802 (message), (UNITY_LINE_TYPE)(line), \
803 UNITY_DISPLAY_STYLE_INT)
804#define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) \
805 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8)(expected), \
806 (UNITY_INT)(UNITY_INT8)(actual), (message), \
807 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
808#define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) \
809 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), \
810 (UNITY_INT)(UNITY_INT16)(actual), (message), \
811 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
812#define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) \
813 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), \
814 (UNITY_INT)(UNITY_INT32)(actual), (message), \
815 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
816#define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) \
817 UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), \
818 (message), (UNITY_LINE_TYPE)(line), \
819 UNITY_DISPLAY_STYLE_UINT)
820#define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) \
821 UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT8)(expected), \
822 (UNITY_INT)(UNITY_UINT8)(actual), (message), \
823 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
824#define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) \
825 UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT16)(expected), \
826 (UNITY_INT)(UNITY_UINT16)(actual), (message), \
827 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
828#define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) \
829 UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT32)(expected), \
830 (UNITY_INT)(UNITY_UINT32)(actual), (message), \
831 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
832#define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) \
833 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8)(expected), \
834 (UNITY_INT)(UNITY_INT8)(actual), (message), \
835 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
836#define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) \
837 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), \
838 (UNITY_INT)(UNITY_INT16)(actual), (message), \
839 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
840#define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) \
841 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), \
842 (UNITY_INT)(UNITY_INT32)(actual), (message), \
843 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
844#define UNITY_TEST_ASSERT_EQUAL_CHAR(expected, actual, line, message) \
845 UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8)(expected), \
846 (UNITY_INT)(UNITY_INT8)(actual), (message), \
847 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
848#define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) \
849 UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), \
850 (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line))
851
852#define UNITY_TEST_ASSERT_NOT_EQUAL_INT(threshold, actual, line, message) \
853 UnityAssertGreaterOrLessOrEqualNumber( \
854 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), \
855 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
856#define UNITY_TEST_ASSERT_NOT_EQUAL_INT8(threshold, actual, line, message) \
857 UnityAssertGreaterOrLessOrEqualNumber( \
858 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
859 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
860 UNITY_DISPLAY_STYLE_INT8)
861#define UNITY_TEST_ASSERT_NOT_EQUAL_INT16(threshold, actual, line, message) \
862 UnityAssertGreaterOrLessOrEqualNumber( \
863 (UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), \
864 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
865 UNITY_DISPLAY_STYLE_INT16)
866#define UNITY_TEST_ASSERT_NOT_EQUAL_INT32(threshold, actual, line, message) \
867 UnityAssertGreaterOrLessOrEqualNumber( \
868 (UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), \
869 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
870 UNITY_DISPLAY_STYLE_INT32)
871#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT(threshold, actual, line, message) \
872 UnityAssertGreaterOrLessOrEqualNumber( \
873 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), \
874 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
875#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT8(threshold, actual, line, message) \
876 UnityAssertGreaterOrLessOrEqualNumber( \
877 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
878 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
879 UNITY_DISPLAY_STYLE_UINT8)
880#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT16(threshold, actual, line, message) \
881 UnityAssertGreaterOrLessOrEqualNumber( \
882 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
883 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
884 UNITY_DISPLAY_STYLE_UINT16)
885#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT32(threshold, actual, line, message) \
886 UnityAssertGreaterOrLessOrEqualNumber( \
887 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
888 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
889 UNITY_DISPLAY_STYLE_UINT32)
890#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX8(threshold, actual, line, message) \
891 UnityAssertGreaterOrLessOrEqualNumber( \
892 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
893 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
894 UNITY_DISPLAY_STYLE_HEX8)
895#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX16(threshold, actual, line, message) \
896 UnityAssertGreaterOrLessOrEqualNumber( \
897 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
898 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
899 UNITY_DISPLAY_STYLE_HEX16)
900#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX32(threshold, actual, line, message) \
901 UnityAssertGreaterOrLessOrEqualNumber( \
902 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
903 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
904 UNITY_DISPLAY_STYLE_HEX32)
905#define UNITY_TEST_ASSERT_NOT_EQUAL_CHAR(threshold, actual, line, message) \
906 UnityAssertGreaterOrLessOrEqualNumber( \
907 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
908 UNITY_NOT_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
909 UNITY_DISPLAY_STYLE_CHAR)
910
911#define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) \
912 UnityAssertGreaterOrLessOrEqualNumber( \
913 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, \
914 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
915#define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) \
916 UnityAssertGreaterOrLessOrEqualNumber( \
917 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
918 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
919 UNITY_DISPLAY_STYLE_INT8)
920#define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) \
921 UnityAssertGreaterOrLessOrEqualNumber( \
922 (UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), \
923 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
924 UNITY_DISPLAY_STYLE_INT16)
925#define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) \
926 UnityAssertGreaterOrLessOrEqualNumber( \
927 (UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), \
928 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
929 UNITY_DISPLAY_STYLE_INT32)
930#define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) \
931 UnityAssertGreaterOrLessOrEqualNumber( \
932 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, \
933 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
934#define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) \
935 UnityAssertGreaterOrLessOrEqualNumber( \
936 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
937 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
938 UNITY_DISPLAY_STYLE_UINT8)
939#define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, \
940 message) \
941 UnityAssertGreaterOrLessOrEqualNumber( \
942 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
943 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
944 UNITY_DISPLAY_STYLE_UINT16)
945#define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, \
946 message) \
947 UnityAssertGreaterOrLessOrEqualNumber( \
948 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
949 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
950 UNITY_DISPLAY_STYLE_UINT32)
951#define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) \
952 UnityAssertGreaterOrLessOrEqualNumber( \
953 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
954 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
955 UNITY_DISPLAY_STYLE_HEX8)
956#define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) \
957 UnityAssertGreaterOrLessOrEqualNumber( \
958 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
959 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
960 UNITY_DISPLAY_STYLE_HEX16)
961#define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) \
962 UnityAssertGreaterOrLessOrEqualNumber( \
963 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
964 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
965 UNITY_DISPLAY_STYLE_HEX32)
966#define UNITY_TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual, line, message) \
967 UnityAssertGreaterOrLessOrEqualNumber( \
968 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
969 UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), \
970 UNITY_DISPLAY_STYLE_CHAR)
971
972#define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) \
973 UnityAssertGreaterOrLessOrEqualNumber( \
974 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, \
975 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
976#define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) \
977 UnityAssertGreaterOrLessOrEqualNumber( \
978 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
979 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
980 UNITY_DISPLAY_STYLE_INT8)
981#define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) \
982 UnityAssertGreaterOrLessOrEqualNumber( \
983 (UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), \
984 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
985 UNITY_DISPLAY_STYLE_INT16)
986#define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) \
987 UnityAssertGreaterOrLessOrEqualNumber( \
988 (UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), \
989 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
990 UNITY_DISPLAY_STYLE_INT32)
991#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) \
992 UnityAssertGreaterOrLessOrEqualNumber( \
993 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, \
994 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
995#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) \
996 UnityAssertGreaterOrLessOrEqualNumber( \
997 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
998 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
999 UNITY_DISPLAY_STYLE_UINT8)
1000#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, \
1001 message) \
1002 UnityAssertGreaterOrLessOrEqualNumber( \
1003 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
1004 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
1005 UNITY_DISPLAY_STYLE_UINT16)
1006#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, \
1007 message) \
1008 UnityAssertGreaterOrLessOrEqualNumber( \
1009 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
1010 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
1011 UNITY_DISPLAY_STYLE_UINT32)
1012#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) \
1013 UnityAssertGreaterOrLessOrEqualNumber( \
1014 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
1015 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
1016 UNITY_DISPLAY_STYLE_HEX8)
1017#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) \
1018 UnityAssertGreaterOrLessOrEqualNumber( \
1019 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
1020 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
1021 UNITY_DISPLAY_STYLE_HEX16)
1022#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) \
1023 UnityAssertGreaterOrLessOrEqualNumber( \
1024 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
1025 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
1026 UNITY_DISPLAY_STYLE_HEX32)
1027#define UNITY_TEST_ASSERT_SMALLER_THAN_CHAR(threshold, actual, line, message) \
1028 UnityAssertGreaterOrLessOrEqualNumber( \
1029 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
1030 UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), \
1031 UNITY_DISPLAY_STYLE_CHAR)
1032
1033#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, \
1034 message) \
1035 UnityAssertGreaterOrLessOrEqualNumber( \
1036 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, \
1037 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
1038#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, \
1039 message) \
1040 UnityAssertGreaterOrLessOrEqualNumber( \
1041 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
1042 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1043 UNITY_DISPLAY_STYLE_INT8)
1044#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, \
1045 message) \
1046 UnityAssertGreaterOrLessOrEqualNumber( \
1047 (UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), \
1048 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1049 UNITY_DISPLAY_STYLE_INT16)
1050#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, \
1051 message) \
1052 UnityAssertGreaterOrLessOrEqualNumber( \
1053 (UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), \
1054 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1055 UNITY_DISPLAY_STYLE_INT32)
1056#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, \
1057 message) \
1058 UnityAssertGreaterOrLessOrEqualNumber( \
1059 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, \
1060 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
1061#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, \
1062 message) \
1063 UnityAssertGreaterOrLessOrEqualNumber( \
1064 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
1065 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1066 UNITY_DISPLAY_STYLE_UINT8)
1067#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, \
1068 message) \
1069 UnityAssertGreaterOrLessOrEqualNumber( \
1070 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
1071 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1072 UNITY_DISPLAY_STYLE_UINT16)
1073#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, \
1074 message) \
1075 UnityAssertGreaterOrLessOrEqualNumber( \
1076 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
1077 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1078 UNITY_DISPLAY_STYLE_UINT32)
1079#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, \
1080 message) \
1081 UnityAssertGreaterOrLessOrEqualNumber( \
1082 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
1083 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1084 UNITY_DISPLAY_STYLE_HEX8)
1085#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, \
1086 message) \
1087 UnityAssertGreaterOrLessOrEqualNumber( \
1088 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
1089 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1090 UNITY_DISPLAY_STYLE_HEX16)
1091#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, \
1092 message) \
1093 UnityAssertGreaterOrLessOrEqualNumber( \
1094 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
1095 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1096 UNITY_DISPLAY_STYLE_HEX32)
1097#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual, line, \
1098 message) \
1099 UnityAssertGreaterOrLessOrEqualNumber( \
1100 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
1101 UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1102 UNITY_DISPLAY_STYLE_CHAR)
1103
1104#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, \
1105 message) \
1106 UnityAssertGreaterOrLessOrEqualNumber( \
1107 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, \
1108 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
1109#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, \
1110 message) \
1111 UnityAssertGreaterOrLessOrEqualNumber( \
1112 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
1113 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1114 UNITY_DISPLAY_STYLE_INT8)
1115#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, \
1116 message) \
1117 UnityAssertGreaterOrLessOrEqualNumber( \
1118 (UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), \
1119 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1120 UNITY_DISPLAY_STYLE_INT16)
1121#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, \
1122 message) \
1123 UnityAssertGreaterOrLessOrEqualNumber( \
1124 (UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), \
1125 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1126 UNITY_DISPLAY_STYLE_INT32)
1127#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, \
1128 message) \
1129 UnityAssertGreaterOrLessOrEqualNumber( \
1130 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, \
1131 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
1132#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, \
1133 message) \
1134 UnityAssertGreaterOrLessOrEqualNumber( \
1135 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
1136 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1137 UNITY_DISPLAY_STYLE_UINT8)
1138#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, \
1139 message) \
1140 UnityAssertGreaterOrLessOrEqualNumber( \
1141 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
1142 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1143 UNITY_DISPLAY_STYLE_UINT16)
1144#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, \
1145 message) \
1146 UnityAssertGreaterOrLessOrEqualNumber( \
1147 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
1148 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1149 UNITY_DISPLAY_STYLE_UINT32)
1150#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, \
1151 message) \
1152 UnityAssertGreaterOrLessOrEqualNumber( \
1153 (UNITY_INT)(UNITY_UINT8)(threshold), (UNITY_INT)(UNITY_UINT8)(actual), \
1154 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1155 UNITY_DISPLAY_STYLE_HEX8)
1156#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, \
1157 message) \
1158 UnityAssertGreaterOrLessOrEqualNumber( \
1159 (UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), \
1160 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1161 UNITY_DISPLAY_STYLE_HEX16)
1162#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, \
1163 message) \
1164 UnityAssertGreaterOrLessOrEqualNumber( \
1165 (UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), \
1166 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1167 UNITY_DISPLAY_STYLE_HEX32)
1168#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR(threshold, actual, line, \
1169 message) \
1170 UnityAssertGreaterOrLessOrEqualNumber( \
1171 (UNITY_INT)(UNITY_INT8)(threshold), (UNITY_INT)(UNITY_INT8)(actual), \
1172 UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), \
1173 UNITY_DISPLAY_STYLE_CHAR)
1174
1175#define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) \
1176 UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), \
1177 (UNITY_INT)(actual), (message), \
1178 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
1179#define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) \
1180 UnityAssertNumbersWithin((UNITY_UINT8)(delta), \
1181 (UNITY_INT)(UNITY_INT8)(expected), \
1182 (UNITY_INT)(UNITY_INT8)(actual), (message), \
1183 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
1184#define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) \
1185 UnityAssertNumbersWithin((UNITY_UINT16)(delta), \
1186 (UNITY_INT)(UNITY_INT16)(expected), \
1187 (UNITY_INT)(UNITY_INT16)(actual), (message), \
1188 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
1189#define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) \
1190 UnityAssertNumbersWithin((UNITY_UINT32)(delta), \
1191 (UNITY_INT)(UNITY_INT32)(expected), \
1192 (UNITY_INT)(UNITY_INT32)(actual), (message), \
1193 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
1194#define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) \
1195 UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), \
1196 (UNITY_INT)(actual), (message), \
1197 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
1198#define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) \
1199 UnityAssertNumbersWithin( \
1200 (UNITY_UINT8)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8)(expected), \
1201 (UNITY_INT)(UNITY_UINT)(UNITY_UINT8)(actual), (message), \
1202 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
1203#define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, \
1204 message) \
1205 UnityAssertNumbersWithin( \
1206 (UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), \
1207 (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), \
1208 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
1209#define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, \
1210 message) \
1211 UnityAssertNumbersWithin( \
1212 (UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), \
1213 (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), \
1214 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
1215#define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) \
1216 UnityAssertNumbersWithin( \
1217 (UNITY_UINT8)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8)(expected), \
1218 (UNITY_INT)(UNITY_UINT)(UNITY_UINT8)(actual), (message), \
1219 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
1220#define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) \
1221 UnityAssertNumbersWithin( \
1222 (UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), \
1223 (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), \
1224 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
1225#define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) \
1226 UnityAssertNumbersWithin( \
1227 (UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), \
1228 (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), \
1229 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
1230#define UNITY_TEST_ASSERT_CHAR_WITHIN(delta, expected, actual, line, message) \
1231 UnityAssertNumbersWithin((UNITY_UINT8)(delta), \
1232 (UNITY_INT)(UNITY_INT8)(expected), \
1233 (UNITY_INT)(UNITY_INT8)(actual), (message), \
1234 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR)
1235
1236#define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, \
1237 num_elements, line, message) \
1238 UnityAssertNumbersArrayWithin( \
1239 (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1240 ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), \
1241 UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY)
1242#define UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, \
1243 num_elements, line, message) \
1244 UnityAssertNumbersArrayWithin( \
1245 (UNITY_UINT8)(delta), (UNITY_INTERNAL_PTR)(expected), \
1246 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1247 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY)
1248#define UNITY_TEST_ASSERT_INT16_ARRAY_WITHIN(delta, expected, actual, \
1249 num_elements, line, message) \
1250 UnityAssertNumbersArrayWithin( \
1251 (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), \
1252 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1253 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, \
1254 UNITY_ARRAY_TO_ARRAY)
1255#define UNITY_TEST_ASSERT_INT32_ARRAY_WITHIN(delta, expected, actual, \
1256 num_elements, line, message) \
1257 UnityAssertNumbersArrayWithin( \
1258 (UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), \
1259 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1260 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, \
1261 UNITY_ARRAY_TO_ARRAY)
1262#define UNITY_TEST_ASSERT_UINT_ARRAY_WITHIN(delta, expected, actual, \
1263 num_elements, line, message) \
1264 UnityAssertNumbersArrayWithin( \
1265 (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1266 ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), \
1267 UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY)
1268#define UNITY_TEST_ASSERT_UINT8_ARRAY_WITHIN(delta, expected, actual, \
1269 num_elements, line, message) \
1270 UnityAssertNumbersArrayWithin( \
1271 (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), \
1272 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1273 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, \
1274 UNITY_ARRAY_TO_ARRAY)
1275#define UNITY_TEST_ASSERT_UINT16_ARRAY_WITHIN(delta, expected, actual, \
1276 num_elements, line, message) \
1277 UnityAssertNumbersArrayWithin( \
1278 (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), \
1279 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1280 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, \
1281 UNITY_ARRAY_TO_ARRAY)
1282#define UNITY_TEST_ASSERT_UINT32_ARRAY_WITHIN(delta, expected, actual, \
1283 num_elements, line, message) \
1284 UnityAssertNumbersArrayWithin( \
1285 (UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), \
1286 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1287 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, \
1288 UNITY_ARRAY_TO_ARRAY)
1289#define UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, \
1290 num_elements, line, message) \
1291 UnityAssertNumbersArrayWithin( \
1292 (UNITY_UINT8)(delta), (UNITY_INTERNAL_PTR)(expected), \
1293 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1294 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY)
1295#define UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, \
1296 num_elements, line, message) \
1297 UnityAssertNumbersArrayWithin( \
1298 (UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), \
1299 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1300 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, \
1301 UNITY_ARRAY_TO_ARRAY)
1302#define UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, \
1303 num_elements, line, message) \
1304 UnityAssertNumbersArrayWithin( \
1305 (UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), \
1306 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1307 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, \
1308 UNITY_ARRAY_TO_ARRAY)
1309#define UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, \
1310 num_elements, line, message) \
1311 UnityAssertNumbersArrayWithin( \
1312 (UNITY_UINT8)(delta), (UNITY_INTERNAL_PTR)(expected), \
1313 (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), \
1314 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY)
1315
1316#define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) \
1317 UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), \
1318 (UNITY_PTR_TO_INT)(actual), (message), \
1319 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER)
1320#define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) \
1321 UnityAssertEqualString((const char *)(expected), (const char *)(actual), \
1322 (message), (UNITY_LINE_TYPE)(line))
1323#define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, \
1324 message) \
1325 UnityAssertEqualStringLen((const char *)(expected), (const char *)(actual), \
1326 (UNITY_UINT32)(len), (message), \
1327 (UNITY_LINE_TYPE)(line))
1328#define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) \
1329 UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), \
1330 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), 1, \
1331 (message), (UNITY_LINE_TYPE)(line), \
1332 UNITY_ARRAY_TO_ARRAY)
1333
1334#define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, \
1335 line, message) \
1336 UnityAssertEqualIntArray( \
1337 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1338 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1339 UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY)
1340#define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, \
1341 line, message) \
1342 UnityAssertEqualIntArray( \
1343 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1344 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1345 UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY)
1346#define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, \
1347 line, message) \
1348 UnityAssertEqualIntArray( \
1349 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1350 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1351 UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY)
1352#define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, \
1353 line, message) \
1354 UnityAssertEqualIntArray( \
1355 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1356 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1357 UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY)
1358#define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, \
1359 line, message) \
1360 UnityAssertEqualIntArray( \
1361 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1362 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1363 UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY)
1364#define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, \
1365 line, message) \
1366 UnityAssertEqualIntArray( \
1367 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1368 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1369 UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY)
1370#define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, \
1371 line, message) \
1372 UnityAssertEqualIntArray( \
1373 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1374 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1375 UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY)
1376#define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, \
1377 line, message) \
1378 UnityAssertEqualIntArray( \
1379 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1380 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1381 UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY)
1382#define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, \
1383 line, message) \
1384 UnityAssertEqualIntArray( \
1385 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1386 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1387 UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY)
1388#define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, \
1389 line, message) \
1390 UnityAssertEqualIntArray( \
1391 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1392 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1393 UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY)
1394#define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, \
1395 line, message) \
1396 UnityAssertEqualIntArray( \
1397 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1398 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1399 UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY)
1400#define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, \
1401 line, message) \
1402 UnityAssertEqualIntArray( \
1403 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1404 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1405 UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_ARRAY)
1406#define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, \
1407 line, message) \
1408 UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), \
1409 (const char **)(actual), \
1410 (UNITY_UINT32)(num_elements), (message), \
1411 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
1412#define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, \
1413 num_elements, line, message) \
1414 UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), \
1415 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), \
1416 (UNITY_UINT32)(num_elements), (message), \
1417 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
1418#define UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements, \
1419 line, message) \
1420 UnityAssertEqualIntArray( \
1421 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1422 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1423 UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY)
1424
1425#define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, \
1426 message) \
1427 UnityAssertEqualIntArray( \
1428 UnityNumToPtr((UNITY_INT)(expected), (UNITY_INT_WIDTH / 8)), \
1429 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1430 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_VAL)
1431#define UNITY_TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements, \
1432 line, message) \
1433 UnityAssertEqualIntArray( \
1434 UnityNumToPtr((UNITY_INT)(UNITY_INT8)(expected), 1), \
1435 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1436 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_VAL)
1437#define UNITY_TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements, \
1438 line, message) \
1439 UnityAssertEqualIntArray( \
1440 UnityNumToPtr((UNITY_INT)(UNITY_INT16)(expected), 2), \
1441 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1442 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_VAL)
1443#define UNITY_TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements, \
1444 line, message) \
1445 UnityAssertEqualIntArray( \
1446 UnityNumToPtr((UNITY_INT)(UNITY_INT32)(expected), 4), \
1447 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1448 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_VAL)
1449#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements, \
1450 line, message) \
1451 UnityAssertEqualIntArray( \
1452 UnityNumToPtr((UNITY_INT)(expected), (UNITY_INT_WIDTH / 8)), \
1453 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1454 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_VAL)
1455#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements, \
1456 line, message) \
1457 UnityAssertEqualIntArray( \
1458 UnityNumToPtr((UNITY_INT)(UNITY_UINT8)(expected), 1), \
1459 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1460 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_VAL)
1461#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements, \
1462 line, message) \
1463 UnityAssertEqualIntArray( \
1464 UnityNumToPtr((UNITY_INT)(UNITY_UINT16)(expected), 2), \
1465 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1466 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_VAL)
1467#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements, \
1468 line, message) \
1469 UnityAssertEqualIntArray( \
1470 UnityNumToPtr((UNITY_INT)(UNITY_UINT32)(expected), 4), \
1471 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1472 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_VAL)
1473#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements, \
1474 line, message) \
1475 UnityAssertEqualIntArray( \
1476 UnityNumToPtr((UNITY_INT)(UNITY_INT8)(expected), 1), \
1477 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1478 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_VAL)
1479#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements, \
1480 line, message) \
1481 UnityAssertEqualIntArray( \
1482 UnityNumToPtr((UNITY_INT)(UNITY_INT16)(expected), 2), \
1483 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1484 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_VAL)
1485#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements, \
1486 line, message) \
1487 UnityAssertEqualIntArray( \
1488 UnityNumToPtr((UNITY_INT)(UNITY_INT32)(expected), 4), \
1489 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1490 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_VAL)
1491#define UNITY_TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements, line, \
1492 message) \
1493 UnityAssertEqualIntArray( \
1494 UnityNumToPtr((UNITY_PTR_TO_INT)(expected), (UNITY_POINTER_WIDTH / 8)), \
1495 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1496 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, \
1497 UNITY_ARRAY_TO_VAL)
1498#define UNITY_TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements, \
1499 line, message) \
1500 UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), \
1501 (const char **)(actual), \
1502 (UNITY_UINT32)(num_elements), (message), \
1503 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
1504#define UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, \
1505 num_elements, line, message) \
1506 UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), \
1507 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), \
1508 (UNITY_UINT32)(num_elements), (message), \
1509 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
1510#define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements, \
1511 line, message) \
1512 UnityAssertEqualIntArray( \
1513 UnityNumToPtr((UNITY_INT)(UNITY_INT8)(expected), 1), \
1514 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1515 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_VAL)
1516
1517#ifdef UNITY_SUPPORT_64
1518#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) \
1519 UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), \
1520 (message), (UNITY_LINE_TYPE)(line), \
1521 UNITY_DISPLAY_STYLE_INT64)
1522#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) \
1523 UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), \
1524 (message), (UNITY_LINE_TYPE)(line), \
1525 UNITY_DISPLAY_STYLE_UINT64)
1526#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) \
1527 UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), \
1528 (message), (UNITY_LINE_TYPE)(line), \
1529 UNITY_DISPLAY_STYLE_HEX64)
1530#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, \
1531 line, message) \
1532 UnityAssertEqualIntArray( \
1533 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1534 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1535 UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY)
1536#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, \
1537 line, message) \
1538 UnityAssertEqualIntArray( \
1539 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1540 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1541 UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY)
1542#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, \
1543 line, message) \
1544 UnityAssertEqualIntArray( \
1545 (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), \
1546 (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), \
1547 UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY)
1548#define UNITY_TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements, \
1549 line, message) \
1550 UnityAssertEqualIntArray( \
1551 UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), \
1552 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1553 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_VAL)
1554#define UNITY_TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements, \
1555 line, message) \
1556 UnityAssertEqualIntArray( \
1557 UnityNumToPtr((UNITY_INT)(UNITY_UINT64)(expected), 8), \
1558 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1559 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_VAL)
1560#define UNITY_TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements, \
1561 line, message) \
1562 UnityAssertEqualIntArray( \
1563 UnityNumToPtr((UNITY_INT)(UNITY_INT64)(expected), 8), \
1564 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1565 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_VAL)
1566#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) \
1567 UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), \
1568 (UNITY_INT)(actual), (message), \
1569 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
1570#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, \
1571 message) \
1572 UnityAssertNumbersWithin( \
1573 (delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), \
1574 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
1575#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) \
1576 UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), \
1577 (UNITY_INT)(actual), (message), \
1578 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
1579#define UNITY_TEST_ASSERT_NOT_EQUAL_INT64(threshold, actual, line, message) \
1580 UnityAssertGreaterOrLessOrEqualNumber( \
1581 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), \
1582 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
1583#define UNITY_TEST_ASSERT_NOT_EQUAL_UINT64(threshold, actual, line, message) \
1584 UnityAssertGreaterOrLessOrEqualNumber( \
1585 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), \
1586 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
1587#define UNITY_TEST_ASSERT_NOT_EQUAL_HEX64(threshold, actual, line, message) \
1588 UnityAssertGreaterOrLessOrEqualNumber( \
1589 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_NOT_EQUAL, (message), \
1590 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
1591#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) \
1592 UnityAssertGreaterOrLessOrEqualNumber( \
1593 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, \
1594 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
1595#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, \
1596 message) \
1597 UnityAssertGreaterOrLessOrEqualNumber( \
1598 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, \
1599 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
1600#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) \
1601 UnityAssertGreaterOrLessOrEqualNumber( \
1602 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, \
1603 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
1604#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, \
1605 message) \
1606 UnityAssertGreaterOrLessOrEqualNumber( \
1607 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, \
1608 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
1609#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, \
1610 message) \
1611 UnityAssertGreaterOrLessOrEqualNumber( \
1612 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, \
1613 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
1614#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, \
1615 message) \
1616 UnityAssertGreaterOrLessOrEqualNumber( \
1617 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, \
1618 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
1619#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) \
1620 UnityAssertGreaterOrLessOrEqualNumber( \
1621 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, \
1622 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
1623#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, \
1624 message) \
1625 UnityAssertGreaterOrLessOrEqualNumber( \
1626 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, \
1627 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
1628#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) \
1629 UnityAssertGreaterOrLessOrEqualNumber( \
1630 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, \
1631 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
1632#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, \
1633 message) \
1634 UnityAssertGreaterOrLessOrEqualNumber( \
1635 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, \
1636 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
1637#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, \
1638 message) \
1639 UnityAssertGreaterOrLessOrEqualNumber( \
1640 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, \
1641 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
1642#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, \
1643 message) \
1644 UnityAssertGreaterOrLessOrEqualNumber( \
1645 (UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, \
1646 (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
1647#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, \
1648 num_elements, line, message) \
1649 UnityAssertNumbersArrayWithin( \
1650 (UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), \
1651 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1652 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, \
1653 UNITY_ARRAY_TO_ARRAY)
1654#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, \
1655 num_elements, line, message) \
1656 UnityAssertNumbersArrayWithin( \
1657 (UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), \
1658 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1659 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, \
1660 UNITY_ARRAY_TO_ARRAY)
1661#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, \
1662 num_elements, line, message) \
1663 UnityAssertNumbersArrayWithin( \
1664 (UNITY_UINT64)(delta), (UNITY_INTERNAL_PTR)(expected), \
1665 (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), \
1666 (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, \
1667 UNITY_ARRAY_TO_ARRAY)
1668#else
1669#define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) \
1670 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1671#define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) \
1672 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1673#define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) \
1674 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1675#define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, \
1676 line, message) \
1677 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1678#define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, \
1679 line, message) \
1680 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1681#define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, \
1682 line, message) \
1683 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1684#define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) \
1685 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1686#define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, \
1687 message) \
1688 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1689#define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) \
1690 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1691#define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) \
1692 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1693#define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, \
1694 message) \
1695 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1696#define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) \
1697 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1698#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, \
1699 message) \
1700 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1701#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, \
1702 message) \
1703 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1704#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, \
1705 message) \
1706 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1707#define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) \
1708 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1709#define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, \
1710 message) \
1711 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1712#define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) \
1713 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1714#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, \
1715 message) \
1716 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1717#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, \
1718 message) \
1719 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1720#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, \
1721 message) \
1722 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1723#define UNITY_TEST_ASSERT_INT64_ARRAY_WITHIN(delta, expected, actual, \
1724 num_elements, line, message) \
1725 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1726#define UNITY_TEST_ASSERT_UINT64_ARRAY_WITHIN(delta, expected, actual, \
1727 num_elements, line, message) \
1728 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1729#define UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, \
1730 num_elements, line, message) \
1731 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
1732#endif
1733
1734#ifdef UNITY_EXCLUDE_FLOAT
1735#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) \
1736 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1737#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) \
1738 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1739#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, \
1740 line, message) \
1741 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1742#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, \
1743 line, message) \
1744 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1745#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) \
1746 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1747#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) \
1748 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1749#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) \
1750 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1751#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) \
1752 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1753#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) \
1754 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1755#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) \
1756 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1757#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) \
1758 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1759#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) \
1760 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
1761#else
1762#define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) \
1763 UnityAssertFloatsWithin((UNITY_FLOAT)(delta), (UNITY_FLOAT)(expected), \
1764 (UNITY_FLOAT)(actual), (message), \
1765 (UNITY_LINE_TYPE)(line))
1766#define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) \
1767 UNITY_TEST_ASSERT_FLOAT_WITHIN( \
1768 (UNITY_FLOAT)(expected) * (UNITY_FLOAT)UNITY_FLOAT_PRECISION, \
1769 (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (UNITY_LINE_TYPE)(line), \
1770 (message))
1771#define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, \
1772 line, message) \
1773 UnityAssertEqualFloatArray((UNITY_FLOAT *)(expected), \
1774 (UNITY_FLOAT *)(actual), \
1775 (UNITY_UINT32)(num_elements), (message), \
1776 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
1777#define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, \
1778 line, message) \
1779 UnityAssertEqualFloatArray(UnityFloatToPtr(expected), \
1780 (UNITY_FLOAT *)(actual), \
1781 (UNITY_UINT32)(num_elements), (message), \
1782 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
1783#define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) \
1784 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1785 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF)
1786#define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) \
1787 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1788 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF)
1789#define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) \
1790 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1791 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN)
1792#define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) \
1793 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1794 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET)
1795#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) \
1796 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1797 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF)
1798#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) \
1799 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1800 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF)
1801#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) \
1802 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1803 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN)
1804#define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) \
1805 UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), \
1806 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET)
1807#endif
1808
1809#ifdef UNITY_EXCLUDE_DOUBLE
1810#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, \
1811 message) \
1812 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1813#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) \
1814 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1815#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, \
1816 line, message) \
1817 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1818#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, \
1819 line, message) \
1820 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1821#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) \
1822 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1823#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) \
1824 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1825#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) \
1826 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1827#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) \
1828 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1829#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) \
1830 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1831#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) \
1832 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1833#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) \
1834 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1835#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) \
1836 UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
1837#else
1838#define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, \
1839 message) \
1840 UnityAssertDoublesWithin((UNITY_DOUBLE)(delta), (UNITY_DOUBLE)(expected), \
1841 (UNITY_DOUBLE)(actual), (message), \
1842 (UNITY_LINE_TYPE)(line))
1843#define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) \
1844 UNITY_TEST_ASSERT_DOUBLE_WITHIN( \
1845 (UNITY_DOUBLE)(expected) * (UNITY_DOUBLE)UNITY_DOUBLE_PRECISION, \
1846 (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), \
1847 (UNITY_LINE_TYPE)(line), (message))
1848#define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, \
1849 line, message) \
1850 UnityAssertEqualDoubleArray((UNITY_DOUBLE *)(expected), \
1851 (UNITY_DOUBLE *)(actual), \
1852 (UNITY_UINT32)(num_elements), (message), \
1853 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY)
1854#define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, \
1855 line, message) \
1856 UnityAssertEqualDoubleArray(UnityDoubleToPtr(expected), \
1857 (UNITY_DOUBLE *)(actual), \
1858 (UNITY_UINT32)(num_elements), (message), \
1859 (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL)
1860#define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) \
1861 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1862 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF)
1863#define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) \
1864 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1865 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF)
1866#define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) \
1867 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1868 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN)
1869#define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) \
1870 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1871 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET)
1872#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) \
1873 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1874 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF)
1875#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) \
1876 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1877 (UNITY_LINE_TYPE)(line), \
1878 UNITY_FLOAT_IS_NOT_NEG_INF)
1879#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) \
1880 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1881 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN)
1882#define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) \
1883 UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), \
1884 (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET)
1885#endif
1886
1887/* End of UNITY_INTERNALS_H */
1888#endif