From nobody Sun Feb 25 20:36:22 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 4TjbBG39dcz5C2M8; Sun, 25 Feb 2024 20:36:22 +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 4TjbBG2dpKz4QtL; Sun, 25 Feb 2024 20:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708893382; 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=y7ucEgSSV0feaI2ZWijGT5Kgxi0uVy2lbysBrKRu304=; b=GFck6Pmnt1Lt0CbCNXhcD9bCUYlAylcS/dr7fYCYkHnst9EpwkzJkqLXxLY2gwftuwZwIm lW2xyLvpPUMUaWkxo5XHbC8nkJoffXEQlzVOkSzK2nmlGC96y+DcSqYbRZgCCSSy8rP9Tz aS2J8RhYqluW0lMEe4N/iWwr1vXGgqlKdlbNzw4RMax4f/0DTnT7zQJzets/0KfzIM5UtS 8v0UPf3h5w5Dfb1jF2W2NI0zBWEUkoSmeMZ3NmxjJ+u1O4lvkARolBvcoXJxs7gD0zgH7b f9XDKj6esTUstpqs+Ag4AB41XXxzWXXdOWiLU9nXP32fQAYfrnHQP3gb2chcKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708893382; a=rsa-sha256; cv=none; b=WZlVPG7epL7PC2BcOz6axUVzN95z3aYnqNIarO1EHBmgMbEXZciLv2DvSSjLtr8HO++Yn/ 3UIjmhboNg9n+sYoJ2/JjrGEJwVM6/ByE5mFXaaJvvOri7jlwiDg19nAlVaUF0sqNXdqse pnhSpqTHg8RB3mYg+U5Mnl2tbw1FBnuxULC+SRxCMSOFoRHP7vpY3eDLQQ0QoOL9a4wgDD czCOBrMvRoXRLmS1NizkHlj1VEp+nqJ/JLH+Ug6ofBmhMMR/D6sPUEJAJbFhWbs+F7OluL 5a6Xv/YshJqfXbn9ceSFx9BLFbd8jOW9zxO+pthQLtHmkN+1sD3+B1vrHe4DjQ== 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=1708893382; 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=y7ucEgSSV0feaI2ZWijGT5Kgxi0uVy2lbysBrKRu304=; b=Gtkrzj3PS+tKQ7b216KWbhXMdBOJo3pqVuOFGY71VVIRmQiXzepnHlkyEg0JBOuBCXO4TA rl3QMdjPP3IR+pZDxdLal9U54PVLeN4rSpRyRA+SkgjZpBivmBkk8FY36DCf6/BXnhrLF3 9XDpqyKMI736CV0piaikqRzslRLts+12Ar0yXb5ayR0gErWdycOUqdRIw97m0eAkKKNETM kgXdLB1gEkIFFT7u+MEJHTCVb52R9zmCiU/a3oMJ8H565HcavEt/hnKteHuCv/9nG9E3kW tX8B+Jti5m1KxPDCSkS3WdXq1E+lCzuv2bTEOgQq82HPBN+FrOH/5dqfJQ+gSg== 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 4TjbBG1hCpzyhM; Sun, 25 Feb 2024 20:36:22 +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 41PKaMdv089047; Sun, 25 Feb 2024 20:36:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41PKaMwn089044; Sun, 25 Feb 2024 20:36:22 GMT (envelope-from git) Date: Sun, 25 Feb 2024 20:36:22 GMT Message-Id: <202402252036.41PKaMwn089044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 32fdcff8703d - main - 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/main X-Git-Reftype: branch X-Git-Commit: 32fdcff8703da6f2795193acc77ec3c1fb8b723d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=32fdcff8703da6f2795193acc77ec3c1fb8b723d commit 32fdcff8703da6f2795193acc77ec3c1fb8b723d Author: Konstantin Belousov AuthorDate: 2024-02-24 23:39:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-25 20:35:17 +0000 libc/sys: add errno test Despite looking trivial, it requires proper split of exports from libsys and libc, proper filtering work in rtld, and operational libsys. Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44075 --- 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()); +}