From 6ec86777cc560b6e017fa061eda302705242d0b5 Mon Sep 17 00:00:00 2001 From: Alison Winters Date: Sun, 7 Mar 2021 20:36:00 +0000 Subject: [PATCH] restore neghex test, but with strtoul instead --- test/libc/fmt/strtoimax_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/libc/fmt/strtoimax_test.c b/test/libc/fmt/strtoimax_test.c index bd751969a..df22d7f94 100644 --- a/test/libc/fmt/strtoimax_test.c +++ b/test/libc/fmt/strtoimax_test.c @@ -58,6 +58,12 @@ TEST(strtoimax, testTwosBane) { strtoimax("0x80000000000000000000000000000000", NULL, 0)); } +TEST(strtoul, neghex) { + errno = 0; + ASSERT_EQ(-16, (long) strtoul("0xfffffffffffffff0", NULL, 0)); + EXPECT_EQ(0, errno); +} + TEST(strtol, testOutsideLimit) { errno = 0; EXPECT_EQ(0x7fffffffffffffff, strtol("0x8000000000000000", NULL, 0));