From nobody Sun Mar 03 04:00:26 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 4TnSlt4SlFz5Br2c; Sun, 3 Mar 2024 04:00:26 +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 4TnSlt42Szz40Ny; Sun, 3 Mar 2024 04:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709438426; 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=9qGp3e38diG7MltYBwksaO1vdI7xtC7gVe7k+DYFlCc=; b=LvshGnW47Q4sBfaFY4xoz6Uc/KzXf2RP7YSXUBcq6TqPVDMUYDYM8U58suqIk6FETDDzO1 AXpNQH9PokXpV2L4y68d6/I53MQG8hxFQJf5lFpH1ueQcdPcfyMcQxofgcDjTiOU8Dmpv7 Hrvhuc7NjM8w4jwRWWmFhA7bs7NTw/yYIrpddb2evIZ2di7g2hu5E2Mt4E0AekEIjw84TY Uhjr4FdujzeHFFc6TSIZORcPUlW07IQMIwyS+xC0gc3o6HnztpnN4YP66zv3JpXjz66c4d GWXypYtzMdsNA2POBHyHrv2bW5ChlAu0pQeTiIOOFdxkV6Tm16DzGZvgk8cQYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709438426; a=rsa-sha256; cv=none; b=ByheXmnKz4G6hg+dRb0noAwnNZa/Hrcyk4KxcagaX5uSeHNGMmJWOmxcCyqZsPLZXuvDid 1Z6FDbFX7s/CQGEaW2erdAogQeaNVKDhl5+j2KlE3J2BOIF/Ez5/KUT9cidmBVhzHwo6+4 H2qRNxi9nQeNpnU52ft+DgBcR00UFwLIUIFrk6QJWZX8O2Ht0045pGSHsDlZc3UJSRoqjA 8lK74UnVxY5Dx6h3gsHerhK8FiT5ZN/9l3n+hdklPBl+j8hVytVAYDNWh/aSUVI7sTnQPJ xjCLR+FFR8TYsa3DNSpE3RUcHuajWyR9EebBlS06+1Hnrf9dHB3ryjnD9ivIAQ== 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=1709438426; 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=9qGp3e38diG7MltYBwksaO1vdI7xtC7gVe7k+DYFlCc=; b=mHlyvWlKE9VUnar/uK8MByxsxrYgORTTJc4cklF1LI8s1U29d0zkgD5y8KccmhPxEDNrQY ctMrScAGshsZwa9KnfbiVDGyVC6eP2OQ5sC/M4/n3+58Y9ekyMzgTzotoj9IhfItZb/woe e5WlrTiqvxgCJuh1NuWkC8ypqzdePtY+uVGtXnE41gPHL+cY1ptON5WAAgnH6SqB7RWBHG TsK6MFl/ktoZDSjIFpoaIAGEAK3Uz7ABB99+4Dm1b2bzooQsAh2Cy1zVa8FEi8K1bRzs// bUeb69C2onfgYLUDvB5yv0TU+l9OWCbGSP8Hf+4P5y8qUbedvNR+fFvCGp6Qiw== 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 4TnSlt3dq2zNSC; Sun, 3 Mar 2024 04:00:26 +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 42340Q5P077443; Sun, 3 Mar 2024 04:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42340Qb0077440; Sun, 3 Mar 2024 04:00:26 GMT (envelope-from git) Date: Sun, 3 Mar 2024 04:00:26 GMT Message-Id: <202403030400.42340Qb0077440@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: 13ca1f11d6ff - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 13ca1f11d6ff96a5a1363ff954091ab9e0407e1d Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=13ca1f11d6ff96a5a1363ff954091ab9e0407e1d commit 13ca1f11d6ff96a5a1363ff954091ab9e0407e1d Author: Konstantin Belousov AuthorDate: 2024-02-24 23:39:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-02 05:04:50 +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()); +}