0


C语言断言assert和单元测试的关系_单元测试assert和

TEST_ASSERT_UNLESS(condition)
另一种调用

  1. TEST_ASSERT_FALSE

的方法

TEST_FAIL()
TEST_FAIL_MESSAGE(message)

这个测试被自动标记为失败。
消息输出说明了原因。


Numerical Assertions: Integers

TEST_ASSERT_EQUAL_INT(expected, actual)
TEST_ASSERT_EQUAL_INT8(expected, actual)
TEST_ASSERT_EQUAL_INT16(expected, actual)
TEST_ASSERT_EQUAL_INT32(expected, actual)
TEST_ASSERT_EQUAL_INT64(expected, actual)

比较两个整数是否相等,并将错误显示为带符号的整数。强制类型转换将按您的自然整数大小执行,因此经常可以使用这种方法。当你需要指定确切的大小,如比较数组时,你可以使用一个特定的版本:

TEST_ASSERT_EQUAL_UINT(expected, actual)
TEST_ASSERT_EQUAL_UINT8(expected, actual)
TEST_ASSERT_EQUAL_UINT16(expected, actual)
TEST_ASSERT_EQUAL_UINT32(expected, actual)
TEST_ASSERT_EQUAL_UINT64(expected, actual)

比较两个整数是否相等,并将错误显示为无符号整数。像

  1. INT

一样,也有不同大小的变体。

TEST_ASSERT_EQUAL_HEX(expected, actual)
TEST_ASSERT_EQUAL_HEX8(expected, actual)
TEST_ASSERT_EQUAL_HEX16(expected, actual)
TEST_ASSERT_EQUAL_HEX32(expected, actual)
TEST_ASSERT_EQUAL_HEX64(expected, actual)

比较两个整数是否相等,并将错误显示为十六进制。与其他整数比较一样,您可以指定大小…在这里,大小也会影响显示了多少个小块(例如,

  1. HEX16

将显示4个小块)。

TEST_ASSERT_EQUAL(expected, actual)
另一种调用

  1. TEST_ASSERT_EQUAL_INT

的方法

TEST_ASSERT_INT_WITHIN(delta, expected, actual)
断言实际值在期望值的正负之间。这也出现在大小特定的变体。

TEST_ASSERT_GREATER_THAN(threshold, actual)
断言实际值大于阈值。这也出现在大小特定的变体。

TEST_ASSERT_LESS_THAN(threshold, actual)
断言实际值小于阈值。这也出现在大小特定的变体。


Arrays

_ARRAY

您可以将

  1. _ARRAY

附加到任何这些宏中,以对该类型进行数组比较。在这里,您需要更关心被检查的值的实际大小。您还将指定一个附加参数,即要比较的元素数量。例如:

  1. TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, elements)
  2. _EACH_EQUAL

另一个数组比较选项是检查数组中的每个元素是否等于单个期望值。您可以通过指定

  1. EACH_EQUAL

宏来实现这一点。例如:

  1. TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, elements)

Numerical Assertions: Bitwise

TEST_ASSERT_BITS(mask, expected, actual)
使用一个整数掩码来指定两个其他整数之间应该比较哪些位。比较掩码中的高比特,忽略低比特。

TEST_ASSERT_BITS_HIGH(mask, actual)
使用整数掩码指定应该检查哪些位以确定它们是否都设置为高。比较掩码中的高比特,忽略低比特。

TEST_ASSERT_BITS_LOW(mask, actual)
使用一个整数掩码来指定应该检查哪些位以确定它们是否都设置得很低。比较掩码中的高比特,忽略低比特。

TEST_ASSERT_BIT_HIGH(bit, actual)
测试单个位,并验证它是否高。为32位整数指定0-31位。

TEST_ASSERT_BIT_LOW(bit, actual)
测试一个比特并确认它是低的。为32位整数指定0-31位。


Numerical Assertions: Floats

TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual)
断言实际值在期望值的正负之间。

TEST_ASSERT_EQUAL_FLOAT(expected, actual)
TEST_ASSERT_EQUAL_DOUBLE(expected, actual)

断言两个浮点值在期望值的小%增量内“相等”。


String Assertions

TEST_ASSERT_EQUAL_STRING(expected, actual)
比较两个空终止字符串。如果任何字符不同或长度不同,则失败。

TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len)
比较两个字符串。如果任何字符不同,则在len字符后停止比较。

TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message)
比较两个空终止字符串。如果任何字符不同或长度不同,则失败。失败时输出自定义消息。

TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message)
比较两个字符串。如果任何字符不同,则在len字符后停止比较。失败时输出自定义消息。


Pointer Assertions

大多数指针操作都可以通过使用上面的整数比较来执行。但是,为了清楚起见,添加了一些特殊的情况。

TEST_ASSERT_NULL(pointer)
如果指针不等于NULL,则失败

TEST_ASSERT_NOT_NULL(pointer)
如果指针等于NULL,则失败


Memory Assertions

TEST_ASSERT_EQUAL_MEMORY(expected, actual, len)
比较两块内存。对于不能强制执行标准类型的类型来说,这是一个很好的通用断言……但是由于这是内存比较,所以必须注意数据类型的打包。

可以看到在unity中,存在着各种各样的断言。

除了C语言库中存在的真假断言,还有整数断言,数组断言,位断言,浮点数断言,字符串断言,指针断言,


在单元测试框架中,我们在一个测试函数中,可以建立对某个函数的完整测试,

  1. void testNullInputToInit\_should\_fail(void) {
  2. uint8_t ret;
  3. lwrb_t buff = { 0 };
  4. uint8_t buff_data[1];
  5. ret = lwrb\_init(NULL, buff_data, sizeof(buff_data));
  6. TEST\_ASSERT\_EQUAL(0, ret);
  7. ret = lwrb\_init(&buff, NULL, sizeof(buff_data));
  8. TEST\_ASSERT\_EQUAL(0, ret);
  9. ret = lwrb\_init(&buff, buff_data, 0);
  10. TEST\_ASSERT\_EQUAL(0, ret);
  11. ret = lwrb\_is\_ready(&buff);
  12. TEST\_ASSERT\_EQUAL(0, ret);
  13. }

在这个测试函数中,我们主要测试的是环形缓冲的lwrb_init函数,我们对其进行了不同的输入测试,并且使用断言来判断实际输出和我们期望的输出是否一致。

