提交 de391861 编写于 作者: J jsalling

Add test for C string escape sequences

上级 af590028
...@@ -2275,6 +2275,14 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void) ...@@ -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()); \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册