Mistake on this page?
Report an issue in GitHub or email us
unity_internals.h
1 
2 /** \addtogroup frameworks */
3 /** @{*/
4 /* ==========================================
5  Unity Project - A Test Framework for C
6  Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams
7  [Released under MIT License. Please refer to license.txt for details]
8 ========================================== */
9 
10 #ifndef UNITY_INTERNALS_H
11 #define UNITY_INTERNALS_H
12 
13 #ifdef UNITY_INCLUDE_CONFIG_H
14 #include "unity_config.h"
15 #endif
16 
17 #include <setjmp.h>
18 
19 /* Unity Attempts to Auto-Detect Integer Types
20  * Attempt 1: UINT_MAX, ULONG_MAX, etc in <stdint.h>
21  * Attempt 2: UINT_MAX, ULONG_MAX, etc in <limits.h>
22  * Attempt 3: Deduced from sizeof() macros */
23 #ifndef UNITY_EXCLUDE_STDINT_H
24 #include <stdint.h>
25 #endif
26 
27 #ifndef UNITY_EXCLUDE_LIMITS_H
28 #include <limits.h>
29 #endif
30 
31 #ifndef UNITY_EXCLUDE_SIZEOF
32 #ifndef UINT_MAX
33 #define UINT_MAX (sizeof(unsigned int) * 256 - 1)
34 #endif
35 #ifndef ULONG_MAX
36 #define ULONG_MAX (sizeof(unsigned long) * 256 - 1)
37 #endif
38 #ifndef UINTPTR_MAX
39 /* apparently this is not a constant expression: (sizeof(unsigned int *) * 256 - 1) so we have to just let this fall through */
40 #endif
41 #endif
42 
43 #ifndef UNITY_EXCLUDE_MATH_H
44 #include <math.h>
45 #endif
46 
47 /*-------------------------------------------------------
48  * Guess Widths If Not Specified
49  *-------------------------------------------------------*/
50 
51 /* Determine the size of an int, if not already specificied.
52  * We cannot use sizeof(int), because it is not yet defined
53  * at this stage in the trnslation of the C program.
54  * Therefore, infer it from UINT_MAX if possible. */
55 #ifndef UNITY_INT_WIDTH
56  #ifdef UINT_MAX
57  #if (UINT_MAX == 0xFFFF)
58  #define UNITY_INT_WIDTH (16)
59  #elif (UINT_MAX == 0xFFFFFFFF)
60  #define UNITY_INT_WIDTH (32)
61  #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF)
62  #define UNITY_INT_WIDTH (64)
63  #endif
64  #endif
65 #endif
66 #ifndef UNITY_INT_WIDTH
67  #define UNITY_INT_WIDTH (32)
68 #endif
69 
70 /* Determine the size of a long, if not already specified,
71  * by following the process used above to define
72  * UNITY_INT_WIDTH. */
73 #ifndef UNITY_LONG_WIDTH
74  #ifdef ULONG_MAX
75  #if (ULONG_MAX == 0xFFFF)
76  #define UNITY_LONG_WIDTH (16)
77  #elif (ULONG_MAX == 0xFFFFFFFF)
78  #define UNITY_LONG_WIDTH (32)
79  #elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF)
80  #define UNITY_LONG_WIDTH (64)
81  #endif
82  #endif
83 #endif
84 #ifndef UNITY_LONG_WIDTH
85  #define UNITY_LONG_WIDTH (32)
86 #endif
87 
88 /* Determine the size of a pointer, if not already specified,
89  * by following the process used above to define
90  * UNITY_INT_WIDTH. */
91 #ifndef UNITY_POINTER_WIDTH
92  #ifdef UINTPTR_MAX
93  #if (UINTPTR_MAX+0 <= 0xFFFF)
94  #define UNITY_POINTER_WIDTH (16)
95  #elif (UINTPTR_MAX+0 <= 0xFFFFFFFF)
96  #define UNITY_POINTER_WIDTH (32)
97  #elif (UINTPTR_MAX+0 <= 0xFFFFFFFFFFFFFFFF)
98  #define UNITY_POINTER_WIDTH (64)
99  #endif
100  #endif
101 #endif
102 #ifndef UNITY_POINTER_WIDTH
103  #ifdef INTPTR_MAX
104  #if (INTPTR_MAX+0 <= 0x7FFF)
105  #define UNITY_POINTER_WIDTH (16)
106  #elif (INTPTR_MAX+0 <= 0x7FFFFFFF)
107  #define UNITY_POINTER_WIDTH (32)
108  #elif (INTPTR_MAX+0 <= 0x7FFFFFFFFFFFFFFF)
109  #define UNITY_POINTER_WIDTH (64)
110  #endif
111  #endif
112 #endif
113 #ifndef UNITY_POINTER_WIDTH
114  #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH
115 #endif
116 
117 /*-------------------------------------------------------
118  * Int Support (Define types based on detected sizes)
119  *-------------------------------------------------------*/
120 
121 #if (UNITY_INT_WIDTH == 32)
122  typedef unsigned char _UU8;
123  typedef unsigned short _UU16;
124  typedef unsigned int _UU32;
125  typedef signed char _US8;
126  typedef signed short _US16;
127  typedef signed int _US32;
128 #elif (UNITY_INT_WIDTH == 16)
129  typedef unsigned char _UU8;
130  typedef unsigned int _UU16;
131  typedef unsigned long _UU32;
132  typedef signed char _US8;
133  typedef signed int _US16;
134  typedef signed long _US32;
135 #else
136  #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported)
137 #endif
138 
139 /*-------------------------------------------------------
140  * 64-bit Support
141  *-------------------------------------------------------*/
142 
143 #ifndef UNITY_SUPPORT_64
144 #if UNITY_LONG_WIDTH > 32
145 #define UNITY_SUPPORT_64
146 #endif
147 #endif
148 #ifndef UNITY_SUPPORT_64
149 #if UNITY_POINTER_WIDTH > 32
150 #define UNITY_SUPPORT_64
151 #endif
152 #endif
153 
154 #ifndef UNITY_SUPPORT_64
155 
156 /* No 64-bit Support */
157 typedef _UU32 _U_UINT;
158 typedef _US32 _U_SINT;
159 
160 #else
161 
162 /* 64-bit Support */
163 #if (UNITY_LONG_WIDTH == 32)
164  typedef unsigned long long _UU64;
165  typedef signed long long _US64;
166 #elif (UNITY_LONG_WIDTH == 64)
167  typedef unsigned long _UU64;
168  typedef signed long _US64;
169 #else
170  #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported)
171 #endif
172 typedef _UU64 _U_UINT;
173 typedef _US64 _U_SINT;
174 
175 #endif
176 
177 /*-------------------------------------------------------
178  * Pointer Support
179  *-------------------------------------------------------*/
180 
181 #if (UNITY_POINTER_WIDTH == 32)
182  typedef _UU32 _UP;
183 #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32
184 #elif (UNITY_POINTER_WIDTH == 64)
185  typedef _UU64 _UP;
186 #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64
187 #elif (UNITY_POINTER_WIDTH == 16)
188  typedef _UU16 _UP;
189 #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16
190 #else
191  #error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported)
192 #endif
193 
194 #ifndef UNITY_PTR_ATTRIBUTE
195 #define UNITY_PTR_ATTRIBUTE
196 #endif
197 
198 #ifndef UNITY_INTERNAL_PTR
199 #define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const void*
200 /* #define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const _UU8* */
201 #endif
202 
203 /*-------------------------------------------------------
204  * Float Support
205  *-------------------------------------------------------*/
206 
207 #ifdef UNITY_EXCLUDE_FLOAT
208 
209 /* No Floating Point Support */
210 #undef UNITY_INCLUDE_FLOAT
211 #undef UNITY_FLOAT_PRECISION
212 #undef UNITY_FLOAT_TYPE
213 #undef UNITY_FLOAT_VERBOSE
214 
215 #else
216 
217 #ifndef UNITY_INCLUDE_FLOAT
218 #define UNITY_INCLUDE_FLOAT
219 #endif
220 
221 /* Floating Point Support */
222 #ifndef UNITY_FLOAT_PRECISION
223 #define UNITY_FLOAT_PRECISION (0.00001f)
224 #endif
225 #ifndef UNITY_FLOAT_TYPE
226 #define UNITY_FLOAT_TYPE float
227 #endif
228 typedef UNITY_FLOAT_TYPE _UF;
229 
230 #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
231 #else
232 
233 #ifndef isinf
234 #define isinf(n) (((1.0f / f_zero) == n) ? 1 : 0) || (((-1.0f / f_zero) == n) ? 1 : 0)
235 #define UNITY_FLOAT_NEEDS_ZERO
236 #endif
237 
238 #ifndef isnan
239 #define isnan(n) ((n != n) ? 1 : 0)
240 #endif
241 
242 #endif /* ARMC6 */
243 
244 #ifndef isneg
245 #define isneg(n) ((n < 0.0f) ? 1 : 0)
246 #endif
247 
248 #ifndef ispos
249 #define ispos(n) ((n > 0.0f) ? 1 : 0)
250 #endif
251 
252 #endif
253 
254 /*-------------------------------------------------------
255  * Double Float Support
256  *-------------------------------------------------------*/
257 
258 /* unlike FLOAT, we DON'T include by default */
259 #ifndef UNITY_EXCLUDE_DOUBLE
260 #ifndef UNITY_INCLUDE_DOUBLE
261 #define UNITY_EXCLUDE_DOUBLE
262 #endif
263 #endif
264 
265 #ifdef UNITY_EXCLUDE_DOUBLE
266 
267 /* No Floating Point Support */
268 #undef UNITY_DOUBLE_PRECISION
269 #undef UNITY_DOUBLE_TYPE
270 #undef UNITY_DOUBLE_VERBOSE
271 
272 #ifdef UNITY_INCLUDE_DOUBLE
273 #undef UNITY_INCLUDE_DOUBLE
274 #endif
275 
276 #else
277 
278 /* Double Floating Point Support */
279 #ifndef UNITY_DOUBLE_PRECISION
280 #define UNITY_DOUBLE_PRECISION (1e-12f)
281 #endif
282 #ifndef UNITY_DOUBLE_TYPE
283 #define UNITY_DOUBLE_TYPE double
284 #endif
285 typedef UNITY_DOUBLE_TYPE _UD;
286 
287 #endif
288 
289 #ifdef UNITY_DOUBLE_VERBOSE
290 #ifndef UNITY_FLOAT_VERBOSE
291 #define UNITY_FLOAT_VERBOSE
292 #endif
293 #endif
294 
295 /*-------------------------------------------------------
296  * Output Method: stdout (DEFAULT)
297  *-------------------------------------------------------*/
298 #ifndef UNITY_OUTPUT_CHAR
299 /* Default to using putchar, which is defined in stdio.h */
300 #include <stdio.h>
301 #define UNITY_OUTPUT_CHAR(a) (void)putchar(a)
302 #else
303  /* If defined as something else, make sure we declare it here so it's ready for use */
304  #ifndef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION
305 extern void UNITY_OUTPUT_CHAR(int);
306  #endif
307 #endif
308 
309 #ifndef UNITY_OUTPUT_FLUSH
310 /* Default to using putchar, which is defined in stdio.h */
311 #include <stdio.h>
312 #define UNITY_OUTPUT_FLUSH() (void)fflush(stdout)
313 #else
314  /* If defined as something else, make sure we declare it here so it's ready for use */
315  #ifndef UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
316 extern void UNITY_OUTPUT_FLUSH(void);
317  #endif
318 #endif
319 
320 #ifndef UNITY_PRINT_EOL
321 #define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n')
322 #endif
323 
324 #ifndef UNITY_OUTPUT_START
325 #define UNITY_OUTPUT_START()
326 #endif
327 
328 #ifndef UNITY_OUTPUT_COMPLETE
329 #define UNITY_OUTPUT_COMPLETE()
330 #endif
331 
332 /*-------------------------------------------------------
333  * Footprint
334  *-------------------------------------------------------*/
335 
336 #ifndef UNITY_LINE_TYPE
337 #define UNITY_LINE_TYPE _U_UINT
338 #endif
339 
340 #ifndef UNITY_COUNTER_TYPE
341 #define UNITY_COUNTER_TYPE _U_UINT
342 #endif
343 
344 /*-------------------------------------------------------
345  * Language Features Available
346  *-------------------------------------------------------*/
347 #if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA)
348 # ifdef __GNUC__ /* includes clang */
349 # if !(defined(__WIN32__) && defined(__clang__))
350 # define UNITY_WEAK_ATTRIBUTE __attribute__((weak))
351 # endif
352 # endif
353 #endif
354 
355 #ifdef UNITY_NO_WEAK
356 # undef UNITY_WEAK_ATTRIBUTE
357 # undef UNITY_WEAK_PRAGMA
358 #endif
359 
360 
361 /*-------------------------------------------------------
362  * Internal Structs Needed
363  *-------------------------------------------------------*/
364 
365 typedef void (*UnityTestFunction)(void);
366 
367 #define UNITY_DISPLAY_RANGE_INT (0x10)
368 #define UNITY_DISPLAY_RANGE_UINT (0x20)
369 #define UNITY_DISPLAY_RANGE_HEX (0x40)
370 #define UNITY_DISPLAY_RANGE_AUTO (0x80)
371 
372 typedef enum
373 {
374 #if (UNITY_INT_WIDTH == 16)
375  UNITY_DISPLAY_STYLE_INT = 2 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO,
376 #elif (UNITY_INT_WIDTH == 32)
377  UNITY_DISPLAY_STYLE_INT = 4 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO,
378 #elif (UNITY_INT_WIDTH == 64)
379  UNITY_DISPLAY_STYLE_INT = 8 + UNITY_DISPLAY_RANGE_INT + UNITY_DISPLAY_RANGE_AUTO,
380 #endif
381  UNITY_DISPLAY_STYLE_INT8 = 1 + UNITY_DISPLAY_RANGE_INT,
382  UNITY_DISPLAY_STYLE_INT16 = 2 + UNITY_DISPLAY_RANGE_INT,
383  UNITY_DISPLAY_STYLE_INT32 = 4 + UNITY_DISPLAY_RANGE_INT,
384 #ifdef UNITY_SUPPORT_64
385  UNITY_DISPLAY_STYLE_INT64 = 8 + UNITY_DISPLAY_RANGE_INT,
386 #endif
387 
388 #if (UNITY_INT_WIDTH == 16)
389  UNITY_DISPLAY_STYLE_UINT = 2 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO,
390 #elif (UNITY_INT_WIDTH == 32)
391  UNITY_DISPLAY_STYLE_UINT = 4 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO,
392 #elif (UNITY_INT_WIDTH == 64)
393  UNITY_DISPLAY_STYLE_UINT = 8 + UNITY_DISPLAY_RANGE_UINT + UNITY_DISPLAY_RANGE_AUTO,
394 #endif
395  UNITY_DISPLAY_STYLE_UINT8 = 1 + UNITY_DISPLAY_RANGE_UINT,
396  UNITY_DISPLAY_STYLE_UINT16 = 2 + UNITY_DISPLAY_RANGE_UINT,
397  UNITY_DISPLAY_STYLE_UINT32 = 4 + UNITY_DISPLAY_RANGE_UINT,
398 #ifdef UNITY_SUPPORT_64
399  UNITY_DISPLAY_STYLE_UINT64 = 8 + UNITY_DISPLAY_RANGE_UINT,
400 #endif
401  UNITY_DISPLAY_STYLE_HEX8 = 1 + UNITY_DISPLAY_RANGE_HEX,
402  UNITY_DISPLAY_STYLE_HEX16 = 2 + UNITY_DISPLAY_RANGE_HEX,
403  UNITY_DISPLAY_STYLE_HEX32 = 4 + UNITY_DISPLAY_RANGE_HEX,
404 #ifdef UNITY_SUPPORT_64
405  UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX,
406 #endif
407  UNITY_DISPLAY_STYLE_UNKNOWN
408 } UNITY_DISPLAY_STYLE_T;
409 
410 #ifndef UNITY_EXCLUDE_FLOAT
411 typedef enum _UNITY_FLOAT_TRAIT_T
412 {
413  UNITY_FLOAT_IS_NOT_INF = 0,
414  UNITY_FLOAT_IS_INF,
415  UNITY_FLOAT_IS_NOT_NEG_INF,
416  UNITY_FLOAT_IS_NEG_INF,
417  UNITY_FLOAT_IS_NOT_NAN,
418  UNITY_FLOAT_IS_NAN,
419  UNITY_FLOAT_IS_NOT_DET,
420  UNITY_FLOAT_IS_DET,
421  UNITY_FLOAT_INVALID_TRAIT
422 } UNITY_FLOAT_TRAIT_T;
423 #endif
424 
425 struct _Unity
426 {
427  const char* TestFile;
428  const char* CurrentTestName;
429 #ifndef UNITY_EXCLUDE_DETAILS
430  const char* CurrentDetail1;
431  const char* CurrentDetail2;
432 #endif
433  UNITY_LINE_TYPE CurrentTestLineNumber;
434  UNITY_COUNTER_TYPE NumberOfTests;
435  UNITY_COUNTER_TYPE TestFailures;
436  UNITY_COUNTER_TYPE TestIgnores;
437  UNITY_COUNTER_TYPE CurrentTestFailed;
438  UNITY_COUNTER_TYPE CurrentTestIgnored;
439  jmp_buf AbortFrame;
440 };
441 
442 extern struct _Unity Unity;
443 
444 #ifdef __cplusplus
445 extern "C" {
446 #endif
447 
448 /*-------------------------------------------------------
449  * Test Suite Management
450  *-------------------------------------------------------*/
451 
452 
453 void UnityBegin(const char* filename);
454 int UnityEnd(void);
455 void UnityConcludeTest(void);
456 void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum);
457 
458 /*-------------------------------------------------------
459  * Details Support
460  *-------------------------------------------------------*/
461 
462 #ifdef UNITY_EXCLUDE_DETAILS
463 #define UNITY_CLR_DETAILS()
464 #define UNITY_SET_DETAIL(d1)
465 #define UNITY_SET_DETAILS(d1,d2)
466 #else
467 #define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; }
468 #define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = 0; }
469 #define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = d2; }
470 
471 #ifndef UNITY_DETAIL1_NAME
472 #define UNITY_DETAIL1_NAME "Function"
473 #endif
474 
475 #ifndef UNITY_DETAIL2_NAME
476 #define UNITY_DETAIL2_NAME "Argument"
477 #endif
478 #endif
479 
480 /*-------------------------------------------------------
481  * Test Output
482  *-------------------------------------------------------*/
483 
484 void UnityPrint(const char* string);
485 void UnityPrintMask(const _U_UINT mask, const _U_UINT number);
486 void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style);
487 void UnityPrintNumber(const _U_SINT number);
488 void UnityPrintNumberUnsigned(const _U_UINT number);
489 void UnityPrintNumberHex(const _U_UINT number, const char nibbles);
490 
491 #ifdef UNITY_FLOAT_VERBOSE
492 void UnityPrintFloat(const _UF number);
493 #endif
494 
495 /*-------------------------------------------------------
496  * Test Assertion Fuctions
497  *-------------------------------------------------------
498  * Use the macros below this section instead of calling
499  * these directly. The macros have a consistent naming
500  * convention and will pull in file and line information
501  * for you. */
502 
503 void UnityAssertEqualNumber(const _U_SINT expected,
504  const _U_SINT actual,
505  const char* msg,
506  const UNITY_LINE_TYPE lineNumber,
507  const UNITY_DISPLAY_STYLE_T style);
508 
509 void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
510  UNITY_INTERNAL_PTR actual,
511  const _UU32 num_elements,
512  const char* msg,
513  const UNITY_LINE_TYPE lineNumber,
514  const UNITY_DISPLAY_STYLE_T style);
515 
516 void UnityAssertBits(const _U_SINT mask,
517  const _U_SINT expected,
518  const _U_SINT actual,
519  const char* msg,
520  const UNITY_LINE_TYPE lineNumber);
521 
522 void UnityAssertEqualString(const char* expected,
523  const char* actual,
524  const char* msg,
525  const UNITY_LINE_TYPE lineNumber);
526 
527 void UnityAssertEqualStringLen(const char* expected,
528  const char* actual,
529  const _UU32 length,
530  const char* msg,
531  const UNITY_LINE_TYPE lineNumber);
532 
533 void UnityAssertEqualStringArray( const char** expected,
534  const char** actual,
535  const _UU32 num_elements,
536  const char* msg,
537  const UNITY_LINE_TYPE lineNumber);
538 
539 void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
540  UNITY_INTERNAL_PTR actual,
541  const _UU32 length,
542  const _UU32 num_elements,
543  const char* msg,
544  const UNITY_LINE_TYPE lineNumber);
545 
546 void UnityAssertNumbersWithin(const _U_UINT delta,
547  const _U_SINT expected,
548  const _U_SINT actual,
549  const char* msg,
550  const UNITY_LINE_TYPE lineNumber,
551  const UNITY_DISPLAY_STYLE_T style);
552 
553 void UnityFail(const char* message, const UNITY_LINE_TYPE line);
554 
555 void UnityIgnore(const char* message, const UNITY_LINE_TYPE line);
556 
557 void UnitySkipPrint(const char* message, const UNITY_LINE_TYPE line);
558 
559 #ifndef UNITY_EXCLUDE_FLOAT
560 void UnityAssertFloatsWithin(const _UF delta,
561  const _UF expected,
562  const _UF actual,
563  const char* msg,
564  const UNITY_LINE_TYPE lineNumber);
565 
566 void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
567  UNITY_PTR_ATTRIBUTE const _UF* actual,
568  const _UU32 num_elements,
569  const char* msg,
570  const UNITY_LINE_TYPE lineNumber);
571 
572 void UnityAssertFloatSpecial(const _UF actual,
573  const char* msg,
574  const UNITY_LINE_TYPE lineNumber,
575  const UNITY_FLOAT_TRAIT_T style);
576 #endif
577 
578 #ifndef UNITY_EXCLUDE_DOUBLE
579 void UnityAssertDoublesWithin(const _UD delta,
580  const _UD expected,
581  const _UD actual,
582  const char* msg,
583  const UNITY_LINE_TYPE lineNumber);
584 
585 void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
586  UNITY_PTR_ATTRIBUTE const _UD* actual,
587  const _UU32 num_elements,
588  const char* msg,
589  const UNITY_LINE_TYPE lineNumber);
590 
591 void UnityAssertDoubleSpecial(const _UD actual,
592  const char* msg,
593  const UNITY_LINE_TYPE lineNumber,
594  const UNITY_FLOAT_TRAIT_T style);
595 #endif
596 
597 #ifdef __cplusplus
598 }
599 #endif // __cplusplus
600 
601 /*-------------------------------------------------------
602  * Error Strings We Might Need
603  *-------------------------------------------------------*/
604 
605 extern const char UnityStrErrFloat[];
606 extern const char UnityStrErrDouble[];
607 extern const char UnityStrErr64[];
608 
609 /*-------------------------------------------------------
610  * Test Running Macros
611  *-------------------------------------------------------*/
612 
613 #define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0)
614 
615 #define TEST_ABORT() {longjmp(Unity.AbortFrame, 1);}
616 
617 /* This tricky series of macros gives us an optional line argument to treat it as RUN_TEST(func, num=__LINE__) */
618 #ifndef RUN_TEST
619 #ifdef __STDC_VERSION__
620 #if __STDC_VERSION__ >= 199901L
621 #define RUN_TEST(...) UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__))
622 #define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway)
623 #define RUN_TEST_FIRST_HELPER(first, ...) (first), #first
624 #define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway)
625 #define RUN_TEST_SECOND_HELPER(first, second, ...) (second)
626 #endif
627 #endif
628 #endif
629 
630 /* If we can't do the tricky version, we'll just have to require them to always include the line number */
631 #ifndef RUN_TEST
632 #ifdef CMOCK
633 #define RUN_TEST(func, num) UnityDefaultTestRun(func, #func, num)
634 #else
635 #define RUN_TEST(func) UnityDefaultTestRun(func, #func, __LINE__)
636 #endif
637 #endif
638 
639 #define TEST_LINE_NUM (Unity.CurrentTestLineNumber)
640 #define TEST_IS_IGNORED (Unity.CurrentTestIgnored)
641 #define UNITY_NEW_TEST(a) \
642  Unity.CurrentTestName = (a); \
643  Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)(__LINE__); \
644  Unity.NumberOfTests++;
645 
646 #ifndef UNITY_BEGIN
647 #define UNITY_BEGIN() UnityBegin(__FILE__)
648 #endif
649 
650 #ifndef UNITY_END
651 #define UNITY_END() UnityEnd()
652 #endif
653 
654 #define UNITY_UNUSED(x) (void)(sizeof(x))
655 
656 /*-------------------------------------------------------
657  * Basic Fail and Ignore
658  *-------------------------------------------------------*/
659 
660 #define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line))
661 #define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line))
662 
663 /*-------------------------------------------------------
664  * Test Asserts
665  *-------------------------------------------------------*/
666 
667 #define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));}
668 #define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message))
669 #define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message))
670 
671 #define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
672 #define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
673 #define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
674 #define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
675 #define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
676 #define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU8 )(expected), (_U_SINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
677 #define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU16)(expected), (_U_SINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
678 #define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UU32)(expected), (_U_SINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
679 #define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
680 #define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
681 #define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
682 #define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((_U_SINT)(mask), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line))
683 
684 #define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
685 #define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU8 )(delta), (_U_SINT)(_US8 )(expected), (_U_SINT)(_US8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
686 #define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU16)(delta), (_U_SINT)(_US16)(expected), (_U_SINT)(_US16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
687 #define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU32)(delta), (_U_SINT)(_US32)(expected), (_U_SINT)(_US32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
688 #define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
689 #define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
690 #define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
691 #define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
692 #define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU8 )(delta), (_U_SINT)(_U_UINT)(_UU8 )(expected), (_U_SINT)(_U_UINT)(_UU8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
693 #define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU16)(delta), (_U_SINT)(_U_UINT)(_UU16)(expected), (_U_SINT)(_U_UINT)(_UU16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
694 #define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((_UU32)(delta), (_U_SINT)(_U_UINT)(_UU32)(expected), (_U_SINT)(_U_UINT)(_UU32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
695 
696 #define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(_UP)(expected), (_U_SINT)(_UP)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER)
697 #define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)(line))
698 #define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, message) UnityAssertEqualStringLen((const char*)(expected), (const char*)(actual), (_UU32)(len), (message), (UNITY_LINE_TYPE)(line))
699 #define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(len), 1, (message), (UNITY_LINE_TYPE)(line))
700 
701 #define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT)
702 #define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8)
703 #define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16)
704 #define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32)
705 #define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT)
706 #define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8)
707 #define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16)
708 #define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32)
709 #define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8)
710 #define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16)
711 #define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32)
712 #define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(_UP*)(expected), (UNITY_INTERNAL_PTR)(_UP*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER)
713 #define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((const char**)(expected), (const char**)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line))
714 #define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(len), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line))
715 
716 #ifdef UNITY_SUPPORT_64
717 #define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
718 #define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
719 #define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
720 #define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
721 #define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
722 #define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
723 #define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64)
724 #define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64)
725 #define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (_U_SINT)(expected), (_U_SINT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64)
726 #else
727 #define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
728 #define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
729 #define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
730 #define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
731 #define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
732 #define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
733 #define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
734 #define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
735 #define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64)
736 #endif
737 
738 #ifdef UNITY_EXCLUDE_FLOAT
739 #define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
740 #define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
741 #define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
742 #define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
743 #define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
744 #define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
745 #define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
746 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
747 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
748 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
749 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat)
750 #else
751 #define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UnityAssertFloatsWithin((_UF)(delta), (_UF)(expected), (_UF)(actual), (message), (UNITY_LINE_TYPE)(line))
752 #define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((_UF)(expected) * (_UF)UNITY_FLOAT_PRECISION, (_UF)(expected), (_UF)(actual), (UNITY_LINE_TYPE)(line), (message))
753 #define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((_UF*)(expected), (_UF*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)(line))
754 #define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF)
755 #define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF)
756 #define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN)
757 #define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET)
758 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF)
759 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF)
760 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN)
761 #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((_UF)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET)
762 #endif
763 
764 #ifdef UNITY_EXCLUDE_DOUBLE
765 #define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
766 #define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
767 #define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
768 #define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
769 #define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
770 #define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
771 #define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
772 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
773 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
774 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
775 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble)
776 #else
777 #define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UnityAssertDoublesWithin((_UD)(delta), (_UD)(expected), (_UD)(actual), (message), (UNITY_LINE_TYPE)line)
778 #define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((_UD)(expected) * (_UD)UNITY_DOUBLE_PRECISION, (_UD)expected, (_UD)actual, (UNITY_LINE_TYPE)(line), message)
779 #define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((_UD*)(expected), (_UD*)(actual), (_UU32)(num_elements), (message), (UNITY_LINE_TYPE)line)
780 #define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF)
781 #define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF)
782 #define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN)
783 #define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET)
784 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF)
785 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF)
786 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN)
787 #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((_UD)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET)
788 #endif
789 
790 /*-------------------------------------------------------
791  * Test skip
792  *-------------------------------------------------------*/
793 
794 #define UNITY_TEST_SKIP(line, message) { UnitySkipPrint( (message), (UNITY_LINE_TYPE)(line)); return; }
795 #define UNITY_TEST_SKIP_UNLESS(condition, line, message) if (!(condition)) UNITY_TEST_SKIP((line), (message))
796 
797 /* End of UNITY_INTERNALS_H */
798 #endif
799 
800 /** @}*/
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.