From: Bartosz Golaszewski Date: Fri, 9 Jun 2017 08:55:53 +0000 (+0200) Subject: tests: tweak test output X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a201835e6f7631b250ce1d87d9e4b14f473d0f5c;p=qemu-gpiodev%2Flibgpiod.git tests: tweak test output Tweak the log message header a bit: instead of having a fixed width of the contents between the brackets in the header, fix the length of the whole header to 8 characters. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/gpiod-test.c b/tests/gpiod-test.c index 49a8e7f..10edd2b 100644 --- a/tests/gpiod-test.c +++ b/tests/gpiod-test.c @@ -126,8 +126,12 @@ static TEST_PRINTF(1, 2) void pr_raw(const char *fmt, ...) static void print_header(const char *hdr, int color) { + char buf[9]; + + snprintf(buf, sizeof(buf), "[%s]", hdr); + set_color(color); - pr_raw("[%-5s] ", hdr); + pr_raw("%-8s", buf); reset_color(); }