Add a case for PR lib/41558. It is unclear whether this is a bug, but at

least it is documented now. Probably it would be better to follow Linux,
where the test case does not fail.
This commit is contained in:
jruoho 2012-03-18 08:52:07 +00:00
parent a6bc77fdcc
commit e626461e72
3 changed files with 70 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.446 2012/03/17 17:23:34 jruoho Exp $
# $NetBSD: mi,v 1.447 2012/03/18 08:52:07 jruoho Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -379,6 +379,7 @@
./usr/libdata/debug/usr/tests/lib/libc/gen/t_cpuset.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/t_dir.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/t_fmtcheck.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/t_fnmatch.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/t_fpclassify.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/t_fpsetmask.debug tests-lib-debug debug,atf
./usr/libdata/debug/usr/tests/lib/libc/gen/t_fpsetround.debug tests-lib-debug debug,atf
@ -2016,6 +2017,7 @@
./usr/tests/lib/libc/gen/t_cpuset tests-lib-tests atf
./usr/tests/lib/libc/gen/t_dir tests-lib-tests atf
./usr/tests/lib/libc/gen/t_fmtcheck tests-lib-tests atf
./usr/tests/lib/libc/gen/t_fnmatch tests-lib-tests atf
./usr/tests/lib/libc/gen/t_fpclassify tests-lib-tests atf
./usr/tests/lib/libc/gen/t_fpsetmask tests-lib-tests atf
./usr/tests/lib/libc/gen/t_fpsetround tests-lib-tests atf

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.35 2012/03/17 16:40:14 jruoho Exp $
# $NetBSD: Makefile,v 1.36 2012/03/18 08:52:07 jruoho Exp $
.include <bsd.own.mk>
@ -13,6 +13,7 @@ TESTS_C+= t_closefrom
TESTS_C+= t_cpuset
TESTS_C+= t_dir
TESTS_C+= t_fmtcheck
TESTS_C+= t_fnmatch
TESTS_C+= t_fpclassify
TESTS_C+= t_fpsetmask
TESTS_C+= t_fpsetround

View File

@ -0,0 +1,65 @@
/* $NetBSD: t_fnmatch.c,v 1.1 2012/03/18 08:52:07 jruoho Exp $ */
/*-
* Copyright (c) 2012 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.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_fnmatch.c,v 1.1 2012/03/18 08:52:07 jruoho Exp $");
#include <atf-c.h>
#include <fnmatch.h>
#include <stdio.h>
/*
* TODO: Test basic functionality of fnmatch(3) too.
*/
ATF_TC(fnmatch_backslashes);
ATF_TC_HEAD(fnmatch_backslashes, tc)
{
atf_tc_set_md_var(tc, "descr",
"Test translation of '\\' with fnmatch(3) (PR lib/41558)");
}
ATF_TC_BODY(fnmatch_backslashes, tc)
{
const int rv = fnmatch(/* pattern */ "\\", "\\", 0);
atf_tc_expect_fail("PR lib/41558");
if (rv != FNM_NOMATCH)
atf_tc_fail("fnmatch(3) did not translate '\\'");
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, fnmatch_backslashes);
return atf_no_error();
}