From 4f347e7a16d8b0144c84e0a349f66fcd3b473f02 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Wed, 9 Sep 2020 19:47:14 +0100 Subject: Make sure constants don't become unsigned --- test_gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_gen.c b/test_gen.c index ca46672..f5ec5c0 100644 --- a/test_gen.c +++ b/test_gen.c @@ -88,7 +88,7 @@ void generate_simple(FILE *out, char fmt, const char *type, intmax_t min, uintma if (sign) { fprintf(out, "\tCHECK_UNPACK(DATA(%s), \"%s%c\", &%c);\n", i2bytes(endian[e].e, size, min), endian[e].prefix, fmt, fmt); - fprintf(out, "\tCHECK_EQUAL(PRIdMAX, (intmax_t)%c, INTMAX_C(%" PRIdMAX "));\n", fmt, min); + fprintf(out, "\tCHECK_EQUAL(PRIdMAX, (intmax_t)%c, -INTMAX_C(%" PRIdMAX ")-1);\n", fmt, -(min + 1)); } fprintf(out, "\tCHECK_UNPACK(DATA(%s), \"%s%c\", &%c);\n", u2bytes(endian[e].e, size, max), endian[e].prefix, fmt, fmt); -- cgit v1.2.3-54-g00ecf