From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Seyi Kuforiji <kuforiji98@gmail.com>,
git@vger.kernel.org, phillip.wood@dunelm.org.uk
Subject: Re: [PATCH 1/2] t/unit-tests: match functions signature with trailing code
Date: Wed, 08 Jan 2025 07:27:37 -0800 [thread overview]
Message-ID: <xmqqcygxpbpy.fsf@gitster.g> (raw)
In-Reply-To: <Z34XvPjhY15MFHrT@pks.im> (Patrick Steinhardt's message of "Wed, 8 Jan 2025 07:14:20 +0100")
Patrick Steinhardt <ps@pks.im> writes:
> So I agree with you, let's scrap the idea and have proper function
> bodies instead.
Yup, sometimes, simple, stupid, and good enough is the way to go.
We could do
-- >8 --
#define T(testname, input, expect1, expect256) \
void test_hash__ ## testname(void) \
{ \
const char *expect[] = { expect1, expect256 }; \
check_hash_data(input, strlen(input), expect); \
} extern void test_hash__ ## testname()
T(empty_string, "", "da39...", "e3b0c4...");
T(single_character, "a", "86f7e4...", "ca97811...");
-- 8< --
which may not upset syntax-aware editors too much.
Unless there are more than several dozens of them, I do not think it
is worth it, though ;-)
next prev parent reply other threads:[~2025-01-08 15:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 9:19 [PATCH 0/2] t/unit-tests: convert hash tests to use clar Seyi Kuforiji
2025-01-07 9:19 ` [PATCH 1/2] t/unit-tests: match functions signature with trailing code Seyi Kuforiji
2025-01-07 18:16 ` Junio C Hamano
2025-01-07 18:41 ` Junio C Hamano
2025-01-08 6:14 ` Patrick Steinhardt
2025-01-08 8:31 ` Seyi Chamber
2025-01-08 15:27 ` Junio C Hamano [this message]
2025-01-08 16:15 ` Patrick Steinhardt
2025-01-07 9:19 ` [PATCH 2/2] t/unit-tests: convert hash to use clar test framework Seyi Kuforiji
2025-01-08 12:03 ` [PATCH v2 0/1] " Seyi Kuforiji
2025-01-08 12:03 ` [PATCH v2 1/1] " Seyi Kuforiji
2025-01-08 15:35 ` Junio C Hamano
2025-01-09 7:30 ` Seyi Chamber
2025-01-08 15:28 ` [PATCH v2 0/1] " Junio C Hamano
2025-01-09 7:21 ` Seyi Chamber
2025-01-09 14:09 ` [PATCH v3] " Seyi Kuforiji
2025-01-09 15:10 ` Patrick Steinhardt
2025-01-09 16:14 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqcygxpbpy.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kuforiji98@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.