mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-30 11:44:27 +01:00
Add test for C string escape sequences
This commit is contained in:
@@ -2275,6 +2275,14 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
|||||||
TEST_ASSERT_EQUAL(1, failures);
|
TEST_ASSERT_EQUAL(1, failures);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testCstringsEscapeSequence(void)
|
||||||
|
{
|
||||||
|
startPutcharSpy();
|
||||||
|
UnityPrint("\x16\x10");
|
||||||
|
endPutcharSpy();
|
||||||
|
TEST_ASSERT_EQUAL_STRING("\\x16\\x10", getBufferPutcharSpy());
|
||||||
|
}
|
||||||
|
|
||||||
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \
|
#define TEST_ASSERT_EQUAL_PRINT_NUMBERS(expected, actual) { \
|
||||||
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
|
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
|
||||||
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
|
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \
|
||||||
|
|||||||
Reference in New Issue
Block a user