Commit afebf470 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/tests/dict: Check return of av_dict_parse_string()

Fixes: CID1396402
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 77a3c288
...@@ -35,12 +35,15 @@ static void test_separators(const AVDictionary *m, const char pair, const char v ...@@ -35,12 +35,15 @@ static void test_separators(const AVDictionary *m, const char pair, const char v
char vals[] = {val, '\0'}; char vals[] = {val, '\0'};
char *buffer = NULL; char *buffer = NULL;
int ret;
av_dict_copy(&dict, m, 0); av_dict_copy(&dict, m, 0);
print_dict(dict); print_dict(dict);
av_dict_get_string(dict, &buffer, val, pair); av_dict_get_string(dict, &buffer, val, pair);
printf("%s\n", buffer); printf("%s\n", buffer);
av_dict_free(&dict); av_dict_free(&dict);
av_dict_parse_string(&dict, buffer, vals, pairs, 0); ret = av_dict_parse_string(&dict, buffer, vals, pairs, 0);
printf("ret %d\n", ret);
av_freep(&buffer); av_freep(&buffer);
print_dict(dict); print_dict(dict);
av_dict_free(&dict); av_dict_free(&dict);
......
...@@ -2,24 +2,31 @@ Testing av_dict_get_string() and av_dict_parse_string() ...@@ -2,24 +2,31 @@ Testing av_dict_get_string() and av_dict_parse_string()
aaa aaa b,b bbb c=c ccc ddd d,d eee e=e f,f f=f g=g g,g aaa aaa b,b bbb c=c ccc ddd d,d eee e=e f,f f=f g=g g,g
aaa=aaa,b\,b=bbb,c\=c=ccc,ddd=d\,d,eee=e\=e,f\,f=f\=f,g\=g=g\,g aaa=aaa,b\,b=bbb,c\=c=ccc,ddd=d\,d,eee=e\=e,f\,f=f\=f,g\=g=g\,g
ret 0
aaa aaa b,b bbb c=c ccc ddd d,d eee e=e f,f f=f g=g g,g aaa aaa b,b bbb c=c ccc ddd d,d eee e=e f,f f=f g=g g,g
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa=aaa"bbb=bbb"ccc=ccc"\\,\=\'\"=\\,\=\'\" aaa=aaa"bbb=bbb"ccc=ccc"\\,\=\'\"=\\,\=\'\"
ret 0
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa=aaa'bbb=bbb'ccc=ccc'\\,\=\'"=\\,\=\'" aaa=aaa'bbb=bbb'ccc=ccc'\\,\=\'"=\\,\=\'"
ret 0
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa"aaa,bbb"bbb,ccc"ccc,\\\,=\'\""\\\,=\'\" aaa"aaa,bbb"bbb,ccc"ccc,\\\,=\'\""\\\,=\'\"
ret 0
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa'aaa,bbb'bbb,ccc'ccc,\\\,=\'"'\\\,=\'" aaa'aaa,bbb'bbb,ccc'ccc,\\\,=\'"'\\\,=\'"
ret 0
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa"aaa'bbb"bbb'ccc"ccc'\\,=\'\""\\,=\'\" aaa"aaa'bbb"bbb'ccc"ccc'\\,=\'\""\\,=\'\"
ret 0
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
aaa'aaa"bbb'bbb"ccc'ccc"\\,=\'\"'\\,=\'\" aaa'aaa"bbb'bbb"ccc'ccc"\\,=\'\"'\\,=\'\"
ret 0
aaa aaa bbb bbb ccc ccc \,='" \,='" aaa aaa bbb bbb ccc ccc \,='" \,='"
Testing av_dict_set() Testing av_dict_set()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment