summaryrefslogtreecommitdiff
path: root/libavutil/tests
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-12-25 19:35:34 +0100
committerMarton Balint <cus@passwd.hu>2019-12-27 21:52:21 +0100
commit672b925e8a3bd89891f1d875a00af113af290a05 (patch)
treeb35966469c32a93a3df847ef465ec530f4b4c9b3 /libavutil/tests
parent5edacc46099725f59ac81bdbff991b0daf4b3a7c (diff)
downloadffmpeg-672b925e8a3bd89891f1d875a00af113af290a05.tar.gz
avutil/tests/opt: add tests for AV_OPT_TYPE_DICT
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavutil/tests')
-rw-r--r--libavutil/tests/opt.c5
1 files changed, 5 insertions, 0 deletions
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;