From nobody Sun Nov 01 01:57:06 2026 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 4jHHyV6GzNz6vbbQ for ; Sun, 01 Nov 2026 01:57:06 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jHHyV43gXz4Mvc for ; Sun, 01 Nov 2026 01:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793498226; 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=oh/APPLX5ixz95zypcdpMUWYQNuT/AgxiL43y0SBIOU=; b=J3lavULjlNDdv9sLbaFjRzqA5gmtJzd7bNg4nz8SqnqrA5Y1Ix7szYgSRmo/yV15magt2k mzkq97I6S2nWNbqdJc6Gua8+MtQO7zkmcrL/nTTphH30Ba4JWF6pxS33kqkdav9L7diQfB wTDN4/cAMT+p4YF28ixDkb/5QHGmCOZzVAIUmeRBDx30Dhn9iKI1OhppWRqFfwr92P7+Ie GCAT0KUy+FdzyrTMORARa9k9Q2Qkv14XRzINiKDXLlgaXn2FTMU0j07235ySndVcctFl0t laczo56cRgJOffNwnVWNhNesZSpxOvR2vqruHulTRh3XJGL3CpHuySi4lEmtjw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793498226; b=ZXuejSs7Mvh7iN6omzqvv/kVql48GLJNz44YCVFCzAI63ceDysI/bM16KB5SJVHFu1YKJi QkAVLS6WcFH9qkVuW8TSLJKM0NLefkOtq4KJ6s1mRi9Gm6ojRvw998+lYzd9CFe0Qaqp6L RS9Sj4MAKa7pWqo7VuMfaMCdq6K+jPAbl/ICOOePpBGKT6WWgWOv7MevUY2bsXUQYzPiFY Dd6KRZEtWfRwaUslllSW1cqyLwXm9aBjBh+EFeQ7LyndGfVT8y13THgQBgbTtB5mLeqoiv Bp+YnWtScg5uIR2wple1gGnoxMwQrXKZVNoMM+fGLl2Hk7a1BXJazZlPoU9qbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793498226; 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=oh/APPLX5ixz95zypcdpMUWYQNuT/AgxiL43y0SBIOU=; b=RGvswUfZVT3K4mNuYHhq3gC986wKEBeopyxmdoyXulJ591Vs5TtIxOg7TBtfPLeN5vs2FS 11j+XquB1sYNDJA0V2icev1R3aVxZzze9hoS1exoY1/lHin7HEThjPsEhLlki+WSgZL1DT D8nZreZpHwW3svjMVeVBzt7YbGiFBsKnD0yq3/oHhokUxYQzScWoihpvvnveXXy61CNfeS hfuvdq6ZQn9ha5w2oLPWcyjAkLxUiKVv2J8IqhcpkzAJrXuvlgq3irkWjPa4KTjRtNjQES /LvDYFAUddKWlAejAiTF+YshxuTw8mUIql/JG66nmUdUsTorpA5mtZI9pH32uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jHHyV3kL2zfJX for ; Sun, 01 Nov 2026 01:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27fa6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 01 Nov 2026 01:57:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Enji Cooper Subject: git: d728be0be153 - stable/14 - sbuf(3): clean up tests List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d728be0be153527074155f2998474fd427890b8b Auto-Submitted: auto-generated Date: Sun, 01 Nov 2026 01:57:06 +0000 Message-Id: <6ae69c72.27fa6.55725f71@gitrepo.freebsd.org> The branch stable/14 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=d728be0be153527074155f2998474fd427890b8b commit d728be0be153527074155f2998474fd427890b8b Author: Enji Cooper AuthorDate: 2026-10-18 18:24:20 +0000 Commit: Enji Cooper CommitDate: 2026-11-01 01:52:59 +0000 sbuf(3): clean up tests - Update the copyright dates and add "Joao Bonifacio" to the top of `sbuf_core_test.c`. - Use `SPDX-Identifier` instead of longform copyright tort. - Remove `sbuf_test_common.h`: the header was originally added to help with the 10.x/11.x split, but is no longer needed given that those releases have been EOLed for multiple years now. MFC after: 1 week (cherry picked from commit 3593be37a49e3f5268259bcc2af58cf730b08335) --- lib/libsbuf/tests/sbuf_core_test.c | 41 ++++-------------------------------- lib/libsbuf/tests/sbuf_stdio_test.c | 25 ++-------------------- lib/libsbuf/tests/sbuf_string_test.c | 25 ++-------------------- lib/libsbuf/tests/sbuf_test_common.h | 37 -------------------------------- 4 files changed, 8 insertions(+), 120 deletions(-) diff --git a/lib/libsbuf/tests/sbuf_core_test.c b/lib/libsbuf/tests/sbuf_core_test.c index d6c7873df74a..086fc7b08e66 100644 --- a/lib/libsbuf/tests/sbuf_core_test.c +++ b/lib/libsbuf/tests/sbuf_core_test.c @@ -1,26 +1,8 @@ /*- - * Copyright (c) 2017 Enji Cooper + * Copyright (c) 2017-2026 Enji Cooper + * Copyright (c) 2026 Joao Bonifacio * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include @@ -35,14 +17,11 @@ #include #include -#include "sbuf_test_common.h" - static char test_string[] = "this is a test string"; #define TEST_STRING_CHOP_COUNT 5 _Static_assert(nitems(test_string) > TEST_STRING_CHOP_COUNT, "test_string is too short"); -#ifdef HAVE_SBUF_CLEAR_FLAGS ATF_TC_WITHOUT_HEAD(sbuf_clear_flags_test); ATF_TC_BODY(sbuf_clear_flags_test, tc) { @@ -105,7 +84,6 @@ ATF_TC_BODY(sbuf_clear_test, tc) sbuf_delete(sb); } -#endif ATF_TC_WITHOUT_HEAD(sbuf_done_and_sbuf_finish_test); ATF_TC_BODY(sbuf_done_and_sbuf_finish_test, tc) @@ -175,11 +153,9 @@ ATF_TC_BODY(sbuf_len_test, tc) "sbuf_cat failed"); } -#ifdef HAVE_SBUF_SET_FLAGS sbuf_set_flags(sb, SBUF_INCLUDENUL); ATF_REQUIRE_MSG((ssize_t)(i * test_string_len + 1) == sbuf_len(sb), "sbuf_len(..) didn't report the NUL char"); -#endif ATF_REQUIRE_MSG(sbuf_finish(sb) == 0, "sbuf_finish failed: %s", strerror(errno)); @@ -270,7 +246,6 @@ ATF_TC_BODY(sbuf_setpos_test, tc) sbuf_delete(sb); } -#ifdef HAVE_SBUF_GET_FLAGS ATF_TC_WITHOUT_HEAD(sbuf_get_flags_test); ATF_TC_BODY(sbuf_get_flags_test, tc) { @@ -289,9 +264,7 @@ ATF_TC_BODY(sbuf_get_flags_test, tc) ATF_CHECK_INTEQ(flags ^ (SBUF_AUTOEXTEND | SBUF_INCLUDENUL), 0); sbuf_delete(sb); } -#endif -#ifdef HAVE_SBUF_SET_FLAGS ATF_TC_WITHOUT_HEAD(sbuf_set_flags_test); ATF_TC_BODY(sbuf_set_flags_test, tc) { @@ -313,24 +286,18 @@ ATF_TC_BODY(sbuf_set_flags_test, tc) sbuf_delete(sb); } -#endif ATF_TP_ADD_TCS(tp) { -#ifdef HAVE_SBUF_CLEAR_FLAGS + ATF_TP_ADD_TC(tp, sbuf_clear_flags_test); ATF_TP_ADD_TC(tp, sbuf_clear_test); -#endif ATF_TP_ADD_TC(tp, sbuf_done_and_sbuf_finish_test); ATF_TP_ADD_TC(tp, sbuf_drain_ret0_test); -#ifdef HAVE_SBUF_GET_FLAGS ATF_TP_ADD_TC(tp, sbuf_get_flags_test); -#endif ATF_TP_ADD_TC(tp, sbuf_len_test); ATF_TP_ADD_TC(tp, sbuf_new_fixedlen); -#ifdef HAVE_SBUF_SET_FLAGS ATF_TP_ADD_TC(tp, sbuf_set_flags_test); -#endif ATF_TP_ADD_TC(tp, sbuf_setpos_test); return (atf_no_error()); diff --git a/lib/libsbuf/tests/sbuf_stdio_test.c b/lib/libsbuf/tests/sbuf_stdio_test.c index 4987c1409723..339434d53e3b 100644 --- a/lib/libsbuf/tests/sbuf_stdio_test.c +++ b/lib/libsbuf/tests/sbuf_stdio_test.c @@ -1,26 +1,7 @@ /*- - * Copyright (c) 2017 Enji Cooper + * Copyright (c) 2017-2026 Enji Cooper * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include @@ -35,8 +16,6 @@ #include #include -#include "sbuf_test_common.h" - static char test_string[] = "this is a test string"; #define MESSAGE_FORMAT "message: %s\n" diff --git a/lib/libsbuf/tests/sbuf_string_test.c b/lib/libsbuf/tests/sbuf_string_test.c index 9ff3dde0cab3..c8430a0c4ff4 100644 --- a/lib/libsbuf/tests/sbuf_string_test.c +++ b/lib/libsbuf/tests/sbuf_string_test.c @@ -1,26 +1,7 @@ /*- - * Copyright (c) 2017 Enji Cooper + * Copyright (c) 2017-2026 Enji Cooper * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include @@ -34,8 +15,6 @@ #include #include -#include "sbuf_test_common.h" - static char test_string[] = "this is a test string"; static char test_whitespace_string[] = " \f\n\r\t\v "; static int test_buffer[] = { diff --git a/lib/libsbuf/tests/sbuf_test_common.h b/lib/libsbuf/tests/sbuf_test_common.h deleted file mode 100644 index 5c60abe2826e..000000000000 --- a/lib/libsbuf/tests/sbuf_test_common.h +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * Copyright (c) 2017 Enji Cooper - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef __LIBSBUF_TEST_COMMON_H__ -#define __LIBSBUF_TEST_COMMON_H__ - -#include - -#if __FreeBSD_version > 1100064 -#define HAVE_SBUF_GET_FLAGS -#define HAVE_SBUF_CLEAR_FLAGS -#define HAVE_SBUF_SET_FLAGS -#endif - -#endif