Add test for C string escape sequences

This commit is contained in:
jsalling
2016-08-03 22:38:15 -05:00
parent af590028fa
commit de39186187

View File

@ -2275,6 +2275,14 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
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) { \
startPutcharSpy(); UnityPrintNumber((actual)); endPutcharSpy(); \
TEST_ASSERT_EQUAL_STRING((expected), getBufferPutcharSpy()); \