From 5f8801236b0c57109e8ae8ba658b71fe44d74dea Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 10 Oct 2014 08:35:16 +0000 Subject: Only build/run hsearch_basic and hsearch_r_basic on NetBSD hdestroy1 is not present on FreeBSD Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/stdlib') diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c index 099b3e7..3c869c4 100644 --- a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c +++ b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c @@ -75,6 +75,7 @@ __RCSID("$NetBSD: t_hsearch.c,v 1.4 2014/07/20 20:17:21 christos Exp $"); #define REQUIRE_ERRNO(x) ATF_REQUIRE_MSG(x, "%s", strerror(errno)) +#if defined(__NetBSD__) ATF_TC(hsearch_basic); ATF_TC_HEAD(hsearch_basic, tc) { @@ -123,6 +124,7 @@ ATF_TC_BODY(hsearch_basic, tc) hdestroy1(free, NULL); } +#endif ATF_TC(hsearch_duplicate); ATF_TC_HEAD(hsearch_duplicate, tc) @@ -229,6 +231,7 @@ ATF_TC_BODY(hsearch_two, tc) hdestroy(); } +#if defined(__NetBSD__) ATF_TC(hsearch_r_basic); ATF_TC_HEAD(hsearch_r_basic, tc) { @@ -276,6 +279,7 @@ ATF_TC_BODY(hsearch_r_basic, tc) hdestroy1_r(&t, free, NULL); } +#endif ATF_TC(hsearch_r_duplicate); ATF_TC_HEAD(hsearch_r_duplicate, tc) @@ -385,12 +389,16 @@ ATF_TC_BODY(hsearch_r_two, tc) ATF_TP_ADD_TCS(tp) { +#if defined(__NetBSD__) ATF_TP_ADD_TC(tp, hsearch_basic); +#endif ATF_TP_ADD_TC(tp, hsearch_duplicate); ATF_TP_ADD_TC(tp, hsearch_nonexistent); ATF_TP_ADD_TC(tp, hsearch_two); +#if defined(__NetBSD__) ATF_TP_ADD_TC(tp, hsearch_r_basic); +#endif ATF_TP_ADD_TC(tp, hsearch_r_duplicate); ATF_TP_ADD_TC(tp, hsearch_r_nonexistent); ATF_TP_ADD_TC(tp, hsearch_r_two); -- cgit v1.1 From fd80e03aa02bfa9b05a962c7f6dcb30c38a1cee0 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 10 Oct 2014 08:57:55 +0000 Subject: Expect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic See bin/189805 for more details In collaboration with: pho Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/stdlib') diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c index 35d6874..3b0b885 100644 --- a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c +++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $"); #include #include #include +#if defined(__FreeBSD__) +#include +#endif extern char **environ; @@ -152,6 +155,15 @@ ATF_TC_BODY(setenv_basic, tc) ATF_CHECK_ERRNO(EINVAL, setenv(NULL, "val", 1) == -1); ATF_CHECK_ERRNO(EINVAL, setenv("", "val", 1) == -1); ATF_CHECK_ERRNO(EINVAL, setenv("v=r", "val", 1) == -1); +#if defined(__FreeBSD__) + /* + Both FreeBSD and OS/X does not validate the second + argument to setenv(3) + */ + atf_tc_expect_signal(SIGSEGV, "FreeBSD does not validate the second " + "argument to setenv(3); see bin/189805"); +#endif + ATF_CHECK_ERRNO(EINVAL, setenv("var", NULL, 1) == -1); ATF_CHECK(setenv("var", "=val", 1) == 0); -- cgit v1.1 From c60e1a8fc3c6e0e955c37437181901f57f1a3727 Mon Sep 17 00:00:00 2001 From: ngie Date: Sun, 12 Oct 2014 10:07:26 +0000 Subject: #include libutil.h for fparseln on FreeBSD Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/stdlib') diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c index 17258f5..f5ded27 100644 --- a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c +++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c @@ -36,6 +36,9 @@ #include #include #include +#if defined(__FreeBSD__) +#include +#endif #define SKIPWS(p) while (isspace((int)(*p))) p++ #define WS "\t\n " -- cgit v1.1 From 18628d06309cff733d706f08f4013615cc6bcc17 Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 13 Oct 2014 02:32:37 +0000 Subject: __isnanl is automatically picked according to data type in . There isn't a need for the explicit __isnanl test Sponsored by: EMC / Isilon Storage Division --- contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/stdlib') diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c index d7ebe1b..d11e6f0 100644 --- a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c +++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c @@ -221,7 +221,9 @@ ATF_TC_BODY(strtold_nan, tc) volatile long double ld = strtold(nan_string, &end); ATF_REQUIRE(isnan(ld) != 0); +#if !defined(__FreeBSD__) ATF_REQUIRE(__isnanl(ld) != 0); +#endif ATF_REQUIRE(strcmp(end, "y") == 0); # else atf_tc_skip("Requires long double support"); -- cgit v1.1