From 91d640435d0fd79fe74f6c558d69ffdcbdf86234 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 29 Oct 2024 21:32:28 +0100 Subject: pretty-print: add format-string version of draw_progress_bar() We often format the prefix string via asprintf() before, let's hence add a helper for that. --- src/test/test-progress-bar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/test-progress-bar.c b/src/test/test-progress-bar.c index abc1d292dc..b199741cf5 100644 --- a/src/test/test-progress-bar.c +++ b/src/test/test-progress-bar.c @@ -14,7 +14,7 @@ TEST(progress_bar) { for (double d = 0; d <= 100; d += 0.5) { usleep_safe(random_u64_range(20 * USEC_PER_MSEC)); - draw_progress_bar(PROGRESS_PREFIX, d); + draw_progress_barf(d, PROGRESS_PREFIX "[" PID_FMT "]", getpid_cached()); if (!paused && d >= 50) { clear_progress_bar(PROGRESS_PREFIX); @@ -25,9 +25,9 @@ TEST(progress_bar) { } } - draw_progress_bar(PROGRESS_PREFIX, 100); + draw_progress_barf(100, PROGRESS_PREFIX "[" PID_FMT "]", getpid_cached()); usleep_safe(300 * MSEC_PER_SEC); - clear_progress_bar(PROGRESS_PREFIX); + clear_progress_bar(PROGRESS_PREFIX "[0123456789]" ); fputs("Done.\n", stdout); } -- cgit v1.2.3