From nobody Wed Jan 25 06:22:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1v0D1ckpz3bnnm; Wed, 25 Jan 2023 06:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1v0D15BFz3Dft; Wed, 25 Jan 2023 06:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674627772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hlutUL/1/rAR+6TqWdh9EysIEFRqyii68iKoIEvC3p4=; b=c9eKxP0QO7pyFrOCh6X+3E5i+StHbkhz+RKTSBGog1nB+PdQQuJSXt5K8o3Y5BpVxNtQUO AGSkOW74zvJyQ37bUBRB2x7IkG7g/JvZwEEN8rkHt0RebNjWMZXcUZZIUo/KOtJMQl/en6 RtMcY1LV1F04eiSVKlRxIp4eOG/Lwfh/jBZiuS/6bvhP7svv09gvxoLmNArCzisBKTNYcA NCc5TDZ6MV6+HsgRCOEmHWfGolahOQKtAjuXCGKEYFSg+FL3InbwDMM2zHB/SaVWEy9jKY bfpcUMNHggL124Pt79Lw7bZuPQneAOBY9+X/zkARJ+9c+luAzxYL/1MTkvN+OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674627772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hlutUL/1/rAR+6TqWdh9EysIEFRqyii68iKoIEvC3p4=; b=WHhXtM3cqh0f/tlzu6SVuKsfmbHvpJxpow1c3ZpmbuuG8e0h8gFW8mAF3PFdIgw434+7Vi qrCGZj8LuwiHcyUHAIPsS2jziVHfTSmPLjBEW4F8L6qOGSUoTYJTqKumiqsnSAQHrCdixG telQZ12DaKklmeuDMHCm7T1cONwih37jj8nDB1CRG0ij/ub37/kH+EUTrRbEcxaRnGdCaJ 05eEjvsJ7VNYtddEk1SgY7/n5iMPCs355DUHk+5pHUDqEXZN9vAuJ3NauLfROT/ZIbfGn6 Y1jV0OFndPVU13mb+hgtbI2KfuBVMp0LkIDJ5kgaUa/VVecu373tTZXVXKr37w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674627772; a=rsa-sha256; cv=none; b=A7DS0477CuPblHhqN3Sy7cOEwMaOi7iEEJo8b1mF5qcHh9kYJaujFiGu0AxgZEbWDy8sKD NLPlUC4ZTac0/S8PHq6/DCxvfRbMZ7e0bGm0J26v42RXZ5SFuKoPijLe+/o5mCRBw1ox/w 3o/dLe0RCRMyLNvD3dKsJ+Hf5pN0RnZSAmvJwoOd3qhlTXHqeQkywydsXyz6mCQ1Uj6Pyl kxLkCQWDjDwcvTVPNUFAc9tvl5kpDspMMB5NlZ0KjRow5vlyldQIlL2l+eytXOX2aMhBOu tdR7k7MhDPNWB20zRbVlEO71wZQC10qQ+hZd8aqPpuLFvyCMgBh+SOUNvaCABA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1v0D09zczfDJ; Wed, 25 Jan 2023 06:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30P6Mp8r095816; Wed, 25 Jan 2023 06:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30P6Mp6t095815; Wed, 25 Jan 2023 06:22:51 GMT (envelope-from git) Date: Wed, 25 Jan 2023 06:22:51 GMT Message-Id: <202301250622.30P6Mp6t095815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: d8c9f8089187 - main - libc: Update mktime(3) / timegm(3) tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8c9f80891872a54d0b21933136644d915096fe3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d8c9f80891872a54d0b21933136644d915096fe3 commit d8c9f80891872a54d0b21933136644d915096fe3 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-25 06:21:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-01-25 06:22:46 +0000 libc: Update mktime(3) / timegm(3) tests. Sponsored by: Klara, Inc. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D38177 --- contrib/netbsd-tests/lib/libc/time/t_mktime.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/time/t_mktime.c b/contrib/netbsd-tests/lib/libc/time/t_mktime.c index 1080b77eda80..63905b8bad54 100644 --- a/contrib/netbsd-tests/lib/libc/time/t_mktime.c +++ b/contrib/netbsd-tests/lib/libc/time/t_mktime.c @@ -1,4 +1,4 @@ -/* $NetBSD: t_mktime.c,v 1.5 2012/03/18 07:33:58 jruoho Exp $ */ +/* $NetBSD: t_mktime.c,v 1.6 2017/10/27 00:55:27 kre Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -64,18 +64,16 @@ ATF_TC_HEAD(mktime_negyear, tc) ATF_TC_BODY(mktime_negyear, tc) { -#ifdef __FreeBSD__ - atf_tc_expect_fail("needs work"); -#endif struct tm tms; time_t t; (void)memset(&tms, 0, sizeof(tms)); - tms.tm_year = ~0; + tms.tm_year = -1; + tms.tm_mday = 1; errno = 0; t = mktime(&tms); - ATF_REQUIRE_ERRNO(0, t != (time_t)-1); + ATF_REQUIRE(t != (time_t)-1); } ATF_TC(timegm_epoch); @@ -95,7 +93,7 @@ ATF_TC_BODY(timegm_epoch, tc) tms.tm_year = 1970 - 1900; tms.tm_mday = 1; t = timegm(&tms); - ATF_REQUIRE_ERRNO(0, t == (time_t)0); + ATF_REQUIRE(t == (time_t)0); /* one second after midnight on 1 Jan 1970 */ (void)memset(&tms, 0, sizeof(tms)); @@ -104,7 +102,7 @@ ATF_TC_BODY(timegm_epoch, tc) tms.tm_mday = 1; tms.tm_sec = 1; t = timegm(&tms); - ATF_REQUIRE_ERRNO(0, t == (time_t)1); + ATF_REQUIRE(t == (time_t)1); /* * 1969-12-31 23:59:59 = one second before the epoch. @@ -119,7 +117,8 @@ ATF_TC_BODY(timegm_epoch, tc) tms.tm_min = 59; tms.tm_sec = 59; t = timegm(&tms); - ATF_REQUIRE_ERRNO(0, t == (time_t)-1); + ATF_REQUIRE(t == (time_t)-1); + /* ATF_REQUIRE(errno == 0); does not work, errno is kept clear */ /* * Another way of getting one second before the epoch: @@ -131,7 +130,7 @@ ATF_TC_BODY(timegm_epoch, tc) tms.tm_mday = 1; tms.tm_sec = -1; t = timegm(&tms); - ATF_REQUIRE_ERRNO(0, t == (time_t)-1); + ATF_REQUIRE(t == (time_t)-1); /* * Two seconds before the epoch. @@ -142,7 +141,7 @@ ATF_TC_BODY(timegm_epoch, tc) tms.tm_mday = 1; tms.tm_sec = -2; t = timegm(&tms); - ATF_REQUIRE_ERRNO(0, t == (time_t)-2); + ATF_REQUIRE(t == (time_t)-2); }