From nobody Sun Mar 03 04:00:01 2024 X-Original-To: dev-commits-src-all@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 4TnSlP2PHgz5Bqv8; Sun, 3 Mar 2024 04:00:01 +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 4TnSlP1wxvz40H8; Sun, 3 Mar 2024 04:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709438401; 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=Ongd1C/O9sdzgLyyMUFrWghEDqmzrV1GPnOKg2fWCdA=; b=ja4WifvWeD0hoTq10g6TlaQf+4ccidlJ7UKL8cBZkiJfQnFB7tGazkIA2Rkyrme5WI2tmR hzCVrLZw0ttPo+upID+/bApptLrz+4tesGGuRuzBZEFN23e7c/Bio6GRLIQFdLNQ7auXRP Z1B8LnbpuFBcugo3+j+Oz3Rze93LUtzE0cRpWyiT14CiG2dN2kOK+IdWRtOrTuox+XaPyc ujT+DVae3cpdoxjkHmulaOTkC8BDYoxNPhKzyZG5dWoOtjdwZIdn3YRlObkDHxx9UZ96vb 68rALBsL6DKgvvk9vPLG+UZEJWW9mgYvnmtKHyvgO4pv+ZKPSBgkaEWYZ3a4Dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709438401; a=rsa-sha256; cv=none; b=JWDglj7VsLHp8ZAFsJxM6yYvz0ryyyCYOvA9lS2Mah9/FwsvYt2Oz/Olgprx0NDSIEE15y skvai/bwpRFc3UEFqXvlPu1pMrrsZx2mwfEUbn5mcL6c1RAzxENbwLAgGoBO7bRrXnrElS CPS7gDBIbziPeiYWpmAdiym6pvExLdXx4wEAe70ZI0MApcXPHOm4i9pLnGRZebDr5tnY2T 8e2vSfU5CWpJuUlLo7H1avao9O160shZxhuXrKwmc4xBoBrBD54X0BpndJp9nHbdXLHefK D3JVtjamkerW5wpCLwZZtybbz+zCEC37X+x+y0HzOgEqiF9p3TgqgD28HZlwSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709438401; 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=Ongd1C/O9sdzgLyyMUFrWghEDqmzrV1GPnOKg2fWCdA=; b=WyySwaCU5KsFifBWFk07kLeWLTGdSuv+R5981h6LzLzwbbHawiVsJILydD5K36Gc+jZ/Ad m2KRP2Pk37pUXhW188QwsZPjpAY5qCDlWo+GOXKtEz4lJOwi2VOpRXVGPCuqC0VZiOiXLP xTls/T0YG3ohipWqCGxQfyROePuqNy573Y+bXgvuUJmdEiSjgIcK9Q+sLPucnIDmZB/5vA AreJnACNegX+BF4yJiLsEsUhl2AO5Fk+z/9SznVQWa40GA2ZO1uWiIO4U/n2FGxBbZEScw gA5czD2SAY7nHwjZQ4azBFKZ1CvgKxX2O+dreJ4O+pn521yvXOkpLQpUsrP8mA== 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 4TnSlP1XWhzNJr; Sun, 3 Mar 2024 04:00:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 423401dm069781; Sun, 3 Mar 2024 04:00:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 423401Nn069776; Sun, 3 Mar 2024 04:00:01 GMT (envelope-from git) Date: Sun, 3 Mar 2024 04:00:01 GMT Message-Id: <202403030400.423401Nn069776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8a7d5d73b849 - stable/14 - libc/sys: add errno test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8a7d5d73b8493d2921d3c8ae13746e481bd51d26 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8a7d5d73b8493d2921d3c8ae13746e481bd51d26 commit 8a7d5d73b8493d2921d3c8ae13746e481bd51d26 Author: Konstantin Belousov AuthorDate: 2024-02-24 23:39:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-02 05:05:05 +0000 libc/sys: add errno test (cherry picked from commit 32fdcff8703da6f2795193acc77ec3c1fb8b723d) --- lib/libc/tests/sys/Makefile | 1 + lib/libc/tests/sys/errno_test.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile index f44cec11225d..380b3b511049 100644 --- a/lib/libc/tests/sys/Makefile +++ b/lib/libc/tests/sys/Makefile @@ -7,6 +7,7 @@ PACKAGE= tests ATF_TESTS_C+= brk_test .endif ATF_TESTS_C+= cpuset_test +ATF_TESTS_C+= errno_test ATF_TESTS_C+= queue_test ATF_TESTS_C+= sendfile_test diff --git a/lib/libc/tests/sys/errno_test.c b/lib/libc/tests/sys/errno_test.c new file mode 100644 index 000000000000..27d0548fc29d --- /dev/null +++ b/lib/libc/tests/sys/errno_test.c @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2024 The FreeBSD Foundation + * + * SPDX-License-Identifier: BSD-2-Clause + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + */ + +#include +#include + +#include + +ATF_TC(errno_basic); +ATF_TC_HEAD(errno_basic, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify basic functionality of errno"); +} + +ATF_TC_BODY(errno_basic, tc) +{ + int res; + + res = unlink("/non/existent/file"); + ATF_REQUIRE(res == -1); + ATF_REQUIRE(errno == ENOENT); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, errno_basic); + + return (atf_no_error()); +}