From nobody Wed Aug 07 16:08:38 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 4WfFTf4tZFz5SbTP; Wed, 07 Aug 2024 16:08:38 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WfFTf4MHsz3wnX; Wed, 7 Aug 2024 16:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723046918; 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=sKj44WiKAgthLZIuhnTnlZwU68FJXn7wnfhnCyaoxQs=; b=xQtpgCHsrE2Rv0TqtZa3bxPzQva98wG70Z1WsZJgWxWTwT0nkn3OYsNgx8pDkHJ9o74G2d b0mqk9FpPdbChuFow6zTydn9l2TO+4l8rvJdHFfOIGi7Zy7wkA2ThtYBq0YLg66l3MkEtB Q4XOKpUapfSUryIlmxmuUKdj+N8tf+//DR+EsOO+rXsHFVDZB7rxbLt5+uxiRNdsEAiKEP AH+iPZcFR3f4WaDWObmraNAViYahdvmgeOBf9cs0dKtnPXKPX03z6062zMbRcYJCY9kj0h h3UFkXqZbIwX4cRUqOqQIGlqnvd6lyyyRmc0039+uhWluOOnSbZJ1FDIZCHNdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723046918; a=rsa-sha256; cv=none; b=bWMgciedR/MGO0u8YJMV1LcgURsP7g9yK0efaKu29BkP+DtmdH1UoG9oy0rCeO5ryB9DwD PvP59wdMbvaZBJSHKrpmQfxas/LroNjsauL9G4VaNw2WD8jHMUcWCPLu4cxd4c4gJFx4di 7twq5xkP66w3wWZSESXnBW8v7ouB7bY24B29Tmw/yzf4YEy7o0Ee0LhPwHtxPF9Wuki0Gl JejBrCJb0gnRebw8bFJLY7Uq99G//+ZHh9xuEzOg9vkQJwqL6SD9rsld6QBjwGNeZorUqo Wudwqcfhu2WWIVIQt5KcMH8aq849Mdsjty2d9XGSRcPtVObFnxt7lZxKihYzLg== 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=1723046918; 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=sKj44WiKAgthLZIuhnTnlZwU68FJXn7wnfhnCyaoxQs=; b=A6/ETt7zqY7+qcWC79vbvTgjSqe5ZQs0shNmU53aWrmLezWm3RMv1y4hHdiYdka0SX1wpX qgXWPSXUUKMprCORjLJCPhDOWVduC4mT9Q2hp5UJgV0KGtO2ITmrpQ/0dHI8qDEQnOaF1J y3pkEaqjxISwQoJbM4H5pf10gvMWSzSrC7oaXg4rtpPfm4mvMNqeNQ1NLGnqDh3IsoysNh KO7RsdzOLqg/ql6CRmSHv7kRoUOhSvgaXGlySOUB5UB3pIjWqS+AZJH6ZJ9iIMACyeSi5H ASWi9ECmivWSLubtgSLaFtrfkT2vzTIdiGT2N08rH+s4qfFSto4lgq0Y4vvdlw== 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 4WfFTf3yNVzxRh; Wed, 7 Aug 2024 16:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 477G8chG075517; Wed, 7 Aug 2024 16:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 477G8ch5075514; Wed, 7 Aug 2024 16:08:38 GMT (envelope-from git) Date: Wed, 7 Aug 2024 16:08:38 GMT Message-Id: <202408071608.477G8ch5075514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5132e16e1fd9 - main - libc tests: Rename the quick_exit test file, fix style 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5132e16e1fd987d88798fc9dbb7a10ae3413e86f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5132e16e1fd987d88798fc9dbb7a10ae3413e86f commit 5132e16e1fd987d88798fc9dbb7a10ae3413e86f Author: Mark Johnston AuthorDate: 2024-07-29 14:37:47 +0000 Commit: Mark Johnston CommitDate: 2024-08-07 16:05:16 +0000 libc tests: Rename the quick_exit test file, fix style Call it libc_exit_test instead of exit_test because the NetBSD test suite already has a file with the latter name. This is in preparation for adding other exit()-related tests. MFC after: 2 weeks --- ObsoleteFiles.inc | 3 +++ lib/libc/tests/stdlib/Makefile | 2 +- .../stdlib/{quick_exit_test.c => libc_exit_test.c} | 18 +++++++++++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f6984b49711c..afd22301a39c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240729: rename quick_exit_test to libc_exit_test +OLD_FILES+=usr/tests/lib/libc/stdlib/quick_exit_test + # 20240729: retire ifaddr_byindex OLD_FILES+=usr/share/man/man9/ifaddr_byindex.9.gz diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile index cf1a204cfb4a..29cf895006d1 100644 --- a/lib/libc/tests/stdlib/Makefile +++ b/lib/libc/tests/stdlib/Makefile @@ -3,6 +3,7 @@ ATF_TESTS_C+= clearenv_test ATF_TESTS_C+= dynthr_test ATF_TESTS_C+= heapsort_test +ATF_TESTS_C+= libc_exit_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test .if ${COMPILER_TYPE} == "clang" @@ -11,7 +12,6 @@ ATF_TESTS_C+= qsort_b_test ATF_TESTS_C+= qsort_r_compat_test ATF_TESTS_C+= qsort_r_test ATF_TESTS_C+= qsort_s_test -ATF_TESTS_C+= quick_exit_test ATF_TESTS_C+= set_constraint_handler_s_test ATF_TESTS_C+= strfmon_test ATF_TESTS_C+= tsearch_test diff --git a/lib/libc/tests/stdlib/quick_exit_test.c b/lib/libc/tests/stdlib/libc_exit_test.c similarity index 83% rename from lib/libc/tests/stdlib/quick_exit_test.c rename to lib/libc/tests/stdlib/libc_exit_test.c index 9feed8a6fa63..c47d03d1d598 100644 --- a/lib/libc/tests/stdlib/quick_exit_test.c +++ b/lib/libc/tests/stdlib/libc_exit_test.c @@ -12,32 +12,36 @@ #include -static void func_a(void) +static void +func_a(void) { if (write(STDOUT_FILENO, "a", 1) != 1) _Exit(1); } -static void func_b(void) +static void +func_b(void) { if (write(STDOUT_FILENO, "b", 1) != 1) _Exit(1); } -static void func_c(void) +static void +func_c(void) { if (write(STDOUT_FILENO, "c", 1) != 1) _Exit(1); } -static void child(void) +static void +child(void) { - // this will be received by the parent + /* this will be received by the parent */ printf("hello, "); fflush(stdout); - // this won't, because quick_exit() does not flush + /* this won't, because quick_exit() does not flush */ printf("world"); - // these will be called in reverse order, producing "abc" + /* these will be called in reverse order, producing "abc" */ if (at_quick_exit(func_c) != 0 || at_quick_exit(func_b) != 0 || at_quick_exit(func_a) != 0)