From: Marton Balint <cus@passwd.hu> To: ffmpeg-devel@ffmpeg.org Cc: Marton Balint <cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 4/7] avutil/tests/channel_layout: add some av_channel_from_string and av_channel_layout_from_string tests Date: Sat, 9 Mar 2024 22:54:11 +0100 Message-ID: <20240309215414.26699-4-cus@passwd.hu> (raw) In-Reply-To: <20240309215414.26699-1-cus@passwd.hu> We lacked tests which supposed to fail, and there are some which should fail but right now it does not. This will be fixed in a later commit. Signed-off-by: Marton Balint <cus@passwd.hu> --- libavutil/tests/channel_layout.c | 26 ++++++++++++++++++++++++++ tests/ref/fate/channel_layout | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/libavutil/tests/channel_layout.c b/libavutil/tests/channel_layout.c index d62b69a5db..14d36c71b5 100644 --- a/libavutil/tests/channel_layout.c +++ b/libavutil/tests/channel_layout.c @@ -255,6 +255,11 @@ int main(void) CHANNEL_FROM_STRING("USR63"); CHANNEL_FROM_STRING("AMBI0"); CHANNEL_FROM_STRING("AMBI1023"); + CHANNEL_FROM_STRING("AMBI1024"); + CHANNEL_FROM_STRING("Dummy"); + CHANNEL_FROM_STRING("FL@Foo"); + CHANNEL_FROM_STRING("Foo@FL"); + CHANNEL_FROM_STRING("@FL"); printf("\n==Native layouts==\n"); @@ -301,6 +306,9 @@ int main(void) CHANNEL_LAYOUT_CHANNEL_FROM_STRING(bp.str, "SL"); CHANNEL_LAYOUT_CHANNEL_FROM_STRING(bp.str, "SR"); CHANNEL_LAYOUT_CHANNEL_FROM_STRING(bp.str, "BC"); + CHANNEL_LAYOUT_CHANNEL_FROM_STRING(bp.str, "@"); + CHANNEL_LAYOUT_CHANNEL_FROM_STRING(bp.str, "@Foo"); + CHANNEL_LAYOUT_CHANNEL_FROM_STRING(bp.str, "FL@Foo"); printf("\nTesting av_channel_layout_index_from_string\n"); CHANNEL_LAYOUT_INDEX_FROM_STRING(bp.str, "FL"); @@ -321,9 +329,27 @@ int main(void) printf("\nTesting av_channel_layout_from_string\n"); CHANNEL_LAYOUT_FROM_STRING("FL+FR+FC+BL+BR+LFE"); CHANNEL_LAYOUT_FROM_STRING("2 channels (FR+FL)"); + CHANNEL_LAYOUT_FROM_STRING("2 channels (AMBI1023+FL)"); + CHANNEL_LAYOUT_FROM_STRING("3 channels (FR+FL)"); + CHANNEL_LAYOUT_FROM_STRING("-3 channels (FR+FL)"); + CHANNEL_LAYOUT_FROM_STRING("0 channels ()"); + CHANNEL_LAYOUT_FROM_STRING("2 channels (FL+FR"); CHANNEL_LAYOUT_FROM_STRING("ambisonic 1+FR+FL"); CHANNEL_LAYOUT_FROM_STRING("ambisonic 2+FC@Foo"); CHANNEL_LAYOUT_FROM_STRING("FL@Foo+FR@Bar"); + CHANNEL_LAYOUT_FROM_STRING("FL+stereo"); + CHANNEL_LAYOUT_FROM_STRING("stereo+stereo"); + CHANNEL_LAYOUT_FROM_STRING("stereo@Boo"); + CHANNEL_LAYOUT_FROM_STRING(""); + CHANNEL_LAYOUT_FROM_STRING("@"); + CHANNEL_LAYOUT_FROM_STRING("@Dummy"); + CHANNEL_LAYOUT_FROM_STRING("@FL"); + CHANNEL_LAYOUT_FROM_STRING("Dummy"); + CHANNEL_LAYOUT_FROM_STRING("Dummy@FL"); + CHANNEL_LAYOUT_FROM_STRING("FR+Dummy"); + CHANNEL_LAYOUT_FROM_STRING("FR+Dummy@FL"); + CHANNEL_LAYOUT_FROM_STRING("FR+@FL"); + CHANNEL_LAYOUT_FROM_STRING("FL+@"); CHANNEL_LAYOUT_FROM_STRING("FR+FL@Foo+USR63@Foo"); ret = av_channel_layout_copy(&layout2, &layout); diff --git a/tests/ref/fate/channel_layout b/tests/ref/fate/channel_layout index b98ccdb0f0..ea7ec6fa3c 100644 --- a/tests/ref/fate/channel_layout +++ b/tests/ref/fate/channel_layout @@ -56,6 +56,11 @@ With "FR": 1 With "USR63": 63 With "AMBI0": 1024 With "AMBI1023": 2047 +With "AMBI1024": -1 +With "Dummy": -1 +With "FL@Foo": -1 +With "Foo@FL": -1 +With "@FL": -1 ==Native layouts== @@ -101,6 +106,9 @@ On "5.1(side)" layout with "LFE": 3 On "5.1(side)" layout with "SL": 9 On "5.1(side)" layout with "SR": 10 On "5.1(side)" layout with "BC": -1 +On "5.1(side)" layout with "@": -1 +On "5.1(side)" layout with "@Foo": -1 +On "5.1(side)" layout with "FL@Foo": -1 Testing av_channel_layout_index_from_string On "5.1(side)" layout with "FL": 0 @@ -121,9 +129,27 @@ On "5.1(side)" layout with AV_CH_LAYOUT_4POINT1: 0xf Testing av_channel_layout_from_string With "FL+FR+FC+BL+BR+LFE": 6 channels (FL+FR+FC+BL+BR+LFE) With "2 channels (FR+FL)": 2 channels (FR+FL) +With "2 channels (AMBI1023+FL)": fail +With "3 channels (FR+FL)": fail +With "-3 channels (FR+FL)": fail +With "0 channels ()": fail +With "2 channels (FL+FR": fail With "ambisonic 1+FR+FL": ambisonic 1+2 channels (FR+FL) With "ambisonic 2+FC@Foo": ambisonic 2+1 channels (FC@Foo) With "FL@Foo+FR@Bar": 2 channels (FL@Foo+FR@Bar) +With "FL+stereo": fail +With "stereo+stereo": fail +With "stereo@Boo": fail +With "": fail +With "@": fail +With "@Dummy": fail +With "@FL": 1 channels (FL) +With "Dummy": fail +With "Dummy@FL": fail +With "FR+Dummy": fail +With "FR+Dummy@FL": 1 channels (FR) +With "FR+@FL": 2 channels (FR+FL@FL) +With "FL+@": fail With "FR+FL@Foo+USR63@Foo": 3 channels (FR+FL@Foo+USR63@Foo) Testing av_channel_layout_index_from_string -- 2.35.3 _______________________________________________ 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".
next prev parent reply other threads:[~2024-03-09 21:55 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-09 21:54 [FFmpeg-devel] [PATCH 1/7] avutil/channel_layout: add AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL Marton Balint 2024-03-09 21:54 ` [FFmpeg-devel] [PATCH 2/7] avformat/mov_chan: simplify channel layout canonicalization Marton Balint 2024-03-09 21:54 ` [FFmpeg-devel] [PATCH 3/7] avutil/tests/channel_layout: make printing results part of the tests Marton Balint 2024-03-09 21:54 ` Marton Balint [this message] 2024-03-09 21:54 ` [FFmpeg-devel] [PATCH 5/7] avutil/channel_layout: factorize parsing list of channel names Marton Balint 2024-03-09 21:54 ` [FFmpeg-devel] [PATCH 6/7] avutil/channel_layout: fix some (un)initialization issues in av_channel_layout_from_string() Marton Balint 2024-03-09 21:54 ` [FFmpeg-devel] [PATCH 7/7] avutil/channel_layout: add specific text versions for unknown and unused channels Marton Balint 2024-03-16 8:34 ` [FFmpeg-devel] [PATCH 1/7] avutil/channel_layout: add AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL Marton Balint
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=20240309215414.26699-4-cus@passwd.hu \ --to=cus@passwd.hu \ --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