在我之前的博客【C语言开源库】在CLion上使用一个轻量的适合嵌入式系统的环形缓冲库ring buffer 和C语言Unity单元测试框架中,我们测试了环形缓冲开源库的一些函数,运行结果和预期一致时,运行显示如下

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-rlVueSAk-1628230382669)(https://raw.githubusercontent.com/xkyvvv/blogpic/main/pic1/image-20210805180906253.png)]

当运行结果和预期不一致时,运行显示如下

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-cB2Xl1Ii-1628230382671)(https://raw.githubusercontent.com/xkyvvv/blogpic/main/pic1/image-20210805181024986.png)]

可以看到,单元测试框架就是一个断言集合,下面我们通过源码来看一下不同断言的具体实现。

  1. /\* ==========================================
  2. Unity Project - A Test Framework for C
  3. Copyright (c) 2007-21 Mike Karlesky, Mark VanderVoord, Greg Williams
  4. [Released under MIT License. Please refer to license.txt for details]
  5. ========================================== \*/
  6. #ifndef UNITY\_FRAMEWORK\_H
  7. #define UNITY\_FRAMEWORK\_H
  8. #define UNITY
  9. #define UNITY\_VERSION\_MAJOR 2
  10. #define UNITY\_VERSION\_MINOR 5
  11. #define UNITY\_VERSION\_BUILD 4
  12. #define UNITY\_VERSION ((UNITY\_VERSION\_MAJOR << 16) | (UNITY\_VERSION\_MINOR << 8) | UNITY\_VERSION\_BUILD)
  13. #ifdef \_\_cplusplus
  14. extern "C"
  15. {
  16. #endif
  17. #include "unity\_internals.h"
  18. /\*-------------------------------------------------------
  19. \* Test Setup / Teardown
  20. \*-------------------------------------------------------\*/
  21. /\* These functions are intended to be called before and after each test.
  22. \* If using unity directly, these will need to be provided for each test
  23. \* executable built. If you are using the test runner generator and/or
  24. \* Ceedling, these are optional. \*/
  25. void setUp(void);
  26. void tearDown(void);
  27. /\* These functions are intended to be called at the beginning and end of an
  28. \* entire test suite. suiteTearDown() is passed the number of tests that
  29. \* failed, and its return value becomes the exit code of main(). If using
  30. \* Unity directly, you're in charge of calling these if they are desired.
  31. \* If using Ceedling or the test runner generator, these will be called
  32. \* automatically if they exist. \*/
  33. void suiteSetUp(void);
  34. int suiteTearDown(int num_failures);
  35. /\*-------------------------------------------------------
  36. \* Test Reset and Verify
  37. \*-------------------------------------------------------\*/
  38. /\* These functions are intended to be called before during tests in order
  39. \* to support complex test loops, etc. Both are NOT built into Unity. Instead
  40. \* the test runner generator will create them. resetTest will run teardown and
  41. \* setup again, verifying any end-of-test needs between. verifyTest will only
  42. \* run the verification. \*/
  43. void resetTest(void);
  44. void verifyTest(void);
  45. /\*-------------------------------------------------------
  46. \* Configuration Options
  47. \*-------------------------------------------------------
  48. \* All options described below should be passed as a compiler flag to all files using Unity. If you must add #defines, place them BEFORE the #include above.
  49. \* Integers/longs/pointers
  50. \* - Unity attempts to automatically discover your integer sizes
  51. \* - define UNITY\_EXCLUDE\_STDINT\_H to stop attempting to look in <stdint.h>
  52. \* - define UNITY\_EXCLUDE\_LIMITS\_H to stop attempting to look in <limits.h>
  53. \* - If you cannot use the automatic methods above, you can force Unity by using these options:
  54. \* - define UNITY\_SUPPORT\_64
  55. \* - set UNITY\_INT\_WIDTH
  56. \* - set UNITY\_LONG\_WIDTH
  57. \* - set UNITY\_POINTER\_WIDTH
  58. \* Floats
  59. \* - define UNITY\_EXCLUDE\_FLOAT to disallow floating point comparisons
  60. \* - define UNITY\_FLOAT\_PRECISION to specify the precision to use when doing TEST\_ASSERT\_EQUAL\_FLOAT
  61. \* - define UNITY\_FLOAT\_TYPE to specify doubles instead of single precision floats
  62. \* - define UNITY\_INCLUDE\_DOUBLE to allow double floating point comparisons
  63. \* - define UNITY\_EXCLUDE\_DOUBLE to disallow double floating point comparisons (default)
  64. \* - define UNITY\_DOUBLE\_PRECISION to specify the precision to use when doing TEST\_ASSERT\_EQUAL\_DOUBLE
  65. \* - define UNITY\_DOUBLE\_TYPE to specify something other than double
  66. \* - define UNITY\_EXCLUDE\_FLOAT\_PRINT to trim binary size, won't print floating point values in errors
  67. \* Output
  68. \* - by default, Unity prints to standard out with putchar. define UNITY\_OUTPUT\_CHAR(a) with a different function if desired
  69. \* - define UNITY\_DIFFERENTIATE\_FINAL\_FAIL to print FAILED (vs. FAIL) at test end summary - for automated search for failure
  70. \* Optimization
  71. \* - by default, line numbers are stored in unsigned shorts. Define UNITY\_LINE\_TYPE with a different type if your files are huge
  72. \* - by default, test and failure counters are unsigned shorts. Define UNITY\_COUNTER\_TYPE with a different type if you want to save space or have more than 65535 Tests.
  73. \* Test Cases
  74. \* - define UNITY\_SUPPORT\_TEST\_CASES to include the TEST\_CASE macro, though really it's mostly about the runner generator script
  75. \* Parameterized Tests
  76. \* - you'll want to create a define of TEST\_CASE(...) which basically evaluates to nothing
  77. \* Tests with Arguments
  78. \* - you'll want to define UNITY\_USE\_COMMAND\_LINE\_ARGS if you have the test runner passing arguments to Unity
  79. \*-------------------------------------------------------
  80. \* Basic Fail and Ignore
  81. \*-------------------------------------------------------\*/
  82. #define TEST\_FAIL\_MESSAGE(message) UNITY\_TEST\_FAIL(\_\_LINE\_\_, (message))
  83. #define TEST\_FAIL() UNITY\_TEST\_FAIL(\_\_LINE\_\_, NULL)
  84. #define TEST\_IGNORE\_MESSAGE(message) UNITY\_TEST\_IGNORE(\_\_LINE\_\_, (message))
  85. #define TEST\_IGNORE() UNITY\_TEST\_IGNORE(\_\_LINE\_\_, NULL)
  86. #define TEST\_MESSAGE(message) UnityMessage((message), \_\_LINE\_\_)
  87. #define TEST\_ONLY()
  88. #ifdef UNITY\_INCLUDE\_PRINT\_FORMATTED
  89. #define TEST\_PRINTF(message, ...) UnityPrintF(\_\_LINE\_\_, (message), \_\_VA\_ARGS\_\_)
  90. #endif
  91. /\* It is not necessary for you to call PASS. A PASS condition is assumed if nothing fails.
  92. \* This method allows you to abort a test immediately with a PASS state, ignoring the remainder of the test. \*/
  93. #define TEST\_PASS() TEST\_ABORT()
  94. #define TEST\_PASS\_MESSAGE(message) do { UnityMessage((message), \_\_LINE\_\_); TEST\_ABORT(); } while(0)
  95. /\* This macro does nothing, but it is useful for build tools (like Ceedling) to make use of this to figure out
  96. \* which files should be linked to in order to perform a test. Use it like TEST\_FILE("sandwiches.c") \*/
  97. #define TEST\_FILE(a)
  98. /\*-------------------------------------------------------
  99. \* Test Asserts (simple)
  100. \*-------------------------------------------------------\*/
  101. /\* Boolean \*/
  102. #define TEST\_ASSERT(condition) UNITY\_TEST\_ASSERT( (condition), \_\_LINE\_\_, " Expression Evaluated To FALSE")
  103. #define TEST\_ASSERT\_TRUE(condition) UNITY\_TEST\_ASSERT( (condition), \_\_LINE\_\_, " Expected TRUE Was FALSE")
  104. #define TEST\_ASSERT\_UNLESS(condition) UNITY\_TEST\_ASSERT( !(condition), \_\_LINE\_\_, " Expression Evaluated To TRUE")
  105. #define TEST\_ASSERT\_FALSE(condition) UNITY\_TEST\_ASSERT( !(condition), \_\_LINE\_\_, " Expected FALSE Was TRUE")
  106. #define TEST\_ASSERT\_NULL(pointer) UNITY\_TEST\_ASSERT\_NULL( (pointer), \_\_LINE\_\_, " Expected NULL")
  107. #define TEST\_ASSERT\_NOT\_NULL(pointer) UNITY\_TEST\_ASSERT\_NOT\_NULL((pointer), \_\_LINE\_\_, " Expected Non-NULL")
  108. #define TEST\_ASSERT\_EMPTY(pointer) UNITY\_TEST\_ASSERT\_EMPTY( (pointer), \_\_LINE\_\_, " Expected Empty")
  109. #define TEST\_ASSERT\_NOT\_EMPTY(pointer) UNITY\_TEST\_ASSERT\_NOT\_EMPTY((pointer), \_\_LINE\_\_, " Expected Non-Empty")
  110. /\* Integers (of all sizes) \*/
  111. #define TEST\_ASSERT\_EQUAL\_INT(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT((expected), (actual), \_\_LINE\_\_, NULL)
  112. #define TEST\_ASSERT\_EQUAL\_INT8(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT8((expected), (actual), \_\_LINE\_\_, NULL)
  113. #define TEST\_ASSERT\_EQUAL\_INT16(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT16((expected), (actual), \_\_LINE\_\_, NULL)
  114. #define TEST\_ASSERT\_EQUAL\_INT32(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT32((expected), (actual), \_\_LINE\_\_, NULL)
  115. #define TEST\_ASSERT\_EQUAL\_INT64(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT64((expected), (actual), \_\_LINE\_\_, NULL)
  116. #define TEST\_ASSERT\_EQUAL\_UINT(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_UINT( (expected), (actual), \_\_LINE\_\_, NULL)
  117. #define TEST\_ASSERT\_EQUAL\_UINT8(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_UINT8( (expected), (actual), \_\_LINE\_\_, NULL)
  118. #define TEST\_ASSERT\_EQUAL\_UINT16(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_UINT16( (expected), (actual), \_\_LINE\_\_, NULL)
  119. #define TEST\_ASSERT\_EQUAL\_UINT32(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_UINT32( (expected), (actual), \_\_LINE\_\_, NULL)
  120. #define TEST\_ASSERT\_EQUAL\_UINT64(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_UINT64( (expected), (actual), \_\_LINE\_\_, NULL)
  121. #define TEST\_ASSERT\_EQUAL\_size\_t(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_UINT((expected), (actual), \_\_LINE\_\_, NULL)
  122. #define TEST\_ASSERT\_EQUAL\_HEX(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_HEX32((expected), (actual), \_\_LINE\_\_, NULL)
  123. #define TEST\_ASSERT\_EQUAL\_HEX8(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_HEX8( (expected), (actual), \_\_LINE\_\_, NULL)
  124. #define TEST\_ASSERT\_EQUAL\_HEX16(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_HEX16((expected), (actual), \_\_LINE\_\_, NULL)
  125. #define TEST\_ASSERT\_EQUAL\_HEX32(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_HEX32((expected), (actual), \_\_LINE\_\_, NULL)
  126. #define TEST\_ASSERT\_EQUAL\_HEX64(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_HEX64((expected), (actual), \_\_LINE\_\_, NULL)
  127. #define TEST\_ASSERT\_EQUAL\_CHAR(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_CHAR((expected), (actual), \_\_LINE\_\_, NULL)
  128. #define TEST\_ASSERT\_BITS(mask, expected, actual) UNITY\_TEST\_ASSERT\_BITS((mask), (expected), (actual), \_\_LINE\_\_, NULL)
  129. #define TEST\_ASSERT\_BITS\_HIGH(mask, actual) UNITY\_TEST\_ASSERT\_BITS((mask), (UNITY\_UINT)(-1), (actual), \_\_LINE\_\_, NULL)
  130. #define TEST\_ASSERT\_BITS\_LOW(mask, actual) UNITY\_TEST\_ASSERT\_BITS((mask), (UNITY\_UINT)(0), (actual), \_\_LINE\_\_, NULL)
  131. #define TEST\_ASSERT\_BIT\_HIGH(bit, actual) UNITY\_TEST\_ASSERT\_BITS(((UNITY\_UINT)1 << (bit)), (UNITY\_UINT)(-1), (actual), \_\_LINE\_\_, NULL)
  132. #define TEST\_ASSERT\_BIT\_LOW(bit, actual) UNITY\_TEST\_ASSERT\_BITS(((UNITY\_UINT)1 << (bit)), (UNITY\_UINT)(0), (actual), \_\_LINE\_\_, NULL)
  133. /\* Integer Not Equal To (of all sizes) \*/
  134. #define TEST\_ASSERT\_NOT\_EQUAL\_INT(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  135. #define TEST\_ASSERT\_NOT\_EQUAL\_INT8(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT8((threshold), (actual), \_\_LINE\_\_, NULL)
  136. #define TEST\_ASSERT\_NOT\_EQUAL\_INT16(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT16((threshold), (actual), \_\_LINE\_\_, NULL)
  137. #define TEST\_ASSERT\_NOT\_EQUAL\_INT32(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT32((threshold), (actual), \_\_LINE\_\_, NULL)
  138. #define TEST\_ASSERT\_NOT\_EQUAL\_INT64(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT64((threshold), (actual), \_\_LINE\_\_, NULL)
  139. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  140. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT8(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT8((threshold), (actual), \_\_LINE\_\_, NULL)
  141. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT16(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT16((threshold), (actual), \_\_LINE\_\_, NULL)
  142. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT32(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT32((threshold), (actual), \_\_LINE\_\_, NULL)
  143. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT64(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT64((threshold), (actual), \_\_LINE\_\_, NULL)
  144. #define TEST\_ASSERT\_NOT\_EQUAL\_size\_t(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  145. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX8(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX8((threshold), (actual), \_\_LINE\_\_, NULL)
  146. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX16(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX16((threshold), (actual), \_\_LINE\_\_, NULL)
  147. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX32(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX32((threshold), (actual), \_\_LINE\_\_, NULL)
  148. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX64(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX64((threshold), (actual), \_\_LINE\_\_, NULL)
  149. #define TEST\_ASSERT\_NOT\_EQUAL\_CHAR(threshold, actual) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_CHAR((threshold), (actual), \_\_LINE\_\_, NULL)
  150. /\* Integer Greater Than/ Less Than (of all sizes) \*/
  151. #define TEST\_ASSERT\_GREATER\_THAN(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  152. #define TEST\_ASSERT\_GREATER\_THAN\_INT(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  153. #define TEST\_ASSERT\_GREATER\_THAN\_INT8(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT8((threshold), (actual), \_\_LINE\_\_, NULL)
  154. #define TEST\_ASSERT\_GREATER\_THAN\_INT16(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT16((threshold), (actual), \_\_LINE\_\_, NULL)
  155. #define TEST\_ASSERT\_GREATER\_THAN\_INT32(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT32((threshold), (actual), \_\_LINE\_\_, NULL)
  156. #define TEST\_ASSERT\_GREATER\_THAN\_INT64(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT64((threshold), (actual), \_\_LINE\_\_, NULL)
  157. #define TEST\_ASSERT\_GREATER\_THAN\_UINT(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  158. #define TEST\_ASSERT\_GREATER\_THAN\_UINT8(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT8((threshold), (actual), \_\_LINE\_\_, NULL)
  159. #define TEST\_ASSERT\_GREATER\_THAN\_UINT16(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT16((threshold), (actual), \_\_LINE\_\_, NULL)
  160. #define TEST\_ASSERT\_GREATER\_THAN\_UINT32(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT32((threshold), (actual), \_\_LINE\_\_, NULL)
  161. #define TEST\_ASSERT\_GREATER\_THAN\_UINT64(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT64((threshold), (actual), \_\_LINE\_\_, NULL)
  162. #define TEST\_ASSERT\_GREATER\_THAN\_size\_t(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  163. #define TEST\_ASSERT\_GREATER\_THAN\_HEX8(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX8((threshold), (actual), \_\_LINE\_\_, NULL)
  164. #define TEST\_ASSERT\_GREATER\_THAN\_HEX16(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX16((threshold), (actual), \_\_LINE\_\_, NULL)
  165. #define TEST\_ASSERT\_GREATER\_THAN\_HEX32(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX32((threshold), (actual), \_\_LINE\_\_, NULL)
  166. #define TEST\_ASSERT\_GREATER\_THAN\_HEX64(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX64((threshold), (actual), \_\_LINE\_\_, NULL)
  167. #define TEST\_ASSERT\_GREATER\_THAN\_CHAR(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_CHAR((threshold), (actual), \_\_LINE\_\_, NULL)
  168. #define TEST\_ASSERT\_LESS\_THAN(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  169. #define TEST\_ASSERT\_LESS\_THAN\_INT(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  170. #define TEST\_ASSERT\_LESS\_THAN\_INT8(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT8((threshold), (actual), \_\_LINE\_\_, NULL)
  171. #define TEST\_ASSERT\_LESS\_THAN\_INT16(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT16((threshold), (actual), \_\_LINE\_\_, NULL)
  172. #define TEST\_ASSERT\_LESS\_THAN\_INT32(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT32((threshold), (actual), \_\_LINE\_\_, NULL)
  173. #define TEST\_ASSERT\_LESS\_THAN\_INT64(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT64((threshold), (actual), \_\_LINE\_\_, NULL)
  174. #define TEST\_ASSERT\_LESS\_THAN\_UINT(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  175. #define TEST\_ASSERT\_LESS\_THAN\_UINT8(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT8((threshold), (actual), \_\_LINE\_\_, NULL)
  176. #define TEST\_ASSERT\_LESS\_THAN\_UINT16(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT16((threshold), (actual), \_\_LINE\_\_, NULL)
  177. #define TEST\_ASSERT\_LESS\_THAN\_UINT32(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT32((threshold), (actual), \_\_LINE\_\_, NULL)
  178. #define TEST\_ASSERT\_LESS\_THAN\_UINT64(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT64((threshold), (actual), \_\_LINE\_\_, NULL)
  179. #define TEST\_ASSERT\_LESS\_THAN\_size\_t(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  180. #define TEST\_ASSERT\_LESS\_THAN\_HEX8(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX8((threshold), (actual), \_\_LINE\_\_, NULL)
  181. #define TEST\_ASSERT\_LESS\_THAN\_HEX16(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX16((threshold), (actual), \_\_LINE\_\_, NULL)
  182. #define TEST\_ASSERT\_LESS\_THAN\_HEX32(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX32((threshold), (actual), \_\_LINE\_\_, NULL)
  183. #define TEST\_ASSERT\_LESS\_THAN\_HEX64(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX64((threshold), (actual), \_\_LINE\_\_, NULL)
  184. #define TEST\_ASSERT\_LESS\_THAN\_CHAR(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_CHAR((threshold), (actual), \_\_LINE\_\_, NULL)
  185. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  186. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  187. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT8(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT8((threshold), (actual), \_\_LINE\_\_, NULL)
  188. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT16(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT16((threshold), (actual), \_\_LINE\_\_, NULL)
  189. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT32(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT32((threshold), (actual), \_\_LINE\_\_, NULL)
  190. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT64(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT64((threshold), (actual), \_\_LINE\_\_, NULL)
  191. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  192. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT8(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT8((threshold), (actual), \_\_LINE\_\_, NULL)
  193. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT16(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT16((threshold), (actual), \_\_LINE\_\_, NULL)
  194. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT32(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT32((threshold), (actual), \_\_LINE\_\_, NULL)
  195. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT64(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT64((threshold), (actual), \_\_LINE\_\_, NULL)
  196. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_size\_t(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  197. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX8(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX8((threshold), (actual), \_\_LINE\_\_, NULL)
  198. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX16(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX16((threshold), (actual), \_\_LINE\_\_, NULL)
  199. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX32(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX32((threshold), (actual), \_\_LINE\_\_, NULL)
  200. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX64(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_HEX64((threshold), (actual), \_\_LINE\_\_, NULL)
  201. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_CHAR(threshold, actual) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_CHAR((threshold), (actual), \_\_LINE\_\_, NULL)
  202. #define TEST\_ASSERT\_LESS\_OR\_EQUAL(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  203. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_INT(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, NULL)
  204. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_INT8(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_INT8((threshold), (actual), \_\_LINE\_\_, NULL)
  205. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_INT16(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_INT16((threshold), (actual), \_\_LINE\_\_, NULL)
  206. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_INT32(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_INT32((threshold), (actual), \_\_LINE\_\_, NULL)
  207. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_INT64(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_INT64((threshold), (actual), \_\_LINE\_\_, NULL)
  208. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_UINT(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  209. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_UINT8(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_UINT8((threshold), (actual), \_\_LINE\_\_, NULL)
  210. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_UINT16(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_UINT16((threshold), (actual), \_\_LINE\_\_, NULL)
  211. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_UINT32(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_UINT32((threshold), (actual), \_\_LINE\_\_, NULL)
  212. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_UINT64(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_UINT64((threshold), (actual), \_\_LINE\_\_, NULL)
  213. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_size\_t(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, NULL)
  214. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_HEX8(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_HEX8((threshold), (actual), \_\_LINE\_\_, NULL)
  215. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_HEX16(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_HEX16((threshold), (actual), \_\_LINE\_\_, NULL)
  216. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_HEX32(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_HEX32((threshold), (actual), \_\_LINE\_\_, NULL)
  217. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_HEX64(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_HEX64((threshold), (actual), \_\_LINE\_\_, NULL)
  218. #define TEST\_ASSERT\_LESS\_OR\_EQUAL\_CHAR(threshold, actual) UNITY\_TEST\_ASSERT\_SMALLER\_OR\_EQUAL\_CHAR((threshold), (actual), \_\_LINE\_\_, NULL)
  219. /\* Integer Ranges (of all sizes) \*/
  220. #define TEST\_ASSERT\_INT\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_INT\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  221. #define TEST\_ASSERT\_INT8\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_INT8\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  222. #define TEST\_ASSERT\_INT16\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_INT16\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  223. #define TEST\_ASSERT\_INT32\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_INT32\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  224. #define TEST\_ASSERT\_INT64\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_INT64\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  225. #define TEST\_ASSERT\_UINT\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_UINT\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  226. #define TEST\_ASSERT\_UINT8\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_UINT8\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  227. #define TEST\_ASSERT\_UINT16\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_UINT16\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  228. #define TEST\_ASSERT\_UINT32\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_UINT32\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  229. #define TEST\_ASSERT\_UINT64\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_UINT64\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  230. #define TEST\_ASSERT\_size\_t\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_UINT\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  231. #define TEST\_ASSERT\_HEX\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_HEX32\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  232. #define TEST\_ASSERT\_HEX8\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_HEX8\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  233. #define TEST\_ASSERT\_HEX16\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_HEX16\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  234. #define TEST\_ASSERT\_HEX32\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_HEX32\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  235. #define TEST\_ASSERT\_HEX64\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_HEX64\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  236. #define TEST\_ASSERT\_CHAR\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_CHAR\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  237. /\* Integer Array Ranges (of all sizes) \*/
  238. #define TEST\_ASSERT\_INT\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_INT\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  239. #define TEST\_ASSERT\_INT8\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_INT8\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  240. #define TEST\_ASSERT\_INT16\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_INT16\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  241. #define TEST\_ASSERT\_INT32\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_INT32\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  242. #define TEST\_ASSERT\_INT64\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_INT64\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  243. #define TEST\_ASSERT\_UINT\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_UINT\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  244. #define TEST\_ASSERT\_UINT8\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_UINT8\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  245. #define TEST\_ASSERT\_UINT16\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_UINT16\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  246. #define TEST\_ASSERT\_UINT32\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_UINT32\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  247. #define TEST\_ASSERT\_UINT64\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_UINT64\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  248. #define TEST\_ASSERT\_size\_t\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_UINT\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  249. #define TEST\_ASSERT\_HEX\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_HEX32\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  250. #define TEST\_ASSERT\_HEX8\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_HEX8\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  251. #define TEST\_ASSERT\_HEX16\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_HEX16\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  252. #define TEST\_ASSERT\_HEX32\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_HEX32\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  253. #define TEST\_ASSERT\_HEX64\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_HEX64\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  254. #define TEST\_ASSERT\_CHAR\_ARRAY\_WITHIN(delta, expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_CHAR\_ARRAY\_WITHIN((delta), (expected), (actual), num\_elements, \_\_LINE\_\_, NULL)
  255. /\* Structs and Strings \*/
  256. #define TEST\_ASSERT\_EQUAL\_PTR(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_PTR((expected), (actual), \_\_LINE\_\_, NULL)
  257. #define TEST\_ASSERT\_EQUAL\_STRING(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_STRING((expected), (actual), \_\_LINE\_\_, NULL)
  258. #define TEST\_ASSERT\_EQUAL\_STRING\_LEN(expected, actual, len) UNITY\_TEST\_ASSERT\_EQUAL\_STRING\_LEN((expected), (actual), (len), \_\_LINE\_\_, NULL)
  259. #define TEST\_ASSERT\_EQUAL\_MEMORY(expected, actual, len) UNITY\_TEST\_ASSERT\_EQUAL\_MEMORY((expected), (actual), (len), \_\_LINE\_\_, NULL)
  260. /\* Arrays \*/
  261. #define TEST\_ASSERT\_EQUAL\_INT\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_INT\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  262. #define TEST\_ASSERT\_EQUAL\_INT8\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_INT8\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  263. #define TEST\_ASSERT\_EQUAL\_INT16\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_INT16\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  264. #define TEST\_ASSERT\_EQUAL\_INT32\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_INT32\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  265. #define TEST\_ASSERT\_EQUAL\_INT64\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_INT64\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  266. #define TEST\_ASSERT\_EQUAL\_UINT\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_UINT\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  267. #define TEST\_ASSERT\_EQUAL\_UINT8\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_UINT8\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  268. #define TEST\_ASSERT\_EQUAL\_UINT16\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_UINT16\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  269. #define TEST\_ASSERT\_EQUAL\_UINT32\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_UINT32\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  270. #define TEST\_ASSERT\_EQUAL\_UINT64\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_UINT64\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  271. #define TEST\_ASSERT\_EQUAL\_size\_t\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_UINT\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  272. #define TEST\_ASSERT\_EQUAL\_HEX\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_HEX32\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  273. #define TEST\_ASSERT\_EQUAL\_HEX8\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_HEX8\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  274. #define TEST\_ASSERT\_EQUAL\_HEX16\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_HEX16\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  275. #define TEST\_ASSERT\_EQUAL\_HEX32\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_HEX32\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  276. #define TEST\_ASSERT\_EQUAL\_HEX64\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_HEX64\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  277. #define TEST\_ASSERT\_EQUAL\_PTR\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_PTR\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  278. #define TEST\_ASSERT\_EQUAL\_STRING\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_STRING\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  279. #define TEST\_ASSERT\_EQUAL\_MEMORY\_ARRAY(expected, actual, len, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_MEMORY\_ARRAY((expected), (actual), (len), (num\_elements), \_\_LINE\_\_, NULL)
  280. #define TEST\_ASSERT\_EQUAL\_CHAR\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_CHAR\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  281. /\* Arrays Compared To Single Value \*/
  282. #define TEST\_ASSERT\_EACH\_EQUAL\_INT(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_INT((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  283. #define TEST\_ASSERT\_EACH\_EQUAL\_INT8(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_INT8((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  284. #define TEST\_ASSERT\_EACH\_EQUAL\_INT16(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_INT16((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  285. #define TEST\_ASSERT\_EACH\_EQUAL\_INT32(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_INT32((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  286. #define TEST\_ASSERT\_EACH\_EQUAL\_INT64(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_INT64((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  287. #define TEST\_ASSERT\_EACH\_EQUAL\_UINT(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_UINT((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  288. #define TEST\_ASSERT\_EACH\_EQUAL\_UINT8(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_UINT8((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  289. #define TEST\_ASSERT\_EACH\_EQUAL\_UINT16(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_UINT16((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  290. #define TEST\_ASSERT\_EACH\_EQUAL\_UINT32(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_UINT32((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  291. #define TEST\_ASSERT\_EACH\_EQUAL\_UINT64(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_UINT64((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  292. #define TEST\_ASSERT\_EACH\_EQUAL\_size\_t(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_UINT((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  293. #define TEST\_ASSERT\_EACH\_EQUAL\_HEX(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_HEX32((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  294. #define TEST\_ASSERT\_EACH\_EQUAL\_HEX8(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_HEX8((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  295. #define TEST\_ASSERT\_EACH\_EQUAL\_HEX16(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_HEX16((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  296. #define TEST\_ASSERT\_EACH\_EQUAL\_HEX32(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_HEX32((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  297. #define TEST\_ASSERT\_EACH\_EQUAL\_HEX64(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_HEX64((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  298. #define TEST\_ASSERT\_EACH\_EQUAL\_PTR(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_PTR((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  299. #define TEST\_ASSERT\_EACH\_EQUAL\_STRING(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_STRING((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  300. #define TEST\_ASSERT\_EACH\_EQUAL\_MEMORY(expected, actual, len, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_MEMORY((expected), (actual), (len), (num\_elements), \_\_LINE\_\_, NULL)
  301. #define TEST\_ASSERT\_EACH\_EQUAL\_CHAR(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_CHAR((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  302. /\* Floating Point (If Enabled) \*/
  303. #define TEST\_ASSERT\_FLOAT\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_FLOAT\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  304. #define TEST\_ASSERT\_EQUAL\_FLOAT(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_FLOAT((expected), (actual), \_\_LINE\_\_, NULL)
  305. #define TEST\_ASSERT\_EQUAL\_FLOAT\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_FLOAT\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  306. #define TEST\_ASSERT\_EACH\_EQUAL\_FLOAT(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_FLOAT((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  307. #define TEST\_ASSERT\_FLOAT\_IS\_INF(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_INF((actual), \_\_LINE\_\_, NULL)
  308. #define TEST\_ASSERT\_FLOAT\_IS\_NEG\_INF(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_NEG\_INF((actual), \_\_LINE\_\_, NULL)
  309. #define TEST\_ASSERT\_FLOAT\_IS\_NAN(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_NAN((actual), \_\_LINE\_\_, NULL)
  310. #define TEST\_ASSERT\_FLOAT\_IS\_DETERMINATE(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_DETERMINATE((actual), \_\_LINE\_\_, NULL)
  311. #define TEST\_ASSERT\_FLOAT\_IS\_NOT\_INF(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_NOT\_INF((actual), \_\_LINE\_\_, NULL)
  312. #define TEST\_ASSERT\_FLOAT\_IS\_NOT\_NEG\_INF(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_NOT\_NEG\_INF((actual), \_\_LINE\_\_, NULL)
  313. #define TEST\_ASSERT\_FLOAT\_IS\_NOT\_NAN(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_NOT\_NAN((actual), \_\_LINE\_\_, NULL)
  314. #define TEST\_ASSERT\_FLOAT\_IS\_NOT\_DETERMINATE(actual) UNITY\_TEST\_ASSERT\_FLOAT\_IS\_NOT\_DETERMINATE((actual), \_\_LINE\_\_, NULL)
  315. /\* Double (If Enabled) \*/
  316. #define TEST\_ASSERT\_DOUBLE\_WITHIN(delta, expected, actual) UNITY\_TEST\_ASSERT\_DOUBLE\_WITHIN((delta), (expected), (actual), \_\_LINE\_\_, NULL)
  317. #define TEST\_ASSERT\_EQUAL\_DOUBLE(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_DOUBLE((expected), (actual), \_\_LINE\_\_, NULL)
  318. #define TEST\_ASSERT\_EQUAL\_DOUBLE\_ARRAY(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EQUAL\_DOUBLE\_ARRAY((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  319. #define TEST\_ASSERT\_EACH\_EQUAL\_DOUBLE(expected, actual, num\_elements) UNITY\_TEST\_ASSERT\_EACH\_EQUAL\_DOUBLE((expected), (actual), (num\_elements), \_\_LINE\_\_, NULL)
  320. #define TEST\_ASSERT\_DOUBLE\_IS\_INF(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_INF((actual), \_\_LINE\_\_, NULL)
  321. #define TEST\_ASSERT\_DOUBLE\_IS\_NEG\_INF(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_NEG\_INF((actual), \_\_LINE\_\_, NULL)
  322. #define TEST\_ASSERT\_DOUBLE\_IS\_NAN(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_NAN((actual), \_\_LINE\_\_, NULL)
  323. #define TEST\_ASSERT\_DOUBLE\_IS\_DETERMINATE(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_DETERMINATE((actual), \_\_LINE\_\_, NULL)
  324. #define TEST\_ASSERT\_DOUBLE\_IS\_NOT\_INF(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_NOT\_INF((actual), \_\_LINE\_\_, NULL)
  325. #define TEST\_ASSERT\_DOUBLE\_IS\_NOT\_NEG\_INF(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_NOT\_NEG\_INF((actual), \_\_LINE\_\_, NULL)
  326. #define TEST\_ASSERT\_DOUBLE\_IS\_NOT\_NAN(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_NOT\_NAN((actual), \_\_LINE\_\_, NULL)
  327. #define TEST\_ASSERT\_DOUBLE\_IS\_NOT\_DETERMINATE(actual) UNITY\_TEST\_ASSERT\_DOUBLE\_IS\_NOT\_DETERMINATE((actual), \_\_LINE\_\_, NULL)
  328. /\* Shorthand \*/
  329. #ifdef UNITY\_SHORTHAND\_AS\_OLD
  330. #define TEST\_ASSERT\_EQUAL(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT((expected), (actual), \_\_LINE\_\_, NULL)
  331. #define TEST\_ASSERT\_NOT\_EQUAL(expected, actual) UNITY\_TEST\_ASSERT(((expected) != (actual)), \_\_LINE\_\_, " Expected Not-Equal")
  332. #endif
  333. #ifdef UNITY\_SHORTHAND\_AS\_INT
  334. #define TEST\_ASSERT\_EQUAL(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_INT((expected), (actual), \_\_LINE\_\_, NULL)
  335. #define TEST\_ASSERT\_NOT\_EQUAL(expected, actual) UNITY\_TEST\_FAIL(\_\_LINE\_\_, UnityStrErrShorthand)
  336. #endif
  337. #ifdef UNITY\_SHORTHAND\_AS\_MEM
  338. #define TEST\_ASSERT\_EQUAL(expected, actual) UNITY\_TEST\_ASSERT\_EQUAL\_MEMORY((&expected), (&actual), sizeof(expected), \_\_LINE\_\_, NULL)
  339. #define TEST\_ASSERT\_NOT\_EQUAL(expected, actual) UNITY\_TEST\_FAIL(\_\_LINE\_\_, UnityStrErrShorthand)
  340. #endif
  341. #ifdef UNITY\_SHORTHAND\_AS\_RAW
  342. #define TEST\_ASSERT\_EQUAL(expected, actual) UNITY\_TEST\_ASSERT(((expected) == (actual)), \_\_LINE\_\_, " Expected Equal")
  343. #define TEST\_ASSERT\_NOT\_EQUAL(expected, actual) UNITY\_TEST\_ASSERT(((expected) != (actual)), \_\_LINE\_\_, " Expected Not-Equal")
  344. #endif
  345. #ifdef UNITY\_SHORTHAND\_AS\_NONE
  346. #define TEST\_ASSERT\_EQUAL(expected, actual) UNITY\_TEST\_FAIL(\_\_LINE\_\_, UnityStrErrShorthand)
  347. #define TEST\_ASSERT\_NOT\_EQUAL(expected, actual) UNITY\_TEST\_FAIL(\_\_LINE\_\_, UnityStrErrShorthand)
  348. #endif
  349. /\*-------------------------------------------------------
  350. \* Test Asserts (with additional messages)
  351. \*-------------------------------------------------------\*/
  352. /\* Boolean \*/
  353. #define TEST\_ASSERT\_MESSAGE(condition, message) UNITY\_TEST\_ASSERT( (condition), \_\_LINE\_\_, (message))
  354. #define TEST\_ASSERT\_TRUE\_MESSAGE(condition, message) UNITY\_TEST\_ASSERT( (condition), \_\_LINE\_\_, (message))
  355. #define TEST\_ASSERT\_UNLESS\_MESSAGE(condition, message) UNITY\_TEST\_ASSERT( !(condition), \_\_LINE\_\_, (message))
  356. #define TEST\_ASSERT\_FALSE\_MESSAGE(condition, message) UNITY\_TEST\_ASSERT( !(condition), \_\_LINE\_\_, (message))
  357. #define TEST\_ASSERT\_NULL\_MESSAGE(pointer, message) UNITY\_TEST\_ASSERT\_NULL( (pointer), \_\_LINE\_\_, (message))
  358. #define TEST\_ASSERT\_NOT\_NULL\_MESSAGE(pointer, message) UNITY\_TEST\_ASSERT\_NOT\_NULL((pointer), \_\_LINE\_\_, (message))
  359. #define TEST\_ASSERT\_EMPTY\_MESSAGE(pointer, message) UNITY\_TEST\_ASSERT\_EMPTY( (pointer), \_\_LINE\_\_, (message))
  360. #define TEST\_ASSERT\_NOT\_EMPTY\_MESSAGE(pointer, message) UNITY\_TEST\_ASSERT\_NOT\_EMPTY((pointer), \_\_LINE\_\_, (message))
  361. /\* Integers (of all sizes) \*/
  362. #define TEST\_ASSERT\_EQUAL\_INT\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_INT((expected), (actual), \_\_LINE\_\_, (message))
  363. #define TEST\_ASSERT\_EQUAL\_INT8\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_INT8((expected), (actual), \_\_LINE\_\_, (message))
  364. #define TEST\_ASSERT\_EQUAL\_INT16\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_INT16((expected), (actual), \_\_LINE\_\_, (message))
  365. #define TEST\_ASSERT\_EQUAL\_INT32\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_INT32((expected), (actual), \_\_LINE\_\_, (message))
  366. #define TEST\_ASSERT\_EQUAL\_INT64\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_INT64((expected), (actual), \_\_LINE\_\_, (message))
  367. #define TEST\_ASSERT\_EQUAL\_UINT\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_UINT( (expected), (actual), \_\_LINE\_\_, (message))
  368. #define TEST\_ASSERT\_EQUAL\_UINT8\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_UINT8( (expected), (actual), \_\_LINE\_\_, (message))
  369. #define TEST\_ASSERT\_EQUAL\_UINT16\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_UINT16( (expected), (actual), \_\_LINE\_\_, (message))
  370. #define TEST\_ASSERT\_EQUAL\_UINT32\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_UINT32( (expected), (actual), \_\_LINE\_\_, (message))
  371. #define TEST\_ASSERT\_EQUAL\_UINT64\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_UINT64( (expected), (actual), \_\_LINE\_\_, (message))
  372. #define TEST\_ASSERT\_EQUAL\_size\_t\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_UINT( (expected), (actual), \_\_LINE\_\_, (message))
  373. #define TEST\_ASSERT\_EQUAL\_HEX\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_HEX32((expected), (actual), \_\_LINE\_\_, (message))
  374. #define TEST\_ASSERT\_EQUAL\_HEX8\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_HEX8( (expected), (actual), \_\_LINE\_\_, (message))
  375. #define TEST\_ASSERT\_EQUAL\_HEX16\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_HEX16((expected), (actual), \_\_LINE\_\_, (message))
  376. #define TEST\_ASSERT\_EQUAL\_HEX32\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_HEX32((expected), (actual), \_\_LINE\_\_, (message))
  377. #define TEST\_ASSERT\_EQUAL\_HEX64\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_HEX64((expected), (actual), \_\_LINE\_\_, (message))
  378. #define TEST\_ASSERT\_BITS\_MESSAGE(mask, expected, actual, message) UNITY\_TEST\_ASSERT\_BITS((mask), (expected), (actual), \_\_LINE\_\_, (message))
  379. #define TEST\_ASSERT\_BITS\_HIGH\_MESSAGE(mask, actual, message) UNITY\_TEST\_ASSERT\_BITS((mask), (UNITY\_UINT32)(-1), (actual), \_\_LINE\_\_, (message))
  380. #define TEST\_ASSERT\_BITS\_LOW\_MESSAGE(mask, actual, message) UNITY\_TEST\_ASSERT\_BITS((mask), (UNITY\_UINT32)(0), (actual), \_\_LINE\_\_, (message))
  381. #define TEST\_ASSERT\_BIT\_HIGH\_MESSAGE(bit, actual, message) UNITY\_TEST\_ASSERT\_BITS(((UNITY\_UINT32)1 << (bit)), (UNITY\_UINT32)(-1), (actual), \_\_LINE\_\_, (message))
  382. #define TEST\_ASSERT\_BIT\_LOW\_MESSAGE(bit, actual, message) UNITY\_TEST\_ASSERT\_BITS(((UNITY\_UINT32)1 << (bit)), (UNITY\_UINT32)(0), (actual), \_\_LINE\_\_, (message))
  383. #define TEST\_ASSERT\_EQUAL\_CHAR\_MESSAGE(expected, actual, message) UNITY\_TEST\_ASSERT\_EQUAL\_CHAR((expected), (actual), \_\_LINE\_\_, (message))
  384. /\* Integer Not Equal To (of all sizes) \*/
  385. #define TEST\_ASSERT\_NOT\_EQUAL\_INT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  386. #define TEST\_ASSERT\_NOT\_EQUAL\_INT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT8((threshold), (actual), \_\_LINE\_\_, (message))
  387. #define TEST\_ASSERT\_NOT\_EQUAL\_INT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT16((threshold), (actual), \_\_LINE\_\_, (message))
  388. #define TEST\_ASSERT\_NOT\_EQUAL\_INT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT32((threshold), (actual), \_\_LINE\_\_, (message))
  389. #define TEST\_ASSERT\_NOT\_EQUAL\_INT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_INT64((threshold), (actual), \_\_LINE\_\_, (message))
  390. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  391. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT8((threshold), (actual), \_\_LINE\_\_, (message))
  392. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT16((threshold), (actual), \_\_LINE\_\_, (message))
  393. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT32((threshold), (actual), \_\_LINE\_\_, (message))
  394. #define TEST\_ASSERT\_NOT\_EQUAL\_UINT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT64((threshold), (actual), \_\_LINE\_\_, (message))
  395. #define TEST\_ASSERT\_NOT\_EQUAL\_size\_t\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  396. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX8((threshold), (actual), \_\_LINE\_\_, (message))
  397. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX16((threshold), (actual), \_\_LINE\_\_, (message))
  398. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX32((threshold), (actual), \_\_LINE\_\_, (message))
  399. #define TEST\_ASSERT\_NOT\_EQUAL\_HEX64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_HEX64((threshold), (actual), \_\_LINE\_\_, (message))
  400. #define TEST\_ASSERT\_NOT\_EQUAL\_CHAR\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_NOT\_EQUAL\_CHAR((threshold), (actual), \_\_LINE\_\_, (message))
  401. /\* Integer Greater Than/ Less Than (of all sizes) \*/
  402. #define TEST\_ASSERT\_GREATER\_THAN\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  403. #define TEST\_ASSERT\_GREATER\_THAN\_INT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  404. #define TEST\_ASSERT\_GREATER\_THAN\_INT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT8((threshold), (actual), \_\_LINE\_\_, (message))
  405. #define TEST\_ASSERT\_GREATER\_THAN\_INT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT16((threshold), (actual), \_\_LINE\_\_, (message))
  406. #define TEST\_ASSERT\_GREATER\_THAN\_INT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT32((threshold), (actual), \_\_LINE\_\_, (message))
  407. #define TEST\_ASSERT\_GREATER\_THAN\_INT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_INT64((threshold), (actual), \_\_LINE\_\_, (message))
  408. #define TEST\_ASSERT\_GREATER\_THAN\_UINT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  409. #define TEST\_ASSERT\_GREATER\_THAN\_UINT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT8((threshold), (actual), \_\_LINE\_\_, (message))
  410. #define TEST\_ASSERT\_GREATER\_THAN\_UINT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT16((threshold), (actual), \_\_LINE\_\_, (message))
  411. #define TEST\_ASSERT\_GREATER\_THAN\_UINT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT32((threshold), (actual), \_\_LINE\_\_, (message))
  412. #define TEST\_ASSERT\_GREATER\_THAN\_UINT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT64((threshold), (actual), \_\_LINE\_\_, (message))
  413. #define TEST\_ASSERT\_GREATER\_THAN\_size\_t\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  414. #define TEST\_ASSERT\_GREATER\_THAN\_HEX8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX8((threshold), (actual), \_\_LINE\_\_, (message))
  415. #define TEST\_ASSERT\_GREATER\_THAN\_HEX16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX16((threshold), (actual), \_\_LINE\_\_, (message))
  416. #define TEST\_ASSERT\_GREATER\_THAN\_HEX32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX32((threshold), (actual), \_\_LINE\_\_, (message))
  417. #define TEST\_ASSERT\_GREATER\_THAN\_HEX64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_HEX64((threshold), (actual), \_\_LINE\_\_, (message))
  418. #define TEST\_ASSERT\_GREATER\_THAN\_CHAR\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_THAN\_CHAR((threshold), (actual), \_\_LINE\_\_, (message))
  419. #define TEST\_ASSERT\_LESS\_THAN\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  420. #define TEST\_ASSERT\_LESS\_THAN\_INT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  421. #define TEST\_ASSERT\_LESS\_THAN\_INT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT8((threshold), (actual), \_\_LINE\_\_, (message))
  422. #define TEST\_ASSERT\_LESS\_THAN\_INT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT16((threshold), (actual), \_\_LINE\_\_, (message))
  423. #define TEST\_ASSERT\_LESS\_THAN\_INT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT32((threshold), (actual), \_\_LINE\_\_, (message))
  424. #define TEST\_ASSERT\_LESS\_THAN\_INT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_INT64((threshold), (actual), \_\_LINE\_\_, (message))
  425. #define TEST\_ASSERT\_LESS\_THAN\_UINT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  426. #define TEST\_ASSERT\_LESS\_THAN\_UINT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT8((threshold), (actual), \_\_LINE\_\_, (message))
  427. #define TEST\_ASSERT\_LESS\_THAN\_UINT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT16((threshold), (actual), \_\_LINE\_\_, (message))
  428. #define TEST\_ASSERT\_LESS\_THAN\_UINT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT32((threshold), (actual), \_\_LINE\_\_, (message))
  429. #define TEST\_ASSERT\_LESS\_THAN\_UINT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT64((threshold), (actual), \_\_LINE\_\_, (message))
  430. #define TEST\_ASSERT\_LESS\_THAN\_size\_t\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  431. #define TEST\_ASSERT\_LESS\_THAN\_HEX8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX8((threshold), (actual), \_\_LINE\_\_, (message))
  432. #define TEST\_ASSERT\_LESS\_THAN\_HEX16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX16((threshold), (actual), \_\_LINE\_\_, (message))
  433. #define TEST\_ASSERT\_LESS\_THAN\_HEX32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX32((threshold), (actual), \_\_LINE\_\_, (message))
  434. #define TEST\_ASSERT\_LESS\_THAN\_HEX64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_HEX64((threshold), (actual), \_\_LINE\_\_, (message))
  435. #define TEST\_ASSERT\_LESS\_THAN\_CHAR\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_SMALLER\_THAN\_CHAR((threshold), (actual), \_\_LINE\_\_, (message))
  436. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  437. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT((threshold), (actual), \_\_LINE\_\_, (message))
  438. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT8((threshold), (actual), \_\_LINE\_\_, (message))
  439. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT16((threshold), (actual), \_\_LINE\_\_, (message))
  440. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT32((threshold), (actual), \_\_LINE\_\_, (message))
  441. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_INT64((threshold), (actual), \_\_LINE\_\_, (message))
  442. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, (message))
  443. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT8\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT8((threshold), (actual), \_\_LINE\_\_, (message))
  444. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT16\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT16((threshold), (actual), \_\_LINE\_\_, (message))
  445. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT32\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT32((threshold), (actual), \_\_LINE\_\_, (message))
  446. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT64\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT64((threshold), (actual), \_\_LINE\_\_, (message))
  447. #define TEST\_ASSERT\_GREATER\_OR\_EQUAL\_size\_t\_MESSAGE(threshold, actual, message) UNITY\_TEST\_ASSERT\_GREATER\_OR\_EQUAL\_UINT((threshold), (actual), \_\_LINE\_\_, (message))

本文转载自: https://blog.csdn.net/2401_86983969/article/details/142001774
版权归原作者 2401_86983969 所有, 如有侵权,请联系我们删除。

“C语言断言assert和单元测试的关系_单元测试assert和”的评论:

还没有评论