[FFmpeg-cvslog] avutil/tests/dict: Check return of av_dict_parse_string()

Michael Niedermayer git at videolan.org
Fri Mar 31 00:36:06 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Mar 30 23:07:52 2017 +0200| [afebf470ca73c17cc8393bfd7eeebfdf6809c2b8] | committer: Michael Niedermayer

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

Fixes: CID1396402

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=afebf470ca73c17cc8393bfd7eeebfdf6809c2b8
---

 libavutil/tests/dict.c | 5 ++++-
 tests/ref/fate/dict    | 7 +++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavutil/tests/dict.c b/libavutil/tests/dict.c
index 0039ba5..56e9855 100644
--- a/libavutil/tests/dict.c
+++ b/libavutil/tests/dict.c
@@ -35,12 +35,15 @@ static void test_separators(const AVDictionary *m, const char pair, const char v
     char vals[]  = {val, '\0'};
 
     char *buffer = NULL;
+    int ret;
+
     av_dict_copy(&dict, m, 0);
     print_dict(dict);
     av_dict_get_string(dict, &buffer, val, pair);
     printf("%s\n", buffer);
     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);
     print_dict(dict);
     av_dict_free(&dict);
diff --git a/tests/ref/fate/dict b/tests/ref/fate/dict
index 837f7b0..7205e4c 100644
--- a/tests/ref/fate/dict
+++ b/tests/ref/fate/dict
@@ -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
+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   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'\\,\=\'"=\\,\=\'"
+ret 0
 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,\\\,=\'"'\\\,=\'"
+ret 0
 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"\\,=\'\"'\\,=\'\"
+ret 0
 aaa aaa   bbb bbb   ccc ccc   \,='" \,='"
 
 Testing av_dict_set()



More information about the ffmpeg-cvslog mailing list