diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libc/strtol/strtoltest.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/regress/lib/libc/strtol/strtoltest.c b/src/regress/lib/libc/strtol/strtoltest.c index f7a8e0ab72..a90977a87d 100644 --- a/src/regress/lib/libc/strtol/strtoltest.c +++ b/src/regress/lib/libc/strtol/strtoltest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: strtoltest.c,v 1.1 2012/11/18 04:11:09 jsing Exp $ */ | 1 | /* $OpenBSD: strtoltest.c,v 1.2 2014/09/19 12:32:08 schwarze Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2012 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2012 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <errno.h> | 18 | #include <errno.h> |
19 | #include <limits.h> | ||
19 | #include <stdlib.h> | 20 | #include <stdlib.h> |
20 | #include <stdio.h> | 21 | #include <stdio.h> |
21 | #include <string.h> | 22 | #include <string.h> |
@@ -31,16 +32,17 @@ struct strtol_test { | |||
31 | struct strtol_test strtol_tests[] = { | 32 | struct strtol_test strtol_tests[] = { |
32 | {"1234567890", 1234567890L, '\0', 0, 0}, | 33 | {"1234567890", 1234567890L, '\0', 0, 0}, |
33 | {"0755", 493L, '\0', 0, 0}, | 34 | {"0755", 493L, '\0', 0, 0}, |
34 | {"0xdeadbeef", 3735928559L, '\0', 0, 0}, | 35 | {"0x7fFFffFf", 2147483647L, '\0', 0, 0}, |
35 | {"1234567890", 0L, '1', 1, EINVAL}, | 36 | {"1234567890", 0L, '1', 1, EINVAL}, |
36 | {"10101010", 170L, '\0', 2, 0}, | 37 | {"10101010", 170L, '\0', 2, 0}, |
37 | {"755", 493L, '\0', 8, 0}, | 38 | {"755", 493L, '\0', 8, 0}, |
38 | {"1234567890", 1234567890L, '\0', 10, 0}, | 39 | {"1234567890", 1234567890L, '\0', 10, 0}, |
39 | {"abc", 0L, 'a', 10, 0}, | 40 | {"abc", 0L, 'a', 10, 0}, |
40 | {"123xyz", 123L, 'x', 10, 0}, | 41 | {"123xyz", 123L, 'x', 10, 0}, |
41 | {"deadbeef", 3735928559L, '\0', 16, 0}, | 42 | {"-080000000", -2147483648L, '\0', 16, 0}, |
42 | {"DEADBEEF", 3735928559L, '\0', 16, 0}, | 43 | {"deadbeefdeadbeef", LONG_MAX, '\0', 16, ERANGE}, |
43 | {"deadzbeef", 57005L, 'z', 16, 0}, | 44 | {"deadzbeef", 57005L, 'z', 16, 0}, |
45 | {"-quitebig", LONG_MIN, '\0', 32, ERANGE}, | ||
44 | {"zzz", 46655L, '\0', 36, 0}, | 46 | {"zzz", 46655L, '\0', 36, 0}, |
45 | {"1234567890", 0L, '1', 37, EINVAL}, | 47 | {"1234567890", 0L, '1', 37, EINVAL}, |
46 | {"1234567890", 0L, '1', 123, EINVAL}, | 48 | {"1234567890", 0L, '1', 123, EINVAL}, |