aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-06-24 13:07:52 +0200
committerMarco Paland <marco@paland.com>2018-06-24 13:07:52 +0200
commit810cb2b29053d84c38a4b8b7e40431137902d002 (patch)
treef4d51fe68b8a2850e75b3e5890ec37e47a642dd7 /test
parent175e466d92d90487ad12149eb4068cb183c28051 (diff)
downloadprintf-810cb2b29053d84c38a4b8b7e40431137902d002.tar.gz
printf-810cb2b29053d84c38a4b8b7e40431137902d002.tar.bz2
printf-810cb2b29053d84c38a4b8b7e40431137902d002.zip
fix(printf): suppress terminating \0 in printf() output
Closes #19
Diffstat (limited to 'test')
-rw-r--r--test/test_suite.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/test_suite.cpp b/test/test_suite.cpp
index 1251212..53482ab 100644
--- a/test/test_suite.cpp
+++ b/test/test_suite.cpp
@@ -55,11 +55,12 @@ void _out_fct(char character, void* arg)
}
-
TEST_CASE("printf", "[]" ) {
printf_idx = 0U;
memset(printf_buffer, 0xCC, 100U);
REQUIRE(test::printf("% d", 4232) == 5);
+ REQUIRE(printf_buffer[5] == (char)0xCC);
+ printf_buffer[5] = 0;
REQUIRE(!strcmp(printf_buffer, " 4232"));
}