From d404d93ab4c1d9c78797a1f448c73f567914db13 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 10 Jun 2022 10:05:26 +0200 Subject: [PATCH] tests/fmt_print: spice up test Add also a test for correct behavior of `print()` when the string doesn't happen to be zero-terminated at the expected position. --- tests/fmt_print/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/fmt_print/main.c b/tests/fmt_print/main.c index 7dd405bef53a..40964a8176ca 100644 --- a/tests/fmt_print/main.c +++ b/tests/fmt_print/main.c @@ -45,7 +45,11 @@ int main(void) print_str("\n"); print_float(1.2345, 5); print_str("\n"); - printf("%s", "Test "); + /* test mixing of printf() and fmt's print() works fine */ + printf("%s", "Test"); + /* test fmt's print indeed only honors the length parameter and doesn't + * print until the terminated zero byte */ + print(" not ", 1); print_str("successful."); puts("");