Skip to content

Commit

Permalink
tests/fmt_print: spice up test
Browse files Browse the repository at this point in the history
Add also a test for correct behavior of `print()` when the string
doesn't happen to be zero-terminated at the expected position.
  • Loading branch information
maribu committed Jun 10, 2022
1 parent 85cf4ae commit d404d93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/fmt_print/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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("");

Expand Down

0 comments on commit d404d93

Please sign in to comment.