summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/stdlib')
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c6
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c75
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c14
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c304
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c13
5 files changed, 387 insertions, 25 deletions
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
index 5a8fa28..7e29778 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $ */
+/* $NetBSD: t_getenv.c,v 1.3 2015/02/27 08:55:35 martin Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $");
+__RCSID("$NetBSD: t_getenv.c,v 1.3 2015/02/27 08:55:35 martin Exp $");
#include <atf-c.h>
#include <errno.h>
@@ -123,7 +123,7 @@ ATF_TC_HEAD(setenv_basic, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test setenv(3), getenv(3), unsetenv(3)");
- atf_tc_set_md_var(tc, "timeout", "300");
+ atf_tc_set_md_var(tc, "timeout", "600");
}
ATF_TC_BODY(setenv_basic, tc)
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c b/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
index 47afb84..8db7880 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_posix_memalign.c,v 1.2 2011/07/07 11:12:18 jruoho Exp $ */
+/* $NetBSD: t_posix_memalign.c,v 1.4 2015/11/07 17:35:31 nros Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -32,11 +32,12 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_posix_memalign.c,v 1.2 2011/07/07 11:12:18 jruoho Exp $");
+__RCSID("$NetBSD: t_posix_memalign.c,v 1.4 2015/11/07 17:35:31 nros Exp $");
#include <atf-c.h>
#include <errno.h>
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -49,10 +50,10 @@ ATF_TC_HEAD(posix_memalign_basic, tc)
}
ATF_TC_BODY(posix_memalign_basic, tc)
{
- size_t size[] = {
+ static const size_t size[] = {
1, 2, 3, 4, 10, 100, 16384, 32768, 65536
};
- size_t align[] = {
+ static const size_t align[] = {
512, 1024, 16, 32, 64, 4, 2048, 16, 2
};
@@ -63,7 +64,7 @@ ATF_TC_BODY(posix_memalign_basic, tc)
int ret;
p = (void*)0x1;
- (void)printf("Checking posix_memalign(&p, %zd, %zd)...\n",
+ (void)printf("Checking posix_memalign(&p, %zu, %zu)...\n",
align[i], size[i]);
ret = posix_memalign(&p, align[i], size[i]);
@@ -80,9 +81,71 @@ ATF_TC_BODY(posix_memalign_basic, tc)
}
}
+
+ATF_TC(aligned_alloc_basic);
+ATF_TC_HEAD(aligned_alloc_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Checks aligned_alloc(3)");
+}
+ATF_TC_BODY(aligned_alloc_basic, tc)
+{
+ static const size_t size[] = {
+ 1, 2, 3, 4, 10, 100, 16384, 32768, 65536, 10000, 0
+ };
+ static const size_t align[] = {
+ 512, 1024, 16, 32, 64, 4, 2048, 16, 2, 2048, 0
+ };
+
+ size_t i;
+ void *p;
+
+ for (i = 0; i < __arraycount(size); i++) {
+ (void)printf("Checking aligned_alloc(%zu, %zu)...\n",
+ align[i], size[i]);
+ p = aligned_alloc(align[i], size[i]);
+ if (p == NULL) {
+ if (align[i] == 0 || ((align[i] - 1) & align[i]) != 0 ||
+ size[i] % align[i] != 0) {
+ ATF_REQUIRE_EQ_MSG(errno, EINVAL,
+ "aligned_alloc: %s", strerror(errno));
+ }
+ else {
+ ATF_REQUIRE_EQ_MSG(errno, ENOMEM,
+ "aligned_alloc: %s", strerror(errno));
+ }
+ }
+ else {
+ ATF_REQUIRE_EQ_MSG(align[i] == 0, false,
+ "aligned_alloc: success when alignment was not "
+ "a power of 2");
+ ATF_REQUIRE_EQ_MSG((align[i] - 1) & align[i], 0,
+ "aligned_alloc: success when alignment was not "
+ "a power of 2");
+#ifdef __NetBSD__
+ /*
+ * NetBSD-specific invariant
+ *
+ * From aligned_alloc(3) on FreeBSD:
+ *
+ * Behavior is undefined if size is not an integral
+ * multiple of alignment.
+ */
+ ATF_REQUIRE_EQ_MSG(size[i] % align[i], 0,
+ "aligned_alloc: success when size was not an "
+ "integer multiple of alignment");
+#endif
+ ATF_REQUIRE_EQ_MSG(((intptr_t)p) & (align[i] - 1), 0,
+ "p = %p", p);
+ free(p);
+ }
+ }
+}
+
+
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, posix_memalign_basic);
-
+ ATF_TP_ADD_TC(tp, aligned_alloc_basic);
+
return atf_no_error();
}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
index 8f0f899..06f2de0 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strtod.c,v 1.32 2014/11/04 00:20:19 justin Exp $ */
+/* $NetBSD: t_strtod.c,v 1.34 2015/12/22 14:19:25 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
/* Public domain, Otto Moerbeek <otto@drijf.net>, 2006. */
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_strtod.c,v 1.32 2014/11/04 00:20:19 justin Exp $");
+__RCSID("$NetBSD: t_strtod.c,v 1.34 2015/12/22 14:19:25 christos Exp $");
#include <errno.h>
#include <math.h>
@@ -42,9 +42,7 @@ __RCSID("$NetBSD: t_strtod.c,v 1.32 2014/11/04 00:20:19 justin Exp $");
#include <atf-c.h>
-#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
#include <fenv.h>
-#endif
#if !defined(__vax__)
static const char * const inf_strings[] =
@@ -53,10 +51,6 @@ static const char * const inf_strings[] =
const char *nan_string = "NaN(x)y";
#endif
-#ifdef __FreeBSD__
-#define __HAVE_LONG_DOUBLE
-#endif
-
ATF_TC(strtod_basic);
ATF_TC_HEAD(strtod_basic, tc)
{
@@ -246,7 +240,7 @@ ATF_TC_HEAD(strtod_round, tc)
ATF_TC_BODY(strtod_round, tc)
{
-#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
+#ifdef __HAVE_FENV
/*
* Test that strtod(3) honors the current rounding mode.
@@ -270,7 +264,7 @@ ATF_TC_BODY(strtod_round, tc)
atf_tc_fail("strtod(3) did not honor fesetround(3)");
}
#else
- atf_tc_skip("Requires one of i386, amd64 or sparc");
+ atf_tc_skip("Requires <fenv.h> support");
#endif
}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c
new file mode 100644
index 0000000..bf958a1
--- /dev/null
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c
@@ -0,0 +1,304 @@
+/* $NetBSD: t_strtoi.c,v 1.1 2015/05/01 14:17:56 christos Exp $ */
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Created by Kamil Rytarowski, vesed on ID:
+ * NetBSD: t_strtol.c,v 1.5 2011/06/14 02:45:58 jruoho Exp
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: t_strtoi.c,v 1.1 2015/05/01 14:17:56 christos Exp $");
+
+#include <atf-c.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+struct test {
+ const char *str;
+ intmax_t res;
+ int base;
+ const char *end;
+ intmax_t lo;
+ intmax_t hi;
+ int rstatus;
+};
+
+static void check(struct test *, intmax_t, char *, int);
+
+static void
+check(struct test *t, intmax_t rv, char *end, int rstatus)
+{
+
+ if (rv != t->res)
+ atf_tc_fail_nonfatal("strtoi(%s, &end, %d, %jd, %jd, &rstatus)"
+ " failed (rv = %jd)", t->str, t->base, t->lo, t->hi, rv);
+
+ if (rstatus != t->rstatus)
+ atf_tc_fail_nonfatal("strtoi(%s, &end, %d, %jd, %jd, &rstatus)"
+ " failed (rstatus: %d ('%s'))",
+ t->str, t->base, t->lo, t->hi, rstatus, strerror(rstatus));
+
+ if ((t->end != NULL && strcmp(t->end, end) != 0) ||
+ (t->end == NULL && *end != '\0'))
+ atf_tc_fail_nonfatal("invalid end pointer ('%s') from "
+ "strtoi(%s, &end, %d, %jd, %jd, &rstatus)",
+ end, t->str, t->base, t->lo, t->hi);
+}
+
+ATF_TC(strtoi_base);
+ATF_TC_HEAD(strtoi_base, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test strtoi(3) with different bases");
+}
+
+ATF_TC_BODY(strtoi_base, tc)
+{
+ struct test t[] = {
+ { "123456789", 123456789, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "111010110111100110100010101",123456789, 2, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "22121022020212200", 123456789, 3, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "13112330310111", 123456789, 4, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "223101104124", 123456789, 5, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "20130035113", 123456789, 6, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "3026236221", 123456789, 7, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "726746425", 123456789, 8, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "277266780", 123456789, 9, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "123456789", 123456789, 10, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "63762A05", 123456789, 11, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "35418A99", 123456789, 12, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "1C767471", 123456789, 13, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "12579781", 123456789, 14, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "AC89BC9", 123456789, 15, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "75BCD15", 123456789, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "1234567", 342391, 8, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "01234567", 342391, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "0123456789", 123456789, 10, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "0x75bcd15", 123456789, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ };
+
+ intmax_t rv;
+ char *end;
+ int e;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ errno = 0;
+ rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);
+
+ if (errno != 0)
+ atf_tc_fail("strtoi(3) changed errno to %d ('%s')",
+ e, strerror(e));
+
+ check(&t[i], rv, end, e);
+ }
+}
+
+ATF_TC(strtoi_case);
+ATF_TC_HEAD(strtoi_case, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Case insensitivity with strtoi(3)");
+}
+
+ATF_TC_BODY(strtoi_case, tc)
+{
+ struct test t[] = {
+ { "abcd", 0xabcd, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { " dcba", 0xdcba, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "abcd dcba", 0xabcd, 16, " dcba",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP },
+ { "abc0x123", 0xabc0, 16, "x123",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP },
+ { "abcd\0x123", 0xabcd, 16, "\0x123",
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "ABCD", 0xabcd, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "aBcD", 0xabcd, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "0xABCD", 0xabcd, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "0xABCDX", 0xabcd, 16, "X",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP},
+ };
+
+ intmax_t rv;
+ char *end;
+ int e;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ errno = 0;
+ rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);
+
+ if (errno != 0)
+ atf_tc_fail("strtoi(3) changed errno to %d ('%s')",
+ e, strerror(e));
+
+ check(&t[i], rv, end, e);
+ }
+}
+
+ATF_TC(strtoi_range);
+ATF_TC_HEAD(strtoi_range, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "Test ERANGE from strtoi(3)");
+}
+
+ATF_TC_BODY(strtoi_range, tc)
+{
+ struct test t[] = {
+#if INTMAX_MAX == 0x7fffffffffffffff
+ { "1000000000000000000000", INTMAX_MAX, 8, NULL,
+ INTMAX_MIN, INTMAX_MAX, ERANGE },
+ { "9223372036854775808", INTMAX_MAX, 10, NULL,
+ INTMAX_MIN, INTMAX_MAX, ERANGE },
+ { "8000000000000000", INTMAX_MAX, 16, NULL,
+ INTMAX_MIN, INTMAX_MAX, ERANGE },
+#else
+#error extend this test to your platform!
+#endif
+ { "10", 1, 10, NULL,
+ -1, 1, ERANGE },
+ { "10", 11, 10, NULL,
+ 11, 20, ERANGE },
+ };
+
+ intmax_t rv;
+ char *end;
+ int e;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ errno = 0;
+ rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);
+
+ if (errno != 0)
+ atf_tc_fail("strtoi(3) changed errno to %d ('%s')",
+ e, strerror(e));
+
+ check(&t[i], rv, end, e);
+ }
+}
+
+ATF_TC(strtoi_signed);
+ATF_TC_HEAD(strtoi_signed, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "A basic test of strtoi(3)");
+}
+
+ATF_TC_BODY(strtoi_signed, tc)
+{
+ struct test t[] = {
+ { "1", 1, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { " 2", 2, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { " 3", 3, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { " -3", -3, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "--1", 0, 0, "--1",
+ INTMAX_MIN, INTMAX_MAX, ECANCELED },
+ { "+-2", 0, 0, "+-2",
+ INTMAX_MIN, INTMAX_MAX, ECANCELED },
+ { "++3", 0, 0, "++3",
+ INTMAX_MIN, INTMAX_MAX, ECANCELED },
+ { "+9", 9, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "+123", 123, 0, NULL,
+ INTMAX_MIN, INTMAX_MAX, 0 },
+ { "-1 3", -1, 0, " 3",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP },
+ { "-1.3", -1, 0, ".3",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP },
+ { "- 3", 0, 0, "- 3",
+ INTMAX_MIN, INTMAX_MAX, ECANCELED },
+ { "+33.", 33, 0, ".",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP },
+ { "30x0", 30, 0, "x0",
+ INTMAX_MIN, INTMAX_MAX, ENOTSUP },
+ };
+
+ intmax_t rv;
+ char *end;
+ int e;
+ size_t i;
+
+ for (i = 0; i < __arraycount(t); i++) {
+
+ errno = 0;
+ rv = strtoi(t[i].str, &end, t[i].base, t[i].lo, t[i].hi, &e);
+
+ if (errno != 0)
+ atf_tc_fail("strtoi(3) changed errno to %d ('%s')",
+ e, strerror(e));
+
+ check(&t[i], rv, end, e);
+ }
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, strtoi_base);
+ ATF_TP_ADD_TC(tp, strtoi_case);
+ ATF_TP_ADD_TC(tp, strtoi_range);
+ ATF_TP_ADD_TC(tp, strtoi_signed);
+
+ return atf_no_error();
+}
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
index 5a0c6d0..54e1907 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_strtol.c,v 1.5 2011/06/14 02:45:58 jruoho Exp $ */
+/* $NetBSD: t_strtol.c,v 1.6 2016/06/01 01:12:02 pgoyette Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_strtol.c,v 1.5 2011/06/14 02:45:58 jruoho Exp $");
+__RCSID("$NetBSD: t_strtol.c,v 1.6 2016/06/01 01:12:02 pgoyette Exp $");
#include <atf-c.h>
#include <errno.h>
@@ -59,7 +59,8 @@ check(struct test *t, long int li, long long int lli, char *end)
atf_tc_fail_nonfatal("strtoll(%s, NULL, %d) failed "
"(rv = %lld)", t->str, t->base, lli);
- if (t->end != NULL && strcmp(t->end, end) != 0)
+ if ((t->end != NULL && strcmp(t->end, end) != 0) ||
+ (t->end == NULL && *end != '\0'))
atf_tc_fail_nonfatal("invalid end pointer ('%s') from "
"strtol(%s, &end, %d)", end, t->str, t->base);
}
@@ -89,8 +90,8 @@ ATF_TC_BODY(strtol_base, tc)
{ "12579781", 123456789, 14, NULL },
{ "AC89BC9", 123456789, 15, NULL },
{ "75BCD15", 123456789, 16, NULL },
- { "123456789", 342391, 8, NULL },
- { "0123456789", 342391, 0, NULL },
+ { "1234567", 342391, 8, NULL },
+ { "01234567", 342391, 0, NULL },
{ "0123456789", 123456789, 10, NULL },
{ "0x75bcd15", 123456789, 0, NULL },
};
@@ -121,7 +122,7 @@ ATF_TC_BODY(strtol_case, tc)
{ "abcd", 0xabcd, 16, NULL },
{ " dcba", 0xdcba, 16, NULL },
{ "abcd dcba", 0xabcd, 16, " dcba" },
- { "abc0x123", 0xabc0, 16, NULL },
+ { "abc0x123", 0xabc0, 16, "x123" },
{ "abcd\0x123", 0xabcd, 16, "\0x123" },
{ "ABCD", 0xabcd, 16, NULL },
{ "aBcD", 0xabcd, 16, NULL },
OpenPOWER on IntegriCloud