From: Nick Bowler Date: Tue, 5 Dec 2023 05:34:27 +0000 (-0500) Subject: tests: Work around some ancient printf bugs. X-Git-Tag: v1.3~69 X-Git-Url: http://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/7516ec539764125f657a144cce32ce96df05bcf4 tests: Work around some ancient printf bugs. Some very old printf implementations (e.g., on ULTRIX 4.5) do not support negative precision with %.*s conversions in order to behave as if the precision was omitted. It is easy to change the rendertest program to avoid this problem, so let's change it. --- diff --git a/t/rendertest.c b/t/rendertest.c index 93574e2..14faafb 100644 --- a/t/rendertest.c +++ b/t/rendertest.c @@ -85,7 +85,7 @@ static int do_test(char *line, unsigned long n, int mode) return -1; } - printf("%lu %.*s\n", (unsigned long)rc, -(n>0), line); + printf(n > 0 ? "%lu %s\n" : "%lu\n", (unsigned long)rc, line); cdecl_free(decl); return 0; } diff --git a/tests/internal.at b/tests/internal.at index 8598073..3fa785a 100644 --- a/tests/internal.at +++ b/tests/internal.at @@ -83,8 +83,8 @@ int x[1234567890] ]]) AT_CHECK([rendertest -n 0