From 672b925e8a3bd89891f1d875a00af113af290a05 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Wed, 25 Dec 2019 19:35:34 +0100 Subject: avutil/tests/opt: add tests for AV_OPT_TYPE_DICT Signed-off-by: Marton Balint --- libavutil/tests/opt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavutil/tests') diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c index f4cfa590aa..1173ae8eba 100644 --- a/libavutil/tests/opt.c +++ b/libavutil/tests/opt.c @@ -55,6 +55,8 @@ typedef struct TestContext { int bool1; int bool2; int bool3; + AVDictionary *dict1; + AVDictionary *dict2; } TestContext; #define OFFSET(x) offsetof(TestContext, x) @@ -89,6 +91,8 @@ static const AVOption test_options[]= { {"bool1", "set boolean value", OFFSET(bool1), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, 1 }, {"bool2", "set boolean value", OFFSET(bool2), AV_OPT_TYPE_BOOL, { .i64 = 1 }, -1, 1, 1 }, {"bool3", "set boolean value", OFFSET(bool3), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, 1 }, + {"dict1", "set dictionary value", OFFSET(dict1), AV_OPT_TYPE_DICT, { .str = NULL}, 0, 0, 1 }, + {"dict2", "set dictionary value", OFFSET(dict2), AV_OPT_TYPE_DICT, { .str = "happy=':-)'"}, 0, 0, 1 }, { NULL }, }; @@ -256,6 +260,7 @@ int main(void) "dbl=101", "bool1=true", "bool2=auto", + "dict1='happy=\\:-):sad=\\:-('", }; test_ctx.class = &test_class; -- cgit v1.2.3