X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ffunctional%2Fstrtol.c;h=64909136abbf2494b8b83206248b347bd6538865;hb=d643f9eb7daeafe25ff81dcd2d4f239803823940;hp=81df887bf5d706053fb42a049b00086ebd78d25b;hpb=2cf89517c5b25c2524fe0c0c01ed277d7307a852;p=libc-test diff --git a/src/functional/strtol.c b/src/functional/strtol.c index 81df887..6490913 100644 --- a/src/functional/strtol.c +++ b/src/functional/strtol.c @@ -12,11 +12,11 @@ #define TEST(r, f, x, m) ( \ errno = 0, msg = #f, ((r) = (f)) == (x) || \ - (error("%s failed (" m ")\n", #f, r, x), 0) ) + (t_error("%s failed (" m ")\n", #f, r, x), 0) ) #define TEST2(r, f, x, m) ( \ ((r) = (f)) == (x) || \ - (error("%s failed (" m ")\n", msg, r, x), 0) ) + (t_error("%s failed (" m ")\n", msg, r, x), 0) ) int main(void) { @@ -70,5 +70,11 @@ int main(void) TEST(l, strtol(s="123", &c, 37), 0, "%ld != %ld"); TEST2(i, c-s, 0, "wrong final position %d != %d"); TEST2(i, errno, EINVAL, "%d != %d"); - return test_status; + + TEST(l, strtol(s=" 15437", &c, 8), 015437, "%ld != %ld"); + TEST2(i, c-s, 7, "wrong final position %d != %d"); + + TEST(l, strtol(s=" 1", &c, 0), 1, "%ld != %ld"); + TEST2(i, c-s, 3, "wrong final position %d != %d"); + return t_status; }