diff mbox series

[FFmpeg-devel,v3,3/3] tests/fate/source-check: Check for AVERROR codes without error strings

Message ID 20240718104757.2809396-4-ffmpeg-devel@pileofstuff.org
State New
Headers show
Series Protect against undocumented error codes | expand

Commit Message

Andrew Sayers July 18, 2024, 10:46 a.m. UTC
---
 tests/fate/source-check.sh | 8 ++++++++
 tests/ref/fate/source      | 1 +
 2 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
index 4d7e175784..71f01cbdec 100755
--- a/tests/fate/source-check.sh
+++ b/tests/fate/source-check.sh
@@ -45,4 +45,12 @@  git grep -E 'av_clip *\(.*, *(-2 *, *1|-4 *, *3|-8 *, *7|-16 *, *15|-32 *, *31|-
 ' *, *33554431|-67108864 *, *67108863|-134217728 *, *134217727|-268435456 *, *'\
 '268435455|-536870912 *, *536870911|-1073741824 *, *1073741823) *\)'| grep -v fate/source
 
+echo "AVERROR_xxx constants with no associated error string:"
+git show HEAD:libavutil/error.c \
+    | sed -ne 's/.*AVERROR_\([^ ]*\).*/\1/p' libavutil/error.h \
+    | while read ERROR
+      do git grep -q "$ERROR" libavutil/error.c \
+         || echo "Please add ERROR_TAG($ERROR)"
+      done
+
 exit 0
diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index 1703b36c02..b84cc88a6e 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -28,3 +28,4 @@  libavcodec/bitstream_template.h
 tools/decode_simple.h
 Use of av_clip() where av_clip_uintp2() could be used:
 Use of av_clip() where av_clip_intp2() could be used:
+AVERROR_xxx constants with no associated error string: