Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] checkasm: Make checkasm_fail_func return whether we should print verbosely
@ 2025-03-26 10:30 Martin Storsjö
  2025-03-26 10:30 ` [FFmpeg-devel] [PATCH 2/4] checkasm: Implement helpers for defining and checking padded rects Martin Storsjö
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Martin Storsjö @ 2025-03-26 10:30 UTC (permalink / raw)
  To: ffmpeg-devel

This makes it easier to implement custom error printouts in tests.

This is a port of dav1d's commit
13a7d78655f8747c2cd01e8a48d44dcc7f60a8e5 into ffmpeg's checkasm.
---
 tests/checkasm/checkasm.c | 9 +++++----
 tests/checkasm/checkasm.h | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 14742081ca..c6d641c52b 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -1081,8 +1081,9 @@ int checkasm_bench_func(void)
            !wildstrcmp(state.current_func->name, state.bench_pattern);
 }
 
-/* Indicate that the current test has failed */
-void checkasm_fail_func(const char *msg, ...)
+/* Indicate that the current test has failed, return whether verbose printing
+ * is requested. */
+int checkasm_fail_func(const char *msg, ...)
 {
     if (state.current_func_ver && state.current_func_ver->cpu &&
         state.current_func_ver->ok)
@@ -1099,6 +1100,7 @@ void checkasm_fail_func(const char *msg, ...)
         state.current_func_ver->ok = 0;
         state.num_failed++;
     }
+    return state.verbose;
 }
 
 void checkasm_set_signal_handler_state(int enabled) {
@@ -1180,8 +1182,7 @@ int checkasm_check_##type(const char *file, int line, \
             break; \
     if (y == h) \
         return 0; \
-    checkasm_fail_func("%s:%d", file, line); \
-    if (!state.verbose) \
+    if (!checkasm_fail_func("%s:%d", file, line)) \
         return 1; \
     fprintf(stderr, "%s:\n", name); \
     while (h--) { \
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 75c81317ba..852d6fca64 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -152,7 +152,7 @@ struct CheckasmPerf;
 
 void *checkasm_check_func(void *func, const char *name, ...) av_printf_format(2, 3);
 int checkasm_bench_func(void);
-void checkasm_fail_func(const char *msg, ...) av_printf_format(1, 2);
+int checkasm_fail_func(const char *msg, ...) av_printf_format(1, 2);
 struct CheckasmPerf *checkasm_get_perf_context(void);
 void checkasm_report(const char *name, ...) av_printf_format(1, 2);
 void checkasm_set_signal_handler_state(int enabled);
-- 
2.39.5 (Apple Git-154)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-01 15:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-26 10:30 [FFmpeg-devel] [PATCH 1/4] checkasm: Make checkasm_fail_func return whether we should print verbosely Martin Storsjö
2025-03-26 10:30 ` [FFmpeg-devel] [PATCH 2/4] checkasm: Implement helpers for defining and checking padded rects Martin Storsjö
2025-03-29  0:15   ` Michael Niedermayer
2025-03-31 13:05     ` Martin Storsjö
2025-04-01  0:28       ` Michael Niedermayer
2025-04-01  9:38         ` Martin Storsjö
2025-04-01 15:38           ` Martin Storsjö
2025-03-26 10:30 ` [FFmpeg-devel] [PATCH 3/4] checkasm: hevc_pel: Use helpers for checking for writes out of bounds Martin Storsjö
2025-04-01  9:35   ` Martin Storsjö
2025-04-01 12:54     ` yinshiyou-hf
2025-03-26 10:30 ` [FFmpeg-devel] [PATCH 4/4] checkasm: vp8dsp: Use checkasm_check_padded in check_mc Martin Storsjö

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git