Re: [PATCH 2/6] unit-tests: add TEST_RUN
- From
René Scharfe <l.s.r@web.de>
- Date
- Jul 2, 2024, 20:55 UTC
- Message-ID
- <332f0418-98eb-4254-b714-cde461f6852d@web.de>
- In-Reply-To
- <xmqqle2jssfs.fsf@gitster.g>
Am 02.07.24 um 17:51 schrieb Junio C Hamano:
Show 15 quoted lines
> phillip.wood123@gmail.com writes: > >>> @@ -156,6 +163,7 @@ extern union test__tmp test__tmp[2]; >>> int test__run_begin(void); >>> __attribute__((format (printf, 3, 4))) >>> int test__run_end(int, const char *, const char *, ...); >> >> We should add >> >> __attribute__((format (printf, 2, 3), warn_unused_result)) >> >> here to catch any errors in the format string / arguments and to warn >> if TEST_RUN() isn't wrapped in an if() statement. > > Nice. Especially the "unused" check is valuable.
This confused me for a moment. I assume you both mean the new function test__run, whose addition was cut from the citation:
+int test__run(const char *location, const char *format, ...);
For that one the numbers make sense and the idea is good. :)
René