diff options
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/regex')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/regex/debug.c | 7 | ||||
-rw-r--r-- | contrib/netbsd-tests/lib/libc/regex/t_exhaust.c | 24 | ||||
-rw-r--r-- | contrib/netbsd-tests/lib/libc/regex/t_regex_att.c | 23 |
3 files changed, 16 insertions, 38 deletions
diff --git a/contrib/netbsd-tests/lib/libc/regex/debug.c b/contrib/netbsd-tests/lib/libc/regex/debug.c index 22f0b90..18ab6ea 100644 --- a/contrib/netbsd-tests/lib/libc/regex/debug.c +++ b/contrib/netbsd-tests/lib/libc/regex/debug.c @@ -1,4 +1,4 @@ -/* $NetBSD: debug.c,v 1.2 2011/10/10 04:32:41 christos Exp $ */ +/* $NetBSD: debug.c,v 1.3 2017/01/14 00:50:56 christos Exp $ */ /*- * Copyright (c) 1993 The NetBSD Foundation, Inc. @@ -26,18 +26,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/types.h> #include <ctype.h> #include <limits.h> #include <regex.h> #include <stdio.h> #include <stdlib.h> #include <string.h> - -#include <sys/types.h> -#ifdef __FreeBSD__ #include <wchar.h> #include <wctype.h> -#endif /* Don't sort these! */ #include "utils.h" diff --git a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c index 0670e51..f9bd276 100644 --- a/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c +++ b/contrib/netbsd-tests/lib/libc/regex/t_exhaust.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $ */ +/* $NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -37,17 +37,15 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $"); +__RCSID("$NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $"); -#include <stdio.h> +#include <sys/resource.h> +#include <atf-c.h> +#include <err.h> #include <regex.h> -#include <string.h> +#include <stdio.h> #include <stdlib.h> -#include <err.h> -#include <atf-c.h> -#ifdef __FreeBSD__ -#include <sys/resource.h> -#endif +#include <string.h> #ifndef REGEX_MAXSIZE #define REGEX_MAXSIZE 9999 @@ -179,25 +177,17 @@ ATF_TC_HEAD(regcomp_too_big, tc) " crash, but return a proper error code"); // libtre needs it. atf_tc_set_md_var(tc, "timeout", "600"); -#ifdef __FreeBSD__ atf_tc_set_md_var(tc, "require.memory", "64M"); -#else - atf_tc_set_md_var(tc, "require.memory", "120M"); -#endif } ATF_TC_BODY(regcomp_too_big, tc) { regex_t re; -#ifdef __FreeBSD__ struct rlimit limit; -#endif int e; -#ifdef __FreeBSD__ limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024; ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1); -#endif for (size_t i = 0; i < __arraycount(tests); i++) { char *d = (*tests[i].pattern)(REGEX_MAXSIZE); e = regcomp(&re, d, tests[i].type); diff --git a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c index 0ca44b4..dd5b818 100644 --- a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c +++ b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $ */ +/* $NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -37,20 +37,18 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $"); +__RCSID("$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $"); #include <sys/param.h> -#include <stdio.h> +#include <atf-c.h> +#include <ctype.h> #include <regex.h> -#include <string.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> +#include <util.h> #include <vis.h> -#include <ctype.h> -#include <atf-c.h> -#ifdef __FreeBSD__ -#include <libutil.h> -#endif static const char sep[] = "\r\n\t"; static const char delim[3] = "\\\\\0"; @@ -377,11 +375,7 @@ checkmatches(const char *matches, size_t nm, const regmatch_t *pm, " cur=%d, max=%zu", res, l, len - off); off += l; } -#ifdef __FreeBSD__ ATF_CHECK_STREQ_MSG(res, matches, " at line %zu", lineno); -#else - ATF_REQUIRE_STREQ_MSG(res, matches, " at line %zu", lineno); -#endif free(res); } @@ -580,9 +574,6 @@ ATF_TC_BODY(leftassoc, tc) * any explation. Mark as broken here, but I don't know why. */ atf_tc_expect_fail("Reason for breakage unknown"); #endif -#ifdef __FreeBSD__ - atf_tc_expect_fail("The expected and matched groups are mismatched on FreeBSD"); -#endif att_test(tc, "leftassoc"); } |