From 4be6307cbf819eeaac850b3f0e7e088b147107d3 Mon Sep 17 00:00:00 2001 From: Richard Shaffer Date: Sat, 27 Jan 2018 18:21:28 -0800 Subject: [PATCH] fate: add id3v2 test Adds basic unit test for parsing ID3v2 tags. Signed-off-by: James Almer --- tests/Makefile | 1 + tests/fate-run.sh | 4 ++++ tests/fate/id3v2.mak | 5 +++++ tests/ref/fate/id3v2-priv | 5 +++++ 4 files changed, 15 insertions(+) create mode 100644 tests/fate/id3v2.mak create mode 100644 tests/ref/fate/id3v2-priv diff --git a/tests/Makefile b/tests/Makefile index 14b9601378..327e3f4420 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -130,6 +130,7 @@ include $(SRC_PATH)/tests/fate/gapless.mak include $(SRC_PATH)/tests/fate/gif.mak include $(SRC_PATH)/tests/fate/h264.mak include $(SRC_PATH)/tests/fate/hevc.mak +include $(SRC_PATH)/tests/fate/id3v2.mak include $(SRC_PATH)/tests/fate/image.mak include $(SRC_PATH)/tests/fate/indeo.mak include $(SRC_PATH)/tests/fate/libavcodec.mak diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 05f4ca5e20..82862b7ef4 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -88,6 +88,10 @@ probefmt(){ run ffprobe${PROGSUF} -show_entries format=format_name -print_format default=nw=1:nk=1 -v 0 "$@" } +probetags(){ + run ffprobe${PROGSUF} -show_entries format_tags -v 0 "$@" +} + runlocal(){ test "${V:-0}" -gt 0 && echo ${base}/"$@" ${base} >&3 ${base}/"$@" ${base} diff --git a/tests/fate/id3v2.mak b/tests/fate/id3v2.mak new file mode 100644 index 0000000000..873f593d8c --- /dev/null +++ b/tests/fate/id3v2.mak @@ -0,0 +1,5 @@ +FATE_SAMPLES_ID3V2-$(CONFIG_MP3_DEMUXER) += fate-id3v2-priv +fate-id3v2-priv: CMD = probetags $(TARGET_SAMPLES)/id3v2/id3v2_priv.mp3 + +FATE_SAMPLES_FFPROBE += $(FATE_SAMPLES_ID3V2-yes) +fate-id3v2: $(FATE_SAMPLES_ID3V2-yes) diff --git a/tests/ref/fate/id3v2-priv b/tests/ref/fate/id3v2-priv new file mode 100644 index 0000000000..965c8695e8 --- /dev/null +++ b/tests/ref/fate/id3v2-priv @@ -0,0 +1,5 @@ +[FORMAT] +TAG:title=id3v2-test +TAG:id3v2_priv.testowner=testdata +TAG:id3v2_priv.testowner2=\x00\x01\x02 +[/FORMAT]