Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 1/4] checkasm: Make checkasm_fail_func return whether we should print verbosely
Date: Wed, 26 Mar 2025 12:30:12 +0200
Message-ID: <20250326103015.44296-1-martin@martin.st> (raw)

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".

             reply	other threads:[~2025-03-26 10:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26 10:30 Martin Storsjö [this message]
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ö

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=20250326103015.44296-1-martin@martin.st \
    --to=martin@martin.st \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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

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