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/h_getopt.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c4
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c21
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c4
4 files changed, 22 insertions, 11 deletions
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
index ec2b9bb..d53d2d9 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt.c
@@ -35,6 +35,10 @@
#include <unistd.h>
#include <err.h>
#ifdef __FreeBSD__
+/*
+ * Needed to avoid libutil.h pollution in stdio.h, which causes grief with
+ * with hexdump(3) in lib/libc/db/h_hash.c
+ */
#include <libutil.h>
#endif
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 2293e2c..c7cd83e 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/h_getopt_long.c
@@ -37,6 +37,10 @@
#include <stdlib.h>
#include <unistd.h>
#ifdef __FreeBSD__
+/*
+ * Needed to avoid libutil.h pollution in stdio.h, which causes grief with
+ * with hexdump(3) in lib/libc/db/h_hash.c
+ */
#include <libutil.h>
#endif
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
index a0e77d3..5a13250 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_hsearch.c
@@ -75,7 +75,6 @@ __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))
-#ifdef __NetBSD__
ATF_TC(hsearch_basic);
ATF_TC_HEAD(hsearch_basic, tc)
{
@@ -122,9 +121,12 @@ ATF_TC_BODY(hsearch_basic, tc)
ATF_REQUIRE_EQ((intptr_t)ep->data, i);
}
+#ifdef __NetBSD__
hdestroy1(free, NULL);
-}
+#else
+ hdestroy();
#endif
+}
ATF_TC(hsearch_duplicate);
ATF_TC_HEAD(hsearch_duplicate, tc)
@@ -232,7 +234,6 @@ ATF_TC_BODY(hsearch_two, tc)
}
#if defined(__FreeBSD__) && 1100027 <= __FreeBSD_version
-#ifdef __NetBSD__
ATF_TC(hsearch_r_basic);
ATF_TC_HEAD(hsearch_r_basic, tc)
{
@@ -278,10 +279,15 @@ ATF_TC_BODY(hsearch_r_basic, tc)
ATF_REQUIRE_EQ((intptr_t)ep->data, i);
}
+#ifdef __NetBSD__
hdestroy1_r(&t, free, NULL);
+#else
+ hdestroy_r(&t);
+#endif
}
#endif
+#if defined(__FreeBSD__) && 1100027 <= __FreeBSD_version
ATF_TC(hsearch_r_duplicate);
ATF_TC_HEAD(hsearch_r_duplicate, tc)
{
@@ -332,6 +338,9 @@ ATF_TC_BODY(hsearch_r_nonexistent, tc)
REQUIRE_ERRNO(hcreate_r(16, &t));
+#ifdef __FreeBSD__
+ atf_tc_expect_fail("behavior doesn't match docs; see bug # 216872");
+#endif
e.key = __UNCONST("A");
ATF_REQUIRE(hsearch_r(e, FIND, &ep, &t) == 1);
ATF_REQUIRE_EQ(ep, NULL);
@@ -391,17 +400,13 @@ ATF_TC_BODY(hsearch_r_two, tc)
ATF_TP_ADD_TCS(tp)
{
-#ifdef __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(__FreeBSD__) && 1100027 <= __FreeBSD_version
-#ifdef __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);
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
index 06f2de0..4835e5d 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c
@@ -218,9 +218,7 @@ ATF_TC_BODY(strtold_nan, tc)
volatile long double ld = strtold(nan_string, &end);
ATF_REQUIRE(isnan(ld) != 0);
-#ifdef __FreeBSD__
- ATF_REQUIRE(strcmp(end, "y") == 0);
-#else
+#ifndef __FreeBSD__
ATF_REQUIRE(__isnanl(ld) != 0);
#endif
ATF_REQUIRE(strcmp(end, "y") == 0);
OpenPOWER on IntegriCloud