From owner-svn-src-head@FreeBSD.ORG Mon Oct 13 03:55:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F2F2B56; Mon, 13 Oct 2014 03:55:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6018E3D4; Mon, 13 Oct 2014 03:55:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9D3tmQ6075836; Mon, 13 Oct 2014 03:55:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9D3tmAi075834; Mon, 13 Oct 2014 03:55:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201410130355.s9D3tmAi075834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 13 Oct 2014 03:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273025 - head/contrib/netbsd-tests/lib/libc/time X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 03:55:48 -0000 Author: ngie Date: Mon Oct 13 03:55:47 2014 New Revision: 273025 URL: https://svnweb.freebsd.org/changeset/base/273025 Log: Change ATF_REQUIRE_MSG calls to ATF_CHECK_MSG to get as many errors as possible t_strptime:common.. - Expect the testcase body as a whole to fail. Multiple PRs will be filed to track the issues (there are 18 check failures) t_strptime:day.. - %EA and %OA seem to be case insensitive on FreeBSD Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Modified: head/contrib/netbsd-tests/lib/libc/time/t_strptime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Mon Oct 13 02:44:35 2014 (r273024) +++ head/contrib/netbsd-tests/lib/libc/time/t_strptime.c Mon Oct 13 03:55:47 2014 (r273025) @@ -49,6 +49,17 @@ h_pass(const char *buf, const char *fmt, exp = buf + len; ret = strptime(buf, fmt, &tm); +#if defined(__FreeBSD__) + ATF_CHECK_MSG(ret == exp, + "strptime(\"%s\", \"%s\", tm): incorrect return code: " + "expected: %p, got: %p", buf, fmt, exp, ret); + +#define H_REQUIRE_FIELD(field) \ + ATF_CHECK_MSG(tm.field == field, \ + "strptime(\"%s\", \"%s\", tm): incorrect %s: " \ + "expected: %d, but got: %d", buf, fmt, \ + ___STRING(field), field, tm.field) +#else ATF_REQUIRE_MSG(ret == exp, "strptime(\"%s\", \"%s\", tm): incorrect return code: " "expected: %p, got: %p", buf, fmt, exp, ret); @@ -58,6 +69,7 @@ h_pass(const char *buf, const char *fmt, "strptime(\"%s\", \"%s\", tm): incorrect %s: " \ "expected: %d, but got: %d", buf, fmt, \ ___STRING(field), field, tm.field) +#endif H_REQUIRE_FIELD(tm_sec); H_REQUIRE_FIELD(tm_min); @@ -76,8 +88,13 @@ h_fail(const char *buf, const char *fmt) { struct tm tm = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, NULL }; +#if defined(__FreeBSD__) + ATF_CHECK_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", " + "\"%s\", &tm) should fail, but it didn't", buf, fmt); +#else ATF_REQUIRE_MSG(strptime(buf, fmt, &tm) == NULL, "strptime(\"%s\", " "\"%s\", &tm) should fail, but it didn't", buf, fmt); +#endif } ATF_TC(common); @@ -91,6 +108,10 @@ ATF_TC_HEAD(common, tc) ATF_TC_BODY(common, tc) { +#if defined(__FreeBSD__) + atf_tc_expect_fail("There are various issues with strptime on FreeBSD"); +#endif + h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %T %Y", 24, 46, 27, 23, 20, 0, 98, 2, -1); h_pass("Tue Jan 20 23:27:46 1998", "%a %b %d %H:%M:%S %Y", @@ -168,9 +189,17 @@ ATF_TC_BODY(day, tc) h_pass("mon", "%a", 3, -1, -1, -1, -1, -1, -1, 1, -1); h_pass("tueSDay", "%A", 7, -1, -1, -1, -1, -1, -1, 2, -1); h_pass("sunday", "%A", 6, -1, -1, -1, -1, -1, -1, 0, -1); +#if defined(__NetBSD__) h_fail("sunday", "%EA"); +#else + h_pass("Sunday", "%EA", 6, -1, -1, -1, -1, -1, -1, 0, -1); +#endif h_pass("SaturDay", "%A", 8, -1, -1, -1, -1, -1, -1, 6, -1); +#if defined(__NetBSD__) h_fail("SaturDay", "%OA"); +#else + h_pass("SaturDay", "%OA", 8, -1, -1, -1, -1, -1, -1, 6, -1); +#endif } ATF_TC(month);