From d881b8eb8843bab6213c03d985c02dbbff945c39 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 9 Feb 2017 21:19:24 +0000 Subject: MFC r279154,r279397: r279154 (by jilles): nice(): Correct return value and [EPERM] error. PR: 189821 Obtained from: NetBSD Relnotes: yes r279397 (by jilles): nice(): Put back old return value, keeping [EPERM] error. Commit r279154 changed the API and ABI significantly, and {NZERO} is still wrong. Also, preserve errno on success instead of setting it to 0. PR: 189821 Relnotes: yes --- contrib/netbsd-tests/lib/libc/gen/t_nice.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'contrib/netbsd-tests/lib/libc/gen') diff --git a/contrib/netbsd-tests/lib/libc/gen/t_nice.c b/contrib/netbsd-tests/lib/libc/gen/t_nice.c index 10b8df7..7c6d232 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_nice.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_nice.c @@ -72,11 +72,6 @@ ATF_TC_BODY(nice_err, tc) { int i; -#ifdef __FreeBSD__ - atf_tc_expect_fail("nice(incr) with incr < 0 fails with unprivileged " - "users and sets errno == EPERM; see PR # 189821 for more details"); -#endif - /* * The call should fail with EPERM if the * supplied parameter is negative and the -- cgit v1.1 From 8864cde3495dbfd6b476c1b77a8bde035e1cf000 Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 10 Feb 2017 01:13:12 +0000 Subject: MFC r305358,r305449,r305451,r306367,r306397,r309474: This also contains a merge of ^/projects/netbsd-tests-update-12@r304035 . This change never hit ^/head because bin/cat's behavior was changed (on ^/head) to match NetBSD. PR: 210607 r305358: Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox r305449: Install h_db to unbreak some of the lib/libc/db testcases after r305358 r305451: Fix lib/libc/rpc test assumptions added in r305358 - Require root in the tcp/udp subtests (it's needed on FreeBSD when registering services). - Skip the tests if service registration fails. r306367 (by br): Allow up to 6 arguments only on MIPS. r306397 (by br): Use right piece of code for FreeBSD. r309474: Don't build :strvis_locale if VIS_NOLOCALE is undefined The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower in conditionally running the test instead of backporting the newer version of libc-vis --- .../netbsd-tests/lib/libc/gen/execve/t_execve.c | 5 ++- contrib/netbsd-tests/lib/libc/gen/isqemu.h | 28 +++++++++++++- .../lib/libc/gen/posix_spawn/t_spawn.c | 4 +- contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c | 29 +++++++++++++- contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c | 25 ++++++++++-- contrib/netbsd-tests/lib/libc/gen/t_nice.c | 2 +- contrib/netbsd-tests/lib/libc/gen/t_randomid.c | 22 +++++------ contrib/netbsd-tests/lib/libc/gen/t_siginfo.c | 25 +++++++++--- contrib/netbsd-tests/lib/libc/gen/t_sleep.c | 5 ++- contrib/netbsd-tests/lib/libc/gen/t_time.c | 13 ++++--- contrib/netbsd-tests/lib/libc/gen/t_vis.c | 45 +++++++++++++++++++++- 11 files changed, 165 insertions(+), 38 deletions(-) (limited to 'contrib/netbsd-tests/lib/libc/gen') diff --git a/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c b/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c index 32de6e7..d3752cd 100644 --- a/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c +++ b/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_execve.c,v 1.1 2014/04/29 06:29:02 uebayasi Exp $ */ +/* $NetBSD: t_execve.c,v 1.2 2015/09/12 15:21:33 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -47,7 +47,8 @@ ATF_TC_BODY(t_execve_null, tc) err = execve(NULL, NULL, NULL); ATF_REQUIRE(err == -1); - ATF_REQUIRE(errno == EFAULT); + ATF_REQUIRE_MSG(errno == EFAULT, + "wrong error returned %d instead of %d", errno, EFAULT); } ATF_TP_ADD_TCS(tp) diff --git a/contrib/netbsd-tests/lib/libc/gen/isqemu.h b/contrib/netbsd-tests/lib/libc/gen/isqemu.h index 7d73a22..c44ffda 100644 --- a/contrib/netbsd-tests/lib/libc/gen/isqemu.h +++ b/contrib/netbsd-tests/lib/libc/gen/isqemu.h @@ -1,4 +1,4 @@ -/* $NetBSD: isqemu.h,v 1.3 2013/04/14 12:46:29 martin Exp $ */ +/* $NetBSD: isqemu.h,v 1.4 2015/01/03 14:21:05 gson Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -34,12 +34,37 @@ #include #include #include +#include #include #include #include static __inline bool isQEMU(void) { +#ifdef __FreeBSD__ + char *vm_guest_name_buf; + size_t len; + bool is_vm; + + if (sysctlbyname("kern.vm_guest", NULL, &len, NULL, 0) == -1) + err(EXIT_FAILURE, "sysctl"); + + if ((vm_guest_name_buf = malloc(len)) == NULL) + err(EXIT_FAILURE, "malloc"); + + if (sysctlbyname("kern.vm_guest", vm_guest_name_buf, &len, NULL, 0) + == -1) + err(EXIT_FAILURE, "sysctl"); + + if (strcmp(vm_guest_name_buf, "none") == 0) + is_vm = false; + else + is_vm = true; + + free(vm_guest_name_buf); + + return is_vm; +#else #if defined(__i386__) || defined(__x86_64__) char name[1024]; size_t len = sizeof(name); @@ -53,6 +78,7 @@ isQEMU(void) { #else return false; #endif +#endif } #ifdef TEST diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c index 178374b..12f2760 100644 --- a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c +++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_spawn.c,v 1.1 2012/02/13 21:03:08 martin Exp $ */ +/* $NetBSD: t_spawn.c,v 1.2 2014/10/18 08:33:30 snj Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -137,7 +137,7 @@ ATF_TC(t_spawn_child); ATF_TC_HEAD(t_spawn_child, tc) { atf_tc_set_md_var(tc, "descr", - "posix_spawn a child and get it's return code"); + "posix_spawn a child and get its return code"); } ATF_TC_BODY(t_spawn_child, tc) diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c b/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c index f90d8cf..c0064c3 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_fnmatch.c,v 1.3 2012/04/08 09:58:59 jruoho Exp $ */ +/* $NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fnmatch.c,v 1.3 2012/04/08 09:58:59 jruoho Exp $"); +__RCSID("$NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $"); #include #include @@ -153,6 +153,30 @@ ATF_TC_BODY(fnmatch_period, tc) ATF_CHECK(fnmatch("x/*y", "x/.y", FNM_PATHNAME | FNM_PERIOD) != 0); } +ATF_TC(fnmatch_initialbracket); +ATF_TC_HEAD(fnmatch_initialbracket, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test fnmatch with initial ["); +} + +ATF_TC_BODY(fnmatch_initialbracket, tc) +{ + ATF_CHECK(fnmatch("[[?*\\\\]", "\\", 0) == 0); + ATF_CHECK(fnmatch("[]?*\\\\]", "]", 0) == 0); + ATF_CHECK(fnmatch("[!]a-]", "b", 0) == 0); + ATF_CHECK(fnmatch("[]-_]", "^", 0) == 0); /* range: ']', '^', '_' */ + ATF_CHECK(fnmatch("[!]-_]", "X", 0) == 0); + ATF_CHECK(fnmatch("[a-z]/[a-z]", "a/b", 0) == 0); + ATF_CHECK(fnmatch("[*]/b", "*/b", 0) == 0); + ATF_CHECK(fnmatch("[?]/b", "?/b", 0) == 0); + ATF_CHECK(fnmatch("[[a]/b", "a/b", 0) == 0); + ATF_CHECK(fnmatch("[[a]/b", "[/b", 0) == 0); + ATF_CHECK(fnmatch("[/b", "[/b", 0) == 0); + + ATF_CHECK(fnmatch("[*]/b", "a/b", 0) != 0); + ATF_CHECK(fnmatch("[?]/b", "a/b", 0) != 0); +} + ATF_TP_ADD_TCS(tp) { @@ -162,6 +186,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fnmatch_noescape); ATF_TP_ADD_TC(tp, fnmatch_pathname); ATF_TP_ADD_TC(tp, fnmatch_period); + ATF_TP_ADD_TC(tp, fnmatch_initialbracket); return atf_no_error(); } diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c b/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c index 3366c1f..5edc583 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_fpsetmask.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_fpsetmask.c,v 1.16 2016/03/12 11:55:14 martin Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -58,8 +58,20 @@ ATF_TC_BODY(no_test, tc) #include -const char *skip_mesg; -const char *skip_arch; +#if __arm__ && !__SOFTFP__ + /* + * Some NEON fpus do not implement IEEE exception handling, + * skip these tests if running on them and compiled for + * hard float. + */ +#define FPU_PREREQ() \ + if (0 == fpsetmask(fpsetmask(FP_X_INV))) \ + atf_tc_skip("FPU does not implement exception handling"); +#endif + +#ifndef FPU_PREREQ +#define FPU_PREREQ() /* nothing */ +#endif void sigfpe(int, siginfo_t *, void *); @@ -296,6 +308,9 @@ sigfpe(int s, siginfo_t *si, void *c) \ ATF_TC_BODY(m##_##t, tc) \ { \ + \ + FPU_PREREQ(); \ + \ if (strcmp(MACHINE, "macppc") == 0) \ atf_tc_expect_fail("PR port-macppc/46319"); \ \ @@ -323,11 +338,13 @@ ATF_TC_BODY(fpsetmask_basic, tc) size_t i; fp_except_t msk, lst[] = { FP_X_INV, FP_X_DZ, FP_X_OFL, FP_X_UFL }; + FPU_PREREQ(); + msk = fpgetmask(); for (i = 0; i < __arraycount(lst); i++) { fpsetmask(msk | lst[i]); ATF_CHECK((fpgetmask() & lst[i]) != 0); - fpsetmask(msk & lst[i]); + fpsetmask(msk & ~lst[i]); ATF_CHECK((fpgetmask() & lst[i]) == 0); } diff --git a/contrib/netbsd-tests/lib/libc/gen/t_nice.c b/contrib/netbsd-tests/lib/libc/gen/t_nice.c index 7c6d232..9a0eac7 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_nice.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_nice.c @@ -125,7 +125,7 @@ ATF_TC_BODY(nice_priority, tc) if (pid == 0) { errno = 0; -#ifdef __FreeBSD__ +#ifdef __NetBSD__ pri = getpriority(PRIO_PROCESS, 0); #else pri2 = getpriority(PRIO_PROCESS, 0); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_randomid.c b/contrib/netbsd-tests/lib/libc/gen/t_randomid.c index 8377806..9ab2cca 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_randomid.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_randomid.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_randomid.c,v 1.3 2011/07/07 09:49:59 jruoho Exp $ */ +/* $NetBSD: t_randomid.c,v 1.5 2015/03/07 09:59:15 isaki Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #define PERIOD 30000 -uint64_t last[65536]; +uint32_t last[65536]; ATF_TC(randomid_basic); ATF_TC_HEAD(randomid_basic, tc) @@ -50,30 +50,30 @@ ATF_TC_HEAD(randomid_basic, tc) ATF_TC_BODY(randomid_basic, tc) { static randomid_t ctx = NULL; - uint64_t lowest, n, diff; + uint32_t lowest, n, diff; uint16_t id; memset(last, 0, sizeof(last)); ctx = randomid_new(16, (long)3600); - lowest = UINT64_MAX; + lowest = UINT32_MAX; - for (n = 0; n < 1000000; n++) { + for (n = 0; n < 100000; n++) { id = randomid(ctx); if (last[id] > 0) { diff = n - last[id]; if (diff <= lowest) { - if (lowest != UINT64_MAX) - printf("id %5d: last call at %9"PRIu64 - ", current call %9"PRIu64 - " (diff %5"PRIu64"), " - "lowest %"PRIu64"\n", + if (lowest != UINT32_MAX) + printf("id %5d: last call at %9"PRIu32 + ", current call %9"PRIu32 + " (diff %5"PRIu32"), " + "lowest %"PRIu32"\n", id, last[id], n, diff, lowest); ATF_REQUIRE_MSG(diff >= PERIOD, - "diff (%"PRIu64") less than minimum " + "diff (%"PRIu32") less than minimum " "period (%d)", diff, PERIOD); lowest = diff; diff --git a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c index 9c9a3c7..64f72ac 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_siginfo.c,v 1.24 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_siginfo.c,v 1.30 2015/12/22 14:25:58 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -46,8 +46,9 @@ #include #include -#ifdef HAVE_FENV #include +#ifdef __HAVE_FENV +#include /* only need for ARM Cortex/Neon hack */ #elif defined(_FLOAT_IEEE754) #include #endif @@ -316,13 +317,21 @@ ATF_TC_BODY(sigfpe_flt, tc) atf_tc_skip("Test does not run correctly under QEMU"); #if defined(__powerpc__) atf_tc_skip("Test not valid on powerpc"); +#elif defined(__arm__) && !__SOFTFP__ + /* + * Some NEON fpus do not implement IEEE exception handling, + * skip these tests if running on them and compiled for + * hard float. + */ + if (0 == fpsetmask(fpsetmask(FP_X_INV))) + atf_tc_skip("FPU does not implement exception handling"); #endif if (sigsetjmp(sigfpe_flt_env, 0) == 0) { sa.sa_flags = SA_SIGINFO; sa.sa_sigaction = sigfpe_flt_action; sigemptyset(&sa.sa_mask); sigaction(SIGFPE, &sa, NULL); -#ifdef HAVE_FENV +#ifdef __HAVE_FENV feenableexcept(FE_ALL_EXCEPT); #elif defined(_FLOAT_IEEE754) fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP); @@ -373,7 +382,7 @@ ATF_TC_BODY(sigfpe_int, tc) sa.sa_sigaction = sigfpe_int_action; sigemptyset(&sa.sa_mask); sigaction(SIGFPE, &sa, NULL); -#ifdef HAVE_FENV +#ifdef __HAVE_FENV feenableexcept(FE_ALL_EXCEPT); #elif defined(_FLOAT_IEEE754) fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP); @@ -454,15 +463,19 @@ ATF_TC_BODY(sigbus_adraln, tc) { struct sigaction sa; -#if defined(__alpha__) +#if defined(__alpha__) || defined(__arm__) int rv, val; size_t len = sizeof(val); rv = sysctlbyname("machdep.unaligned_sigbus", &val, &len, NULL, 0); ATF_REQUIRE(rv == 0); if (val == 0) - atf_tc_skip("SIGBUS signal not enabled for unaligned accesses"); + atf_tc_skip("No SIGBUS signal for unaligned accesses"); #endif + /* m68k (except sun2) never issue SIGBUS (PR lib/49653) */ + if (strcmp(MACHINE_ARCH, "m68k") == 0) + atf_tc_skip("No SIGBUS signal for unaligned accesses"); + sa.sa_flags = SA_SIGINFO; sa.sa_sigaction = sigbus_action; sigemptyset(&sa.sa_mask); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c index f722ec9..e89df69 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_sleep.c,v 1.8 2014/07/15 14:56:34 gson Exp $ */ +/* $NetBSD: t_sleep.c,v 1.9 2016/08/11 21:34:11 kre Exp $ */ /*- * Copyright (c) 2006 Frank Kardel @@ -180,7 +180,8 @@ do_kevent(struct timespec *delay, struct timespec *remain) (void)close(kq); if (rtc == -1) { - ATF_REQUIRE_MSG(kerrno == EINTR, "kevent: %s", strerror(errno)); + ATF_REQUIRE_MSG(kerrno == EINTR, "kevent: %s", + strerror(kerrno)); return 0; } diff --git a/contrib/netbsd-tests/lib/libc/gen/t_time.c b/contrib/netbsd-tests/lib/libc/gen/t_time.c index 790f3ca..2905403 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_time.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $ */ +/* $NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_time.c,v 1.2 2011/11/11 05:03:38 jruoho Exp $"); +__RCSID("$NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $"); #ifdef __FreeBSD__ #include @@ -94,15 +94,16 @@ ATF_TC_HEAD(time_timeofday, tc) ATF_TC_BODY(time_timeofday, tc) { struct timeval tv = { 0, 0 }; - time_t t; + time_t t1, t2; - t = time(NULL); + t1 = time(NULL); ATF_REQUIRE(gettimeofday(&tv, NULL) == 0); + t2 = time(NULL); (void)fprintf(stderr, "%"PRId64" vs. %"PRId64"\n", - (int64_t)t, (int64_t)tv.tv_sec); + (int64_t)t1, (int64_t)tv.tv_sec); - if (t != tv.tv_sec) + if (t1 > tv.tv_sec || t2 < tv.tv_sec) atf_tc_fail("time(3) and gettimeofday(2) differ"); } diff --git a/contrib/netbsd-tests/lib/libc/gen/t_vis.c b/contrib/netbsd-tests/lib/libc/gen/t_vis.c index 525bafa..76f85f4 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_vis.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_vis.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.7 2014/09/08 19:01:03 christos Exp $ */ +/* $NetBSD: t_vis.c,v 1.8 2015/05/23 14:02:11 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -143,6 +144,41 @@ ATF_TC_BODY(strunvis_hex, tc) } } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ +ATF_TC(strvis_locale); +ATF_TC_HEAD(strvis_locale, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test strvis(3) with locale"); +} + +ATF_TC_BODY(strvis_locale, tc) +{ + char s[256], cd[sizeof(s) * 4 + 1], jd[sizeof(cd)], *ol; + int jr, cr; + + for (size_t i = 0; i < sizeof(s) - 1; i++) + s[i] = i + 1; + s[sizeof(s) - 1] = '\0'; + + ol = setlocale(LC_CTYPE, "ja_JP.UTF-8"); + ATF_REQUIRE(ol != NULL); + jr = strvisx(jd, s, sizeof(s), VIS_WHITE | VIS_NOLOCALE); + ATF_REQUIRE(jr != -1); + ol = strdup(ol); + ATF_REQUIRE(ol != NULL); + ATF_REQUIRE(setlocale(LC_CTYPE, "C") != NULL); + cr = strvisx(cd, s, sizeof(s), VIS_WHITE); + ATF_REQUIRE(jr == cr); + ATF_REQUIRE(memcmp(jd, cd, jr) == 0); + setlocale(LC_CTYPE, ol); + free(ol); +} +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ + ATF_TP_ADD_TCS(tp) { @@ -150,6 +186,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ + ATF_TP_ADD_TC(tp, strvis_locale); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ return atf_no_error(); } -- cgit v1.1 From 42fc329cd639624c6bacdaa83c4e8f48501e401d Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 10 Feb 2017 03:28:03 +0000 Subject: MFC r311229,r311244: r311229: humanize_number_basic: don't leak buf CID: 1251407 r311244: mmap_prot_3, mmap_truncate, mmap_truncate_signal: don't leak fd and map CID: 978306, 1251406, 1288196, 1300541 --- contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/gen') diff --git a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c index 5836c86..53055d2 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c @@ -247,6 +247,9 @@ ATF_TC_BODY(humanize_number_basic, tc) newline(); atf_tc_fail_nonfatal("Failed for table entry %d", i); } +#ifdef __FreeBSD__ + free(buf); +#endif } ATF_TC(humanize_number_big); -- cgit v1.1 From b39322d52d2dd66d37af0ffcbfb48d13896804ea Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 10 Feb 2017 07:13:16 +0000 Subject: MFC r311925,r311968,r311969,r312008: r311925: Import testcase updates with code contributed back to NetBSD This also (inadvertently) contains an update to contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases). In collaboration with: christos@NetBSD.org r311968: Fix lib/libc/sys/access_test after r311925 sys/param.h needs to be #included in order for __FreeBSD_version to be checked r311969: Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile This is to enable support in other testcases Inspired by lib/msun/tests/Makefile . r312008: Upgrade NetBSD tests to 01.11.2017_23.20 snapshot This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386 --- .../lib/libc/gen/posix_spawn/t_fileactions.c | 10 ++-- contrib/netbsd-tests/lib/libc/gen/t_assert.c | 17 ++----- contrib/netbsd-tests/lib/libc/gen/t_dir.c | 56 ++++++++++------------ contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c | 5 +- contrib/netbsd-tests/lib/libc/gen/t_ftok.c | 6 +-- .../netbsd-tests/lib/libc/gen/t_humanize_number.c | 4 +- contrib/netbsd-tests/lib/libc/gen/t_sleep.c | 20 ++++---- contrib/netbsd-tests/lib/libc/gen/t_time.c | 8 ++-- contrib/netbsd-tests/lib/libc/gen/t_ttyname.c | 6 +-- contrib/netbsd-tests/lib/libc/gen/t_vis.c | 10 +--- 10 files changed, 56 insertions(+), 86 deletions(-) (limited to 'contrib/netbsd-tests/lib/libc/gen') diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c index 5bbf337..74009a8 100644 --- a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c +++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */ +/* $NetBSD: t_fileactions.c,v 1.6 2017/01/10 22:36:29 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,10 +31,11 @@ */ -#ifdef __FreeBSD__ -#include -#endif #include + +#include +#include + #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include ATF_TC(t_spawn_openmode); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_assert.c b/contrib/netbsd-tests/lib/libc/gen/t_assert.c index a09c130..ce73015 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_assert.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_assert.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $ */ +/* $NetBSD: t_assert.c,v 1.3 2017/01/10 15:17:57 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,8 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $"); +__RCSID("$NetBSD: t_assert.c,v 1.3 2017/01/10 15:17:57 christos Exp $"); +#include +#include +#include #include #include @@ -40,11 +43,6 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/06/14 05:28:00 jruoho Exp $"); #include #include -#ifdef __FreeBSD__ -#include -#include -#include - static void disable_corefile(void) { @@ -55,7 +53,6 @@ disable_corefile(void) ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0); } -#endif static void handler(int); @@ -82,9 +79,7 @@ ATF_TC_BODY(assert_false, tc) if (pid == 0) { -#ifdef __FreeBSD__ disable_corefile(); -#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); @@ -122,9 +117,7 @@ ATF_TC_BODY(assert_true, tc) if (pid == 0) { -#ifdef __FreeBSD__ disable_corefile(); -#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_dir.c b/contrib/netbsd-tests/lib/libc/gen/t_dir.c index b37d89d..40de116 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_dir.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_dir.c,v 1.6 2013/10/19 17:45:00 christos Exp $ */ +/* $NetBSD: t_dir.c,v 1.10 2017/01/11 18:15:02 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -26,22 +26,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include - +#include #include +#include #include #include +#include #include #include #include #include #include -#include -#ifdef __FreeBSD__ -#include -#endif ATF_TC(seekdir_basic); ATF_TC_HEAD(seekdir_basic, tc) @@ -58,7 +55,6 @@ ATF_TC_BODY(seekdir_basic, tc) struct dirent *entry; long here; -#ifdef __FreeBSD__ #define CREAT(x, m) do { \ int _creat_fd; \ ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1, \ @@ -72,12 +68,6 @@ ATF_TC_BODY(seekdir_basic, tc) CREAT("t/a", 0600); CREAT("t/b", 0600); CREAT("t/c", 0600); -#else - mkdir("t", 0755); - creat("t/a", 0600); - creat("t/b", 0600); - creat("t/c", 0600); -#endif dp = opendir("t"); if ( dp == NULL) @@ -85,35 +75,40 @@ ATF_TC_BODY(seekdir_basic, tc) /* skip two for . and .. */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + ".", strerror(errno)); + entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "..", strerror(errno)); /* get first entry */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "first", strerror(errno)); + here = telldir(dp); -#ifdef __FreeBSD__ - ATF_REQUIRE_MSG(here != -1, - "telldir failed: %s", strerror(errno)); -#endif + ATF_REQUIRE_MSG(here != -1, "telldir failed: %s", strerror(errno)); /* get second entry */ entry = readdir(dp); -#ifdef __FreeBSD__ - ATF_REQUIRE_MSG(entry != NULL, - "readdir failed: %s", strerror(errno)); -#endif + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "second", strerror(errno)); + wasname = strdup(entry->d_name); if (wasname == NULL) atf_tc_fail("cannot allocate memory"); /* get third entry */ entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "third", strerror(errno)); /* try to return to the position after the first entry */ seekdir(dp, here); entry = readdir(dp); - - if (entry == NULL) - atf_tc_fail("entry 1 not found"); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "first[1]", strerror(errno)); if (strcmp(entry->d_name, wasname) != 0) atf_tc_fail("1st seekdir found wrong name"); @@ -121,25 +116,22 @@ ATF_TC_BODY(seekdir_basic, tc) seekdir(dp, here); here = telldir(dp); entry = readdir(dp); - - if (entry == NULL) - atf_tc_fail("entry 2 not found"); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "second[1]", strerror(errno)); if (strcmp(entry->d_name, wasname) != 0) atf_tc_fail("2nd seekdir found wrong name"); /* One more time, to make sure that telldir() doesn't affect result */ seekdir(dp, here); entry = readdir(dp); + ATF_REQUIRE_MSG(entry != NULL, "readdir[%s] failed: %s", + "third[1]", strerror(errno)); - if (entry == NULL) - atf_tc_fail("entry 3 not found"); if (strcmp(entry->d_name, wasname) != 0) atf_tc_fail("3rd seekdir found wrong name"); closedir(dp); -#ifdef __FreeBSD__ free(wasname); -#endif } ATF_TC(telldir_leak); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c b/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c index c0064c3..69ee8d2 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $ */ +/* $NetBSD: t_fnmatch.c,v 1.7 2016/10/31 05:08:53 dholland Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_fnmatch.c,v 1.6 2014/10/12 22:33:41 christos Exp $"); +__RCSID("$NetBSD: t_fnmatch.c,v 1.7 2016/10/31 05:08:53 dholland Exp $"); #include #include @@ -166,6 +166,7 @@ ATF_TC_BODY(fnmatch_initialbracket, tc) ATF_CHECK(fnmatch("[!]a-]", "b", 0) == 0); ATF_CHECK(fnmatch("[]-_]", "^", 0) == 0); /* range: ']', '^', '_' */ ATF_CHECK(fnmatch("[!]-_]", "X", 0) == 0); + ATF_CHECK(fnmatch("[A-\\\\]", "[", 0) == 0); ATF_CHECK(fnmatch("[a-z]/[a-z]", "a/b", 0) == 0); ATF_CHECK(fnmatch("[*]/b", "*/b", 0) == 0); ATF_CHECK(fnmatch("[?]/b", "?/b", 0) == 0); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c index 718d310..4c1ab18 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_ftok.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_ftok.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $ */ +/* $NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ftok.c,v 1.1 2011/11/08 05:47:00 jruoho Exp $"); +__RCSID("$NetBSD: t_ftok.c,v 1.2 2017/01/10 15:19:52 christos Exp $"); #include #include @@ -68,9 +68,7 @@ ATF_TC_BODY(ftok_link, tc) fd = open(path, O_RDONLY | O_CREAT); ATF_REQUIRE(fd >= 0); -#ifdef __FreeBSD__ (void)close(fd); -#endif ATF_REQUIRE(link(path, hlnk) == 0); ATF_REQUIRE(symlink(path, slnk) == 0); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c index 53055d2..17eac87 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_humanize_number.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_humanize_number.c,v 1.8 2012/03/18 07:14:08 jruoho Exp $ */ +/* $NetBSD: t_humanize_number.c,v 1.9 2017/01/10 15:20:44 christos Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. @@ -247,9 +247,7 @@ ATF_TC_BODY(humanize_number_basic, tc) newline(); atf_tc_fail_nonfatal("Failed for table entry %d", i); } -#ifdef __FreeBSD__ free(buf); -#endif } ATF_TC(humanize_number_big); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c index e89df69..5e36456 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_sleep.c,v 1.9 2016/08/11 21:34:11 kre Exp $ */ +/* $NetBSD: t_sleep.c,v 1.11 2017/01/10 15:43:59 maya Exp $ */ /*- * Copyright (c) 2006 Frank Kardel @@ -26,8 +26,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifdef __FreeBSD__ +#include +#endif +#include +#include +#include +#include /* for TIMESPEC_TO_TIMEVAL on FreeBSD */ + #include #include +#include #include #include #include @@ -35,10 +44,6 @@ #include #include -#include -#include -#include - #include "isqemu.h" #define BILLION 1000000000LL /* nano-seconds per second */ @@ -49,11 +54,6 @@ #define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */ #define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */ -#ifdef __FreeBSD__ -#include -#include -#endif - /* * Timer notes * diff --git a/contrib/netbsd-tests/lib/libc/gen/t_time.c b/contrib/netbsd-tests/lib/libc/gen/t_time.c index 2905403..15a8d58 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_time.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $ */ +/* $NetBSD: t_time.c,v 1.4 2017/01/10 15:32:46 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,11 +29,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $"); +__RCSID("$NetBSD: t_time.c,v 1.4 2017/01/10 15:32:46 christos Exp $"); -#ifdef __FreeBSD__ -#include -#endif #include #include #include @@ -41,6 +38,7 @@ __RCSID("$NetBSD: t_time.c,v 1.3 2014/10/31 12:22:38 justin Exp $"); #include #include #include +#include #include ATF_TC(time_copy); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c index 1c813fb..61121b8 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_ttyname.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $ */ +/* $NetBSD: t_ttyname.c,v 1.4 2017/01/10 15:33:40 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ttyname.c,v 1.3 2011/05/01 18:14:01 jruoho Exp $"); +__RCSID("$NetBSD: t_ttyname.c,v 1.4 2017/01/10 15:33:40 christos Exp $"); #include #include @@ -78,9 +78,7 @@ ATF_TC_BODY(ttyname_err, tc) ATF_REQUIRE(ttyname(fd) == NULL); ATF_REQUIRE(errno == ENOTTY); -#ifdef __FreeBSD__ (void)close(fd); -#endif } } diff --git a/contrib/netbsd-tests/lib/libc/gen/t_vis.c b/contrib/netbsd-tests/lib/libc/gen/t_vis.c index 76f85f4..adb0930 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_vis.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_vis.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.8 2015/05/23 14:02:11 christos Exp $ */ +/* $NetBSD: t_vis.c,v 1.9 2017/01/10 15:16:57 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -144,9 +144,7 @@ ATF_TC_BODY(strunvis_hex, tc) } } -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #ifdef VIS_NOLOCALE -/* End FreeBSD */ ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -175,9 +173,7 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #endif /* VIS_NOLOCALE */ -/* End FreeBSD */ ATF_TP_ADD_TCS(tp) { @@ -186,13 +182,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #ifdef VIS_NOLOCALE -/* End FreeBSD */ ATF_TP_ADD_TC(tp, strvis_locale); -/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ #endif /* VIS_NOLOCALE */ -/* End FreeBSD */ return atf_no_error(); } -- cgit v1.1 From be2fb88bb5cf67a97a0d817e190baf58891b2b67 Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 11 Feb 2017 07:35:27 +0000 Subject: MFC r312102,r312108: r312102: Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD r312108: Delete trailing whitespace and use __arraycount instead of nitems in contrib code --- contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c | 12 ++++++------ contrib/netbsd-tests/lib/libc/gen/t_sleep.c | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'contrib/netbsd-tests/lib/libc/gen') diff --git a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c index 78313cd..2085b9e 100644 --- a/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c +++ b/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawnattr.c @@ -60,16 +60,16 @@ get_different_scheduler(void) /* get current schedule policy */ scheduler = sched_getscheduler(0); - for (i = 0; i < nitems(schedulers); i++) { + for (i = 0; i < __arraycount(schedulers); i++) { if (schedulers[i] == scheduler) break; } - ATF_REQUIRE_MSG(i < nitems(schedulers), + ATF_REQUIRE_MSG(i < __arraycount(schedulers), "Unknown current scheduler %d", scheduler); - + /* new scheduler */ i++; - if (i >= nitems(schedulers)) + if (i >= __arraycount(schedulers)) i = 0; return schedulers[i]; } @@ -85,7 +85,7 @@ get_different_priority(int scheduler) sched_getparam(0, ¶m); priority = param.sched_priority; - + /* * Change numerical value of the priority, to ensure that it * was set for the spawned child. @@ -127,7 +127,7 @@ ATF_TC_BODY(t_spawnattr, tc) scheduler = get_different_scheduler(); priority = get_different_priority(scheduler); sp.sched_priority = priority; - + sigemptyset(&sig); sigaddset(&sig, SIGUSR1); diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c index 5e36456..e85867a 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c @@ -27,6 +27,7 @@ */ #ifdef __FreeBSD__ +/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */ #include #endif #include -- cgit v1.1 From 7a6ce43b47d0f1fe0d996bc88e833da9dae841b8 Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 14 Feb 2017 04:42:47 +0000 Subject: MFC r313377: Expect :floatunditf to fail on FreeBSD/i386 The precision error on FreeBSD/i386 doesn't match the expected output in long double form. --- contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'contrib/netbsd-tests/lib/libc/gen') diff --git a/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c b/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c index ef372f7..c3417bb 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c @@ -119,6 +119,11 @@ ATF_TC_BODY(floatunditf, tc) #else size_t i; +#if defined(__FreeBSD__) && defined(__i386__) + atf_tc_expect_fail("the floating point error on FreeBSD/i386 doesn't " + "match the expected floating point error on NetBSD"); +#endif + for (i = 0; i < __arraycount(testcases); ++i) ATF_CHECK_MSG( testcases[i].ld == (long double)testcases[i].u64, -- cgit v1.1