aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2020-09-09 19:47:14 +0100
committerTomasz Kramkowski <tk@the-tk.com>2020-09-09 19:47:14 +0100
commit4f347e7a16d8b0144c84e0a349f66fcd3b473f02 (patch)
tree08a4417a7d8674784f55b0ae3aa04ee32a2c8096
parentb435a5824bf88b9bddddb81e645623caa2e334bc (diff)
downloadpack-4f347e7a16d8b0144c84e0a349f66fcd3b473f02.tar.gz
pack-4f347e7a16d8b0144c84e0a349f66fcd3b473f02.tar.xz
pack-4f347e7a16d8b0144c84e0a349f66fcd3b473f02.zip
Make sure constants don't become unsigned
-rw-r--r--test_gen.c2
1 files changed, 1 insertions, 1 deletions
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);