summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-03-25 10:01:23 -0300
committerJames Almer <jamrial@gmail.com>2022-03-25 11:46:51 -0300
commit167c5a6afc52342e6b7fb836a5a7db069a6a42e0 (patch)
tree0684f8673f9b29f26140b5fc0c7ff82567e48226 /libavutil
parentf9ed91abc9c70842ed385785b87c67bf54e67a6f (diff)
avutil/tests/channel_layout: test the output of av_channel_layout_standard()
Should increase test coverage. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/tests/channel_layout.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/libavutil/tests/channel_layout.c b/libavutil/tests/channel_layout.c
index 89abd8b171..79d3a1caed 100644
--- a/libavutil/tests/channel_layout.c
+++ b/libavutil/tests/channel_layout.c
@@ -66,13 +66,32 @@
int main(void)
{
+ const AVChannelLayout *playout;
AVChannelLayout layout = { 0 };
AVBPrint bp;
+ void *iter = NULL;
int ret;
av_bprint_init(&bp, 64, AV_BPRINT_SIZE_AUTOMATIC);
- printf("Testing av_channel_name\n");
+ printf("Testing av_channel_layout_standard\n");
+ while (playout = av_channel_layout_standard(&iter)) {
+ av_channel_layout_describe_bprint(playout, &bp);
+ printf("%-14s ", bp.str);
+ av_bprint_clear(&bp);
+ for (int i = 0; i < 63; i++) {
+ int idx = av_channel_layout_index_from_channel(playout, i);
+ if (idx >= 0) {
+ if (idx)
+ av_bprintf(&bp, "+");
+ av_channel_name_bprint(&bp, i);
+ }
+ }
+ printf("%s\n", bp.str);
+ av_bprint_clear(&bp);
+ }
+
+ printf("\nTesting av_channel_name\n");
CHANNEL_NAME(AV_CHAN_FRONT_LEFT);
printf("With AV_CHAN_FRONT_LEFT: %27s\n", bp.str);
CHANNEL_NAME(AV_CHAN_FRONT_RIGHT);