summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-09-05 22:24:03 -0400
committerRich Felker <dalias@aerifal.cx>2011-09-05 22:24:03 -0400
commit8c298bf215b6ce155df86e82f48344a3b7518225 (patch)
treecee3144383c9999fad5f51cb8876200750a234d9
parent7493b57058af4c894dbda14924a2602ad30fd96a (diff)
downloadlibc-testsuite-8c298bf215b6ce155df86e82f48344a3b7518225.tar.gz
fix incorrect strtoul tests (wrongly expected overflows)
-rw-r--r--strtol.c16
-rw-r--r--wcstol.c16
2 files changed, 16 insertions, 16 deletions
diff --git a/strtol.c b/strtol.c
index 9ccee53..09af1c9 100644
--- a/strtol.c
+++ b/strtol.c
@@ -47,21 +47,21 @@ int test_strtol(void)
TEST2(i, c-s, 10, "wrong final position %d != %d");
TEST2(i, errno, ERANGE, "missing errno %d != %d");
errno = 0;
- TEST(ul, strtoul(s="-1", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, strtoul(s="-1", &c, 0), -1UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 2, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
errno = 0;
- TEST(ul, strtoul(s="-2", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, strtoul(s="-2", &c, 0), -2UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 2, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
errno = 0;
- TEST(ul, strtoul(s="-2147483648", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, strtoul(s="-2147483648", &c, 0), -2147483648UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 11, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
errno = 0;
- TEST(ul, strtoul(s="-2147483649", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, strtoul(s="-2147483649", &c, 0), -2147483649UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 11, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
} else {
TEST(i, 0, 1, "64bit tests not implemented");
}
diff --git a/wcstol.c b/wcstol.c
index 07113df..bab5ade 100644
--- a/wcstol.c
+++ b/wcstol.c
@@ -40,21 +40,21 @@ int test_wcstol(void)
TEST2(i, c-s, 10, "wrong final position %d != %d");
TEST2(i, errno, ERANGE, "missing errno %d != %d");
errno = 0;
- TEST(ul, wcstoul(s=L"-1", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, wcstoul(s=L"-1", &c, 0), -1UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 2, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
errno = 0;
- TEST(ul, wcstoul(s=L"-2", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, wcstoul(s=L"-2", &c, 0), -2UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 2, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
errno = 0;
- TEST(ul, wcstoul(s=L"-2147483648", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, wcstoul(s=L"-2147483648", &c, 0), -2147483648UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 11, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
errno = 0;
- TEST(ul, wcstoul(s=L"-2147483649", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu");
+ TEST(ul, wcstoul(s=L"-2147483649", &c, 0), -2147483649UL, "rejected negative %lu != %lu");
TEST2(i, c-s, 11, "wrong final position %d != %d");
- TEST2(i, errno, ERANGE, "missing errno %d != %d");
+ TEST2(i, errno, 0, "spurious errno %d != %d");
} else {
TEST(i, 0, 1, "64bit tests not implemented");
}