diff --git a/docs/UnityAssertionsReference.md b/docs/UnityAssertionsReference.md index 3dd787d17a6824828572fcce34cc19c13ca9043a..a395d6149273626230972747a6f1741c0323ebd6 100644 --- a/docs/UnityAssertionsReference.md +++ b/docs/UnityAssertionsReference.md @@ -284,6 +284,15 @@ in hexadecimal. Unity output is big endian. ##### `TEST_ASSERT_EQUAL_HEX64 (expected, actual)` +### Characters + +While you can use the 8-bit integer assertions to compare `char`, another option is +to use this specialized assertion which will show printable characters as printables, +otherwise showing the HEX escape code for the characters. + +##### `TEST_ASSERT_EQUAL_CHAR (expected, actual)` + + ### Masked and Bit-level Assertions Masked and bit-level assertions produce output formatted in hexadecimal. Unity @@ -344,6 +353,8 @@ greater than assertion will fail if it is 0 or less. ##### `TEST_ASSERT_GREATER_THAN_HEX32 (threshold, actual)` +##### `TEST_ASSERT_GREATER_THAN_CHAR (threshold, actual)` + ##### `TEST_ASSERT_LESS_THAN (threshold, actual)` ##### `TEST_ASSERT_LESS_THAN_INT (threshold, actual)` @@ -368,6 +379,8 @@ greater than assertion will fail if it is 0 or less. ##### `TEST_ASSERT_LESS_THAN_HEX32 (threshold, actual)` +##### `TEST_ASSERT_LESS_THAN_CHAR (threshold, actual)` + ### Integer Ranges (of all sizes) @@ -406,6 +419,8 @@ of 7 - 13. ##### `TEST_ASSERT_HEX64_WITHIN (delta, expected, actual)` +##### `TEST_ASSERT_CHAR_WITHIN (delta, expected, actual)` + ### Structs and Strings ##### `TEST_ASSERT_EQUAL_PTR (expected, actual)` @@ -472,6 +487,8 @@ match. Failure messages specify the array index of the failed comparison. ##### `TEST_ASSERT_EQUAL_HEX64_ARRAY (expected, actual, num_elements)` +##### `TEST_ASSERT_EQUAL_CHAR_ARRAY (expected, actual, num_elements)` + ##### `TEST_ASSERT_EQUAL_PTR_ARRAY (expected, actual, num_elements)` ##### `TEST_ASSERT_EQUAL_STRING_ARRAY (expected, actual, num_elements)` @@ -517,6 +534,8 @@ outside the range of \[7 - 13, 9 - 15\]. ##### `TEST_ASSERT_HEX64_ARRAY_WITHIN (delta, expected, actual, num_elements)` +##### `TEST_ASSERT_CHAR_ARRAY_WITHIN (delta, expected, actual, num_elements)` + ### Each Equal (Arrays to Single Value) `expected` are single values and `actual` are arrays. `num_elements` specifies @@ -558,6 +577,8 @@ match. Failure messages specify the array index of the failed comparison. #### `TEST_ASSERT_EACH_EQUAL_HEX64 (expected, actual, num_elements)` +#### `TEST_ASSERT_EACH_EQUAL_CHAR (expected, actual, num_elements)` + #### `TEST_ASSERT_EACH_EQUAL_PTR (expected, actual, num_elements)` #### `TEST_ASSERT_EACH_EQUAL_STRING (expected, actual, num_elements)` diff --git a/src/unity.c b/src/unity.c index 1b5579146121dc6b7124139d12559e5ca6022dbf..ee575bdd0e797cc8a80399d388c31af5572c7dcf 100644 --- a/src/unity.c +++ b/src/unity.c @@ -304,13 +304,49 @@ void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T { if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { - UnityPrintNumber(number); + if (style == UNITY_DISPLAY_STYLE_CHAR) + { + /* printable characters plus CR & LF are printed */ + UNITY_OUTPUT_CHAR('\''); + if ((number <= 126) && (number >= 32)) + { + UNITY_OUTPUT_CHAR(number); + } + /* write escaped carriage returns */ + else if (number == 13) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('r'); + } + /* write escaped line feeds */ + else if (number == 10) + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('n'); + } + /* unprintable characters are shown as codes */ + else + { + UNITY_OUTPUT_CHAR('\\'); + UNITY_OUTPUT_CHAR('x'); + UnityPrintNumberHex((UNITY_UINT)number, 2); + } + UNITY_OUTPUT_CHAR('\''); + } + else + { + UnityPrintNumber(number); + } } else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) { UnityPrintNumberUnsigned((UNITY_UINT)number); } - else + else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) + { + UnityPrintNumberUnsigned((UNITY_UINT)number); + } + else { UNITY_OUTPUT_CHAR('0'); UNITY_OUTPUT_CHAR('x'); diff --git a/src/unity.h b/src/unity.h index afda5d9ade5bd0dc85bb5608c6a7d07b40b95bac..34d7f93aa8a613fb296b6e34cffaa38d35343ae3 100644 --- a/src/unity.h +++ b/src/unity.h @@ -143,6 +143,7 @@ void verifyTest(void); #define TEST_ASSERT_EQUAL_HEX16(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX32(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX64(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_CHAR(expected, actual) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_BITS(mask, expected, actual) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, NULL) #define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, NULL) @@ -166,6 +167,7 @@ void verifyTest(void); #define TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) @@ -183,6 +185,7 @@ void verifyTest(void); #define TEST_ASSERT_LESS_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_THAN_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) @@ -200,6 +203,7 @@ void verifyTest(void); #define TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) @@ -217,6 +221,7 @@ void verifyTest(void); #define TEST_ASSERT_LESS_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) +#define TEST_ASSERT_LESS_OR_EQUAL_CHAR(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, NULL) /* Integer Ranges (of all sizes) */ #define TEST_ASSERT_INT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, NULL) @@ -235,6 +240,7 @@ void verifyTest(void); #define TEST_ASSERT_HEX16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, NULL) +#define TEST_ASSERT_CHAR_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, NULL) /* Integer Array Ranges (of all sizes) */ #define TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) @@ -253,6 +259,7 @@ void verifyTest(void); #define TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) #define TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) #define TEST_ASSERT_HEX64_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) +#define TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, NULL) /* Structs and Strings */ @@ -281,6 +288,7 @@ void verifyTest(void); #define TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) /* Arrays Compared To Single Value */ #define TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, NULL) @@ -302,6 +310,7 @@ void verifyTest(void); #define TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, NULL) +#define TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (num_elements), __LINE__, NULL) /* Floating Point (If Enabled) */ #define TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, NULL) @@ -387,6 +396,7 @@ void verifyTest(void); #define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, (message)) #define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) #define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_CHAR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_CHAR((expected), (actual), __LINE__, (message)) /* Integer Greater Than/ Less Than (of all sizes) */ #define TEST_ASSERT_GREATER_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) @@ -405,6 +415,7 @@ void verifyTest(void); #define TEST_ASSERT_GREATER_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_CHAR((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) @@ -422,6 +433,7 @@ void verifyTest(void); #define TEST_ASSERT_LESS_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_THAN_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_CHAR((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) @@ -439,6 +451,7 @@ void verifyTest(void); #define TEST_ASSERT_GREATER_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_GREATER_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) @@ -456,6 +469,7 @@ void verifyTest(void); #define TEST_ASSERT_LESS_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) +#define TEST_ASSERT_LESS_OR_EQUAL_CHAR_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR((threshold), (actual), __LINE__, (message)) /* Integer Ranges (of all sizes) */ #define TEST_ASSERT_INT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, (message)) @@ -474,6 +488,7 @@ void verifyTest(void); #define TEST_ASSERT_HEX16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, (message)) +#define TEST_ASSERT_CHAR_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_CHAR_WITHIN((delta), (expected), (actual), __LINE__, (message)) /* Integer Array Ranges (of all sizes) */ #define TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_INT_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) @@ -492,6 +507,7 @@ void verifyTest(void); #define TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) #define TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) #define TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_HEX64_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) +#define TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(delta, expected, actual, num_elements, message) UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN((delta), (expected), (actual), num_elements, __LINE__, (message)) /* Structs and Strings */ @@ -520,6 +536,7 @@ void verifyTest(void); #define TEST_ASSERT_EQUAL_PTR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_STRING_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_MEMORY_ARRAY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EQUAL_CHAR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) /* Arrays Compared To Single Value*/ #define TEST_ASSERT_EACH_EQUAL_INT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, (message)) @@ -541,6 +558,7 @@ void verifyTest(void); #define TEST_ASSERT_EACH_EQUAL_PTR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_STRING_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_MEMORY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, (message)) +#define TEST_ASSERT_EACH_EQUAL_CHAR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_CHAR((expected), (actual), (num_elements), __LINE__, (message)) /* Floating Point (If Enabled) */ #define TEST_ASSERT_FLOAT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, (message)) diff --git a/src/unity_internals.h b/src/unity_internals.h index 11524f065935c6951c96c45eeb8003df3c40f7cc..7e2024f8743d8fc2f42985f7b3b9b4eef10a7a7e 100644 --- a/src/unity_internals.h +++ b/src/unity_internals.h @@ -381,6 +381,7 @@ typedef void (*UnityTestFunction)(void); #define UNITY_DISPLAY_RANGE_INT (0x10) #define UNITY_DISPLAY_RANGE_UINT (0x20) #define UNITY_DISPLAY_RANGE_HEX (0x40) +#define UNITY_DISPLAY_RANGE_CHAR (0x80) typedef enum { @@ -407,6 +408,8 @@ typedef enum UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX, #endif + UNITY_DISPLAY_STYLE_CHAR = 1 + UNITY_DISPLAY_RANGE_CHAR + UNITY_DISPLAY_RANGE_INT, + UNITY_DISPLAY_STYLE_UNKNOWN } UNITY_DISPLAY_STYLE_T; @@ -764,6 +767,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_EQUAL_CHAR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) @@ -777,6 +781,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_GREATER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) @@ -789,6 +794,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_SMALLER_THAN_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) @@ -801,6 +807,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 ) (threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT) (threshold), (UNITY_INT) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) @@ -813,6 +820,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) +#define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_CHAR(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 ) (actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin( (delta), (UNITY_INT) (expected), (UNITY_INT) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) @@ -825,7 +833,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) - +#define UNITY_TEST_ASSERT_CHAR_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 ) (expected), (UNITY_INT)(UNITY_INT8 ) (actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR) #define UNITY_TEST_ASSERT_INT_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin( (delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_INT8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY) @@ -838,6 +846,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_HEX8_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_HEX16_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT16)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_HEX32_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT32)(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_CHAR_ARRAY_WITHIN(delta, expected, actual, num_elements, line, message) UnityAssertNumbersArrayWithin((UNITY_UINT8 )(delta), (UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), ((UNITY_UINT32)(num_elements)), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER) @@ -859,6 +868,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) +#define UNITY_TEST_ASSERT_EQUAL_CHAR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) (expected), (UNITY_INT_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_VAL) @@ -874,6 +884,7 @@ int UnityTestMatches(void); #define UNITY_TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_PTR_TO_INT) (expected), (UNITY_POINTER_WIDTH / 8)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) +#define UNITY_TEST_ASSERT_EACH_EQUAL_CHAR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )(expected), 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_CHAR, UNITY_ARRAY_TO_VAL) #ifdef UNITY_SUPPORT_64 #define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) diff --git a/test/tests/testunity.c b/test/tests/testunity.c index c9712eda2139d0d5b85e845ce35f484c93d4d8ea..9f2d69286bbce028cf8059fa8bfce5e1d3bc90ba 100644 --- a/test/tests/testunity.c +++ b/test/tests/testunity.c @@ -288,6 +288,13 @@ void testNotEqualInt8s(void) VERIFY_FAILS_END } +void testNotEqualChars(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_EQUAL_CHAR('A', 'a'); + VERIFY_FAILS_END +} + void testNotEqualInt16s(void) { EXPECT_ABORT_BEGIN @@ -476,6 +483,32 @@ void testEqualInt8sWhenThereAreDifferencesOutside8Bits(void) TEST_ASSERT_EQUAL_INT8(0xFF21,0x0021); } +void testEqualChars(void) +{ + char v0, v1; + char *p0, *p1; + + v0 = 'A'; + v1 = 'A'; + p0 = &v0; + p1 = &v1; + + TEST_ASSERT_EQUAL_CHAR('A', 'A'); + TEST_ASSERT_EQUAL_CHAR(v0, v1); + TEST_ASSERT_EQUAL_CHAR('A', v1); + TEST_ASSERT_EQUAL_CHAR(v0, 'A'); + TEST_ASSERT_EQUAL_CHAR(*p0, v1); + TEST_ASSERT_EQUAL_CHAR(*p0, *p1); + TEST_ASSERT_EQUAL_CHAR(*p0, 'A'); +} + +void testEqualCharsWhenThereAreDifferencesOutside8Bits(void) +{ + TEST_ASSERT_EQUAL_CHAR(0x321,0x421); + TEST_ASSERT_EQUAL_CHAR(0xFF21,0x0021); +} + + void testEqualInt16s(void) { UNITY_INT16 v0, v1; @@ -844,24 +877,24 @@ void testEqualUShorts(void) TEST_ASSERT_EQUAL_UINT(*p0, 19467); } -void testEqualChars(void) +void testEqualUInts(void) { - signed char v0, v1; - signed char *p0, *p1; + unsigned char v0, v1; + unsigned char *p0, *p1; v0 = 109; v1 = 109; p0 = &v0; p1 = &v1; - TEST_ASSERT_EQUAL_INT(42, 42); - TEST_ASSERT_EQUAL_INT(-116, -116); - TEST_ASSERT_EQUAL_INT(v0, v1); - TEST_ASSERT_EQUAL_INT(109, v1); - TEST_ASSERT_EQUAL_INT(v0, 109); - TEST_ASSERT_EQUAL_INT(*p0, v1); - TEST_ASSERT_EQUAL_INT(*p0, *p1); - TEST_ASSERT_EQUAL_INT(*p0, 109); + TEST_ASSERT_EQUAL_UINT(42, 42); + TEST_ASSERT_EQUAL_UINT(-116, -116); + TEST_ASSERT_EQUAL_UINT(v0, v1); + TEST_ASSERT_EQUAL_UINT(109, v1); + TEST_ASSERT_EQUAL_UINT(v0, 109); + TEST_ASSERT_EQUAL_UINT(*p0, v1); + TEST_ASSERT_EQUAL_UINT(*p0, *p1); + TEST_ASSERT_EQUAL_UINT(*p0, 109); } void testEqualUChars(void) @@ -1343,6 +1376,42 @@ void testINT8sNotWithinDeltaAndCustomMessage(void) VERIFY_FAILS_END } +void testCHARsWithinDelta(void) +{ + TEST_ASSERT_CHAR_WITHIN(1, 'M', 'L'); + TEST_ASSERT_CHAR_WITHIN(5, -2, 2); + TEST_ASSERT_CHAR_WITHIN(5, 2, -2); +} + +void testCHARsWithinDeltaAndCustomMessage(void) +{ + TEST_ASSERT_CHAR_WITHIN_MESSAGE(5, 1, 4, "Custom Message."); +} + +void testCHARsWithinDeltaWhenThereAreDifferenceOutsideOf8Bits(void) +{ + TEST_ASSERT_CHAR_WITHIN(5, 0x123, 0xF23); +} + +void testCHARsWithinDeltaWhenThereAreDifferenceOutsideOf8BitsAndCustomMessage(void) +{ + TEST_ASSERT_CHAR_WITHIN_MESSAGE(5, 0x123, 0xF23, "Custom Message."); +} + +void testCHARsNotWithinDelta(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_WITHIN(2, -3, 0); + VERIFY_FAILS_END +} + +void testCHARsNotWithinDeltaAndCustomMessage(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_WITHIN_MESSAGE(2, -4, 0, "Custom Message."); + VERIFY_FAILS_END +} + /*------------------------*/ void testInt64ArrayWithinDelta(void) @@ -1352,10 +1421,10 @@ void testInt64ArrayWithinDelta(void) #else UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; UNITY_INT64 acutalSmallDelta[] = {12345001, -12344996, 12345005}; - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; TEST_ASSERT_INT64_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); #endif } @@ -1366,10 +1435,10 @@ void testInt64ArrayWithinDeltaAndMessage(void) #else UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; UNITY_INT64 acutalSmallDelta[] = {12345001, -12344996, 12345005}; - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); #endif } @@ -1379,10 +1448,10 @@ void tesUInt64ArrayNotWithinDelta(void) TEST_IGNORE(); #else UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END #endif } @@ -1393,10 +1462,10 @@ void testInt64ArrayNotWithinDeltaAndMessage(void) TEST_IGNORE(); #else UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END #endif } @@ -1407,10 +1476,10 @@ void testInt64ArrayWithinDeltaPointless(void) TEST_IGNORE(); #else UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_INT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END #endif } @@ -1421,10 +1490,10 @@ void testInt64ArrayWithinDeltaPointlessAndMessage(void) TEST_IGNORE(); #else UNITY_INT64 expected[] = {12345000, -12344995, 12345005}; - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END #endif } @@ -1434,10 +1503,10 @@ void testInt64ArrayWithinDeltaExpectedNull(void) #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); #else - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_INT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END #endif } @@ -1447,10 +1516,10 @@ void testInt64ArrayWithinDeltaExpectedNullAndMessage(void) #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); #else - UNITY_INT64 acutalBigDelta[] = {12345101, -12344896, 12345055}; + UNITY_INT64 actualBigDelta[] = {12345101, -12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END #endif } @@ -1507,77 +1576,77 @@ void testIntArrayWithinDelta(void) { UNITY_INT expected[] = {5000, -4995, 5005}; UNITY_INT acutalSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, actualBigDelta, 3); } void testIntArrayWithinDeltaAndMessage(void) { UNITY_INT expected[] = {5000, -4995, 5005}; UNITY_INT acutalSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); } void testIntArrayNotWithinDelta(void) { UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_INT_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testIntArrayNotWithinDeltaAndMessage(void) { UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testIntArrayWithinDeltaPointless(void) { UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_INT_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testIntArrayWithinDeltaPointlessAndMessage(void) { UNITY_INT expected[] = {5000, -4995, 5005}; - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testIntArrayWithinDeltaExpectedNull(void) { - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_INT_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testIntArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_INT acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -1617,77 +1686,77 @@ void testInt16ArrayWithinDelta(void) { UNITY_INT16 expected[] = {5000, -4995, 5005}; UNITY_INT16 acutalSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; TEST_ASSERT_INT16_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); } void testInt16ArrayWithinDeltaAndMessage(void) { UNITY_INT16 expected[] = {5000, -4995, 5005}; UNITY_INT16 acutalSmallDelta[] = {5001, -4996, 5005}; - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); } void testInt16ArrayNotWithinDelta(void) { UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testInt16ArrayNotWithinDeltaAndMessage(void) { UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testInt16ArrayWithinDeltaPointless(void) { UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_INT16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testInt16ArrayWithinDeltaPointlessAndMessage(void) { UNITY_INT16 expected[] = {5000, -4995, 5005}; - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testInt16ArrayWithinDeltaExpectedNull(void) { - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_INT16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testInt16ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_INT16 acutalBigDelta[] = {5101, -4896, 5055}; + UNITY_INT16 actualBigDelta[] = {5101, -4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -1727,77 +1796,77 @@ void testInt8ArrayWithinDelta(void) { UNITY_INT8 expected[] = {20, -95, 55}; UNITY_INT8 acutalSmallDelta[] = {21, -94, 55}; - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, acutalBigDelta, 3); + TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, actualBigDelta, 3); } void testInt8ArrayWithinDeltaAndMessage(void) { UNITY_INT8 expected[] = {20, -95, 55}; UNITY_INT8 acutalSmallDelta[] = {21, -94, 55}; - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); } void testInt8ArrayNotWithinDelta(void) { UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_INT8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testInt8ArrayNotWithinDeltaAndMessage(void) { UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testInt8ArrayWithinDeltaPointless(void) { UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, acutalBigDelta, 0); + TEST_ASSERT_INT8_ARRAY_WITHIN(11, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testInt8ArrayWithinDeltaPointlessAndMessage(void) { UNITY_INT8 expected[] = {20, -95, 55}; - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testInt8ArrayWithinDeltaExpectedNull(void) { - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN(11, NULL, acutalBigDelta, 3); + TEST_ASSERT_INT8_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testInt8ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_INT8 acutalBigDelta[] = {11, -86, 45}; + UNITY_INT8 actualBigDelta[] = {11, -86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -1833,6 +1902,120 @@ void testInt8ArrayWithinDeltaSamePointerAndMessage(void) TEST_ASSERT_INT8_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); } + + + + +void testCHARArrayWithinDelta(void) +{ + char expected[] = {20, -95, 55}; + char acutalSmallDelta[] = {21, -94, 55}; + char actualBigDelta[] = {11, -86, 45}; + + TEST_ASSERT_CHAR_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); + TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, actualBigDelta, 3); +} + +void testCHARArrayWithinDeltaAndMessage(void) +{ + char expected[] = {20, -95, 55}; + char acutalSmallDelta[] = {21, -94, 55}; + char actualBigDelta[] = {11, -86, 45}; + + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); +} + +void testCHARArrayNotWithinDelta(void) +{ + char expected[] = {20, -95, 55}; + char actualBigDelta[] = {11, -86, 45}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN(1, expected, actualBigDelta, 3); + VERIFY_FAILS_END +} + +void testCHARArrayNotWithinDeltaAndMessage(void) +{ + char expected[] = {20, -95, 55}; + char actualBigDelta[] = {11, -86, 45}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaPointless(void) +{ + char expected[] = {20, -95, 55}; + char actualBigDelta[] = {11, -86, 45}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, actualBigDelta, 0); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaPointlessAndMessage(void) +{ + char expected[] = {20, -95, 55}; + char actualBigDelta[] = {11, -86, 45}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaExpectedNull(void) +{ + char actualBigDelta[] = {11, -86, 45}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaExpectedNullAndMessage(void) +{ + char actualBigDelta[] = {11, -86, 45}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaActualNull(void) +{ + char expected[] = {20, -95, 55}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, NULL, 3); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaActualNullAndMessage(void) +{ + char expected[] = {20, -95, 55}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, NULL, 3, "Custom Message."); + VERIFY_FAILS_END +} + +void testCHARArrayWithinDeltaSamePointer(void) +{ + char expected[] = {20, -95, 55}; + + TEST_ASSERT_CHAR_ARRAY_WITHIN(11, expected, expected, 3); +} + +void testCHARArrayWithinDeltaSamePointerAndMessage(void) +{ + char expected[] = {20, -95, 55}; + + TEST_ASSERT_CHAR_ARRAY_WITHIN_MESSAGE(11, expected, expected, 3, "Custom Message."); +} + void testUInt64ArrayWithinDelta(void) { #ifndef UNITY_SUPPORT_64 @@ -1840,10 +2023,10 @@ void testUInt64ArrayWithinDelta(void) #else UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; UNITY_UINT64 acutalSmallDelta[] = {12345001, 12344996, 12345005}; - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); #endif } @@ -1854,10 +2037,10 @@ void testUInt64ArrayWithinDeltaAndMessage(void) #else UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; UNITY_UINT64 acutalSmallDelta[] = {12345001, 12344996, 12345005}; - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); #endif } @@ -1867,10 +2050,10 @@ void testUInt64ArrayNotWithinDelta(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END #endif } @@ -1881,10 +2064,10 @@ void testUInt64ArrayNotWithinDeltaAndMessage(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END #endif } @@ -1895,10 +2078,10 @@ void testUInt64ArrayWithinDeltaPointless(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_UINT64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END #endif } @@ -1909,10 +2092,10 @@ void testUInt64ArrayWithinDeltaPointlessAndMessage(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {12345000, 12344995, 12345005}; - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END #endif } @@ -1922,10 +2105,10 @@ void testUInt64ArrayWithinDeltaExpectedNull(void) #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); #else - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_UINT64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END #endif } @@ -1935,10 +2118,10 @@ void testUInt64ArrayWithinDeltaExpectedNullAndMessage(void) #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); #else - UNITY_UINT64 acutalBigDelta[] = {12345101, 12344896, 12345055}; + UNITY_UINT64 actualBigDelta[] = {12345101, 12344896, 12345055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END #endif } @@ -1995,77 +2178,77 @@ void testUIntArrayWithinDelta(void) { UNITY_UINT expected[] = {125000, 124995, 125005}; UNITY_UINT acutalSmallDelta[] = {125001, 124996, 125005}; - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, actualBigDelta, 3); } void testUIntArrayWithinDeltaAndMessage(void) { UNITY_UINT expected[] = {125000, 124995, 125005}; UNITY_UINT acutalSmallDelta[] = {125001, 124996, 125005}; - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); } void testUIntArrayNotWithinDelta(void) { UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testUIntArrayNotWithinDeltaAndMessage(void) { UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testUIntArrayWithinDeltaPointless(void) { UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_UINT_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testUIntArrayWithinDeltaPointlessAndMessage(void) { UNITY_UINT expected[] = {125000, 124995, 125005}; - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testUIntArrayWithinDeltaExpectedNull(void) { - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_UINT_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testUIntArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_UINT acutalBigDelta[] = {125101, 124896, 125055}; + UNITY_UINT actualBigDelta[] = {125101, 124896, 125055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -2105,77 +2288,77 @@ void testUInt16ArrayWithinDelta(void) { UNITY_UINT16 expected[] = {5000, 4995, 5005}; UNITY_UINT16 acutalSmallDelta[] = {5001, 4996, 5005}; - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); } void testUInt16ArrayWithinDeltaAndMessage(void) { UNITY_UINT16 expected[] = {5000, 4995, 5005}; UNITY_UINT16 acutalSmallDelta[] = {5001, 4996, 5005}; - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); } void testUInt16ArrayNotWithinDelta(void) { UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testUInt16ArrayNotWithinDeltaAndMessage(void) { UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testUInt16ArrayWithinDeltaPointless(void) { UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_UINT16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testUInt16ArrayWithinDeltaPointlessAndMessage(void) { UNITY_UINT16 expected[] = {5000, 4995, 5005}; - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testUInt16ArrayWithinDeltaExpectedNull(void) { - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_UINT16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testUInt16ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_UINT16 acutalBigDelta[] = {5101, 4896, 5055}; + UNITY_UINT16 actualBigDelta[] = {5101, 4896, 5055}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -2215,77 +2398,77 @@ void testUInt8ArrayWithinDelta(void) { UNITY_UINT8 expected[] = {20, 95, 55}; UNITY_UINT8 acutalSmallDelta[] = {21, 94, 55}; - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, actualBigDelta, 3); } void testUInt8ArrayWithinDeltaAndMessage(void) { UNITY_UINT8 expected[] = {20, 95, 55}; UNITY_UINT8 acutalSmallDelta[] = {21, 94, 55}; - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 3, "Custom Message."); } void testUInt8ArrayNotWithinDelta(void) { UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_UINT8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testUInt8ArrayNotWithinDeltaAndMessage(void) { UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testUInt8ArrayWithinDeltaPointless(void) { UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, acutalBigDelta, 0); + TEST_ASSERT_UINT8_ARRAY_WITHIN(11, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testUInt8ArrayWithinDeltaPointlessAndMessage(void) { UNITY_UINT8 expected[] = {20, 95, 55}; - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testUInt8ArrayWithinDeltaExpectedNull(void) { - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN(11, NULL, acutalBigDelta, 3); + TEST_ASSERT_UINT8_ARRAY_WITHIN(11, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testUInt8ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_UINT8 acutalBigDelta[] = {11, 86, 45}; + UNITY_UINT8 actualBigDelta[] = {11, 86, 45}; EXPECT_ABORT_BEGIN - TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_UINT8_ARRAY_WITHIN_MESSAGE(11, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -2328,10 +2511,10 @@ void testHEX64ArrayWithinDelta(void) #else UNITY_UINT64 expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; UNITY_UINT64 acutalSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; TEST_ASSERT_HEX64_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_HEX64_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX64_ARRAY_WITHIN(110, expected, actualBigDelta, 3); #endif } @@ -2342,10 +2525,10 @@ void testHEX64ArrayWithinDeltaAndMessage(void) #else UNITY_UINT64 expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; UNITY_UINT64 acutalSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); #endif } @@ -2355,10 +2538,10 @@ void testHEX64ArrayNotWithinDelta(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX64_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END #endif } @@ -2369,10 +2552,10 @@ void testHEX64ArrayNotWithinDeltaAndMessage(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END #endif } @@ -2383,10 +2566,10 @@ void testHEX64ArrayWithinDeltaPointless(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_HEX64_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END #endif } @@ -2397,10 +2580,10 @@ void testHEX64ArrayWithinDeltaPointlessAndMessage(void) TEST_IGNORE(); #else UNITY_UINT64 expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END #endif } @@ -2410,10 +2593,10 @@ void testHEX64ArrayWithinDeltaExpectedNull(void) #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); #else - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_HEX64_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END #endif } @@ -2423,10 +2606,10 @@ void testHEX64ArrayWithinDeltaExpectedNullAndMessage(void) #ifndef UNITY_SUPPORT_64 TEST_IGNORE(); #else - UNITY_UINT64 acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT64 actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX64_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END #endif } @@ -2483,77 +2666,77 @@ void testHEX32ArrayWithinDelta(void) { UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; UNITY_UINT acutalSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 3); } void testHEX32ArrayWithinDeltaAndMessage(void) { UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; UNITY_UINT acutalSmallDelta[] = {0xABCD1235, 0xABCD1121, 0xABCD1277}; - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); } void testHEX32ArrayNotWithinDelta(void) { UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX32_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testHEX32ArrayNotWithinDeltaAndMessage(void) { UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testHEX32ArrayWithinDeltaPointless(void) { UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_HEX32_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testHEX32ArrayWithinDeltaPointlessAndMessage(void) { UNITY_UINT expected[] = {0xABCD1234, 0xABCD1122, 0xABCD1277}; - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testHEX32ArrayWithinDeltaExpectedNull(void) { - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_HEX32_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testHEX32ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_UINT acutalBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; + UNITY_UINT actualBigDelta[] = {0xABCD1267, 0xABCD1188, 0xABCD12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX32_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -2594,77 +2777,77 @@ void testHEX16ArrayWithinDelta(void) { UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; UNITY_UINT16 acutalSmallDelta[] = {0x1235, 0x1121, 0x1277}; - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 3); } void testHEX16ArrayWithinDeltaAndMessage(void) { UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; UNITY_UINT16 acutalSmallDelta[] = {0x1235, 0x1121, 0x1277}; - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 3, "Custom Message."); } void testHEX16ArrayNotWithinDelta(void) { UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX16_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testHEX16ArrayNotWithinDeltaAndMessage(void) { UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testHEX16ArrayWithinDeltaPointless(void) { UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, acutalBigDelta, 0); + TEST_ASSERT_HEX16_ARRAY_WITHIN(110, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testHEX16ArrayWithinDeltaPointlessAndMessage(void) { UNITY_UINT16 expected[] = {0x1234, 0x1122, 0x1277}; - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testHEX16ArrayWithinDeltaExpectedNull(void) { - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN(110, NULL, acutalBigDelta, 3); + TEST_ASSERT_HEX16_ARRAY_WITHIN(110, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testHEX16ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_UINT16 acutalBigDelta[] = {0x1267, 0x1188, 0x12AC}; + UNITY_UINT16 actualBigDelta[] = {0x1267, 0x1188, 0x12AC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX16_ARRAY_WITHIN_MESSAGE(110, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -2704,77 +2887,77 @@ void testHEX8ArrayWithinDelta(void) { UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; UNITY_UINT8 acutalSmallDelta[] = {0x35, 0x21, 0x77}; - UNITY_UINT8 acutalBigDelta[] = {0x47, 0x48, 0x4C}; + UNITY_UINT8 actualBigDelta[] = {0x47, 0x48, 0x4C}; TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, acutalSmallDelta, 3); - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, actualBigDelta, 3); } void testHEX8ArrayWithinDeltaAndMessage(void) { UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; UNITY_UINT8 acutalSmallDelta[] = {0x35, 0x21, 0x77}; - UNITY_UINT8 acutalBigDelta[] = {0x47, 0x48, 0x4C}; + UNITY_UINT8 actualBigDelta[] = {0x47, 0x48, 0x4C}; TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, acutalSmallDelta, 3, "Custom Message."); - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, actualBigDelta, 3, "Custom Message."); } void testHEX8ArrayNotWithinDelta(void) { UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 acutalBigDelta[] = {0x67, 0x88, 0xAC}; + UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, acutalBigDelta, 3); + TEST_ASSERT_HEX8_ARRAY_WITHIN(1, expected, actualBigDelta, 3); VERIFY_FAILS_END } void testHEX8ArrayNotWithinDeltaAndMessage(void) { UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 acutalBigDelta[] = {0x67, 0x88, 0xAC}; + UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(1, expected, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } void testHEX8ArrayWithinDeltaPointless(void) { UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 acutalBigDelta[] = {0x67, 0x88, 0xAC}; + UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, acutalBigDelta, 0); + TEST_ASSERT_HEX8_ARRAY_WITHIN(60, expected, actualBigDelta, 0); VERIFY_FAILS_END } void testHEX8ArrayWithinDeltaPointlessAndMessage(void) { UNITY_UINT8 expected[] = {0x34, 0x22, 0x77}; - UNITY_UINT8 acutalBigDelta[] = {0x67, 0x88, 0xAC}; + UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, acutalBigDelta, 0, "Custom Message."); + TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, expected, actualBigDelta, 0, "Custom Message."); VERIFY_FAILS_END } void testHEX8ArrayWithinDeltaExpectedNull(void) { - UNITY_UINT8 acutalBigDelta[] = {0x67, 0x88, 0xAC}; + UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN(60, NULL, acutalBigDelta, 3); + TEST_ASSERT_HEX8_ARRAY_WITHIN(60, NULL, actualBigDelta, 3); VERIFY_FAILS_END } void testHEX8ArrayWithinDeltaExpectedNullAndMessage(void) { - UNITY_UINT8 acutalBigDelta[] = {0x67, 0x88, 0xAC}; + UNITY_UINT8 actualBigDelta[] = {0x67, 0x88, 0xAC}; EXPECT_ABORT_BEGIN - TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, NULL, acutalBigDelta, 3, "Custom Message."); + TEST_ASSERT_HEX8_ARRAY_WITHIN_MESSAGE(60, NULL, actualBigDelta, 3, "Custom Message."); VERIFY_FAILS_END } @@ -2881,6 +3064,29 @@ void testNotGreaterThanINT8(void) VERIFY_FAILS_END } +void testGreaterThanCHAR(void) +{ + char v0, v1; + char *p0, *p1; + + v0 = -128; + v1 = 127; + p0 = &v0; + p1 = &v1; + + TEST_ASSERT_GREATER_THAN_CHAR(v0, v1); + TEST_ASSERT_GREATER_THAN_CHAR(*p0, v1); + TEST_ASSERT_GREATER_THAN_CHAR(v0, *p1); + TEST_ASSERT_GREATER_THAN_CHAR(*p0, *p1); +} + +void testNotGreaterThanCHAR(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_GREATER_THAN_CHAR(127, -128); + VERIFY_FAILS_END +} + void testGreaterThanINT16(void) { UNITY_INT16 v0, v1; @@ -3175,6 +3381,35 @@ void testNotGreaterOrEqualINT8(void) VERIFY_FAILS_END } +void testGreaterOrEqualCHAR(void) +{ + char v0, v1, v2; + char *p0, *p1, *p2; + + v0 = -128; + v1 = 127; + v2 = -128; + p0 = &v0; + p1 = &v1; + p2 = &v2; + + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, v1); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, v1); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, *p1); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, *p1); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, v2); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, v2); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(v0, *p2); + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(*p0, *p2); +} + +void testNotGreaterOrEqualCHAR(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_GREATER_OR_EQUAL_CHAR(127, -128); + VERIFY_FAILS_END +} + void testGreaterOrEqualINT16(void) { UNITY_INT16 v0, v1, v2; @@ -3507,6 +3742,29 @@ void testNotLessThanINT8(void) VERIFY_FAILS_END } +void testLessThanCHAR(void) +{ + char v0, v1; + char *p0, *p1; + + v0 = 127; + v1 = -128; + p0 = &v0; + p1 = &v1; + + TEST_ASSERT_LESS_THAN_CHAR(v0, v1); + TEST_ASSERT_LESS_THAN_CHAR(*p0, v1); + TEST_ASSERT_LESS_THAN_CHAR(v0, *p1); + TEST_ASSERT_LESS_THAN_CHAR(*p0, *p1); +} + +void testNotLessThanCHAR(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_LESS_THAN_CHAR(-128, 127); + VERIFY_FAILS_END +} + void testLessThanINT16(void) { UNITY_INT16 v0, v1; @@ -3801,6 +4059,35 @@ void testNotLessOrEqualINT8(void) VERIFY_FAILS_END } +void testLessOrEqualCHAR(void) +{ + char v0, v1, v2; + char *p0, *p1, *p2; + + v0 = 127; + v1 = -128; + v2 = 127; + p0 = &v0; + p1 = &v1; + p2 = &v2; + + TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, v1); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, v1); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, *p1); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, *p1); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, v2); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, v2); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(v0, *p2); + TEST_ASSERT_LESS_OR_EQUAL_CHAR(*p0, *p2); +} + +void testNotLessOrEqualCHAR(void) +{ + EXPECT_ABORT_BEGIN + TEST_ASSERT_LESS_OR_EQUAL_CHAR(-128, 127); + VERIFY_FAILS_END +} + void testLessOrEqualINT16(void) { UNITY_INT16 v0, v1, v2; @@ -4726,6 +5013,53 @@ void testNotEqualInt8EachEqual(void) VERIFY_FAILS_END } +void testEqualCHARArrays(void) +{ + char p0[] = {1, 8, 117, -2}; + char p1[] = {1, 8, 117, -2}; + char p2[] = {1, 8, 117, 2}; + char p3[] = {1, 50, 60, 70}; + + TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p0, 1); + TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p0, 4); + TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p1, 4); + TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p2, 3); + TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p3, 1); +} + +void testNotEqualCHARArrays(void) +{ + char p0[] = {1, 8, 36, -2}; + char p1[] = {1, 8, 36, 2}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_EQUAL_CHAR_ARRAY(p0, p1, 4); + VERIFY_FAILS_END +} + +void testEqualCHAREachEqual(void) +{ + char p0[] = {1, 1, 1, 1}; + char p1[] = {117, 117, 117, -2}; + char p2[] = {-1, -1, 117, 2}; + char p3[] = {1, 50, 60, 70}; + + TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 1); + TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 4); + TEST_ASSERT_EACH_EQUAL_CHAR(117, p1, 3); + TEST_ASSERT_EACH_EQUAL_CHAR(-1, p2, 2); + TEST_ASSERT_EACH_EQUAL_CHAR(1, p3, 1); +} + +void testNotEqualCHAREachEqual(void) +{ + char p0[] = {1, 8, 36, -2}; + + EXPECT_ABORT_BEGIN + TEST_ASSERT_EACH_EQUAL_CHAR(1, p0, 2); + VERIFY_FAILS_END +} + void testEqualUIntArrays(void) { unsigned int p0[] = {1, 8, 987, 65132u};