diff --git a/distrib/sets/lists/tests/mi b/distrib/sets/lists/tests/mi index a7e471808292..aeb2039eab53 100644 --- a/distrib/sets/lists/tests/mi +++ b/distrib/sets/lists/tests/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.167 2010/12/03 12:02:28 hannken Exp $ +# $NetBSD: mi,v 1.168 2010/12/03 13:11:50 njoly Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -328,6 +328,7 @@ ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_environment.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_environment_pth.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mi_vector_hash.debug tests-lib-debug debug,atf +./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_strtox.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libc/string tests-obsolete obsolete ./usr/libdata/debug/usr/tests/lib/libc/string/t_popcount.debug tests-obsolete obsolete ./usr/libdata/debug/usr/tests/lib/libdes tests-lib-debug @@ -1528,6 +1529,7 @@ ./usr/tests/lib/libc/stdlib/t_environment tests-lib-tests atf ./usr/tests/lib/libc/stdlib/t_environment_pth tests-lib-tests atf ./usr/tests/lib/libc/stdlib/t_mi_vector_hash tests-lib-tests atf +./usr/tests/lib/libc/stdlib/t_strtox tests-lib-tests atf ./usr/tests/lib/libc/stdio tests-lib-tests ./usr/tests/lib/libc/stdio/Atffile tests-lib-tests atf ./usr/tests/lib/libc/stdio/t_fmemopen tests-lib-tests atf diff --git a/tests/lib/libc/stdlib/Makefile b/tests/lib/libc/stdlib/Makefile index 4d7ed2f9707a..4238a38a2ed7 100644 --- a/tests/lib/libc/stdlib/Makefile +++ b/tests/lib/libc/stdlib/Makefile @@ -1,10 +1,11 @@ -# $NetBSD: Makefile,v 1.4 2010/11/16 14:03:47 tron Exp $ +# $NetBSD: Makefile,v 1.5 2010/12/03 13:11:50 njoly Exp $ .include TESTSDIR= ${TESTSBASE}/lib/libc/stdlib TESTS_C+= t_mi_vector_hash t_environment t_environment_pth +TESTS_C+= t_strtox LDADD.t_environment_pth= -pthread diff --git a/tests/lib/libc/stdlib/t_strtox.c b/tests/lib/libc/stdlib/t_strtox.c new file mode 100644 index 000000000000..538b22b003b2 --- /dev/null +++ b/tests/lib/libc/stdlib/t_strtox.c @@ -0,0 +1,64 @@ +/* $NetBSD: t_strtox.c,v 1.1 2010/12/03 13:11:50 njoly Exp $ */ +/*- + * Copyright (c) 2010 The NetBSD Foundation, Inc. + * All rights reserved. + * + * 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 COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDERS 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 +__RCSID("$NetBSD: t_strtox.c,v 1.1 2010/12/03 13:11:50 njoly Exp $"); + +#include +#include + +ATF_TC(hexadecimal); + +ATF_TC_HEAD(hexadecimal, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test strtod with hexdecimal numbers"); +} + +ATF_TC_BODY(hexadecimal, tc) +{ + const char *str; + char *end; + + str = "-0x0"; + ATF_REQUIRE(strtod(str, &end) == -0.0 && end == str+4); + + atf_tc_expect_fail("PR/44189"); + str = "-0x"; + ATF_REQUIRE(strtod(str, &end) == -0.0 && end == str+2); + atf_tc_expect_pass(); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, hexadecimal); + + return atf_no_error(); +}