[libav-commits] fate: Add parseutils test

Diego Biurrun git at libav.org
Sat Oct 6 09:31:44 CEST 2012


Module: libav
Branch: master
Commit: 76f644d9f7f511a4e8dbc4938d40c43b49383c22

Author:    Diego Biurrun <diego at biurrun.de>
Committer: Diego Biurrun <diego at biurrun.de>
Date:      Fri Oct  5 23:34:52 2012 +0200

fate: Add parseutils test

---

 tests/fate/libavutil.mak  |    4 ++++
 tests/ref/fate/parseutils |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index 1052b1d..afb0a2c 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -37,6 +37,10 @@ FATE_LIBAVUTIL += fate-md5
 fate-md5: libavutil/md5-test$(EXESUF)
 fate-md5: CMD = run libavutil/md5-test
 
+FATE_LIBAVUTIL += fate-parseutils
+fate-parseutils: libavutil/parseutils-test$(EXESUF)
+fate-parseutils: CMD = run libavutil/parseutils-test
+
 FATE_LIBAVUTIL += fate-sha
 fate-sha: libavutil/sha-test$(EXESUF)
 fate-sha: CMD = run libavutil/sha-test
diff --git a/tests/ref/fate/parseutils b/tests/ref/fate/parseutils
new file mode 100644
index 0000000..896c14d
--- /dev/null
+++ b/tests/ref/fate/parseutils
@@ -0,0 +1,45 @@
+Testing av_parse_video_rate()
+'-inf' -> -1/0 ret:-22
+'inf' -> 1/0 ret:-22
+'nan' -> 0/0 ret:-22
+'123/0' -> 1/0 ret:-22
+'-123 / 0' -> -1/0 ret:-22
+'' -> 0/0 ret:-22
+'/' -> 0/0 ret:-22
+' 123  /  321' -> 41/107 ret:0
+'foo/foo' -> 0/0 ret:-22
+'foo/1' -> 0/0 ret:-22
+'1/foo' -> 0/0 ret:-22
+'0/0' -> 0/0 ret:-22
+'/0' -> 0/0 ret:-22
+'1/' -> 0/0 ret:-22
+'1' -> 1/1 ret:0
+'0' -> 0/1 ret:-22
+'-123/123' -> -1/1 ret:-22
+'-foo' -> 0/0 ret:-22
+'123.23' -> 12323/100 ret:0
+'.23' -> 23/100 ret:0
+'-.23' -> -23/100 ret:-22
+'-0.234' -> -117/500 ret:-22
+'-0.0000001' -> 0/1 ret:-22
+'  21332.2324   ' -> 917286/43 ret:0
+' -21332.2324   ' -> -917286/43 ret:-22
+
+Testing av_parse_color()
+red -> R(255) G(0) B(0) A(255)
+RED -> R(255) G(0) B(0) A(255)
+Violet -> R(238) G(130) B(238) A(255)
+Yellow -> R(255) G(255) B(0) A(255)
+Red -> R(255) G(0) B(0) A(255)
+0x000000 -> R(0) G(0) B(0) A(255)
+0xff000000 -> R(255) G(0) B(0) A(0)
+0x3e34ff -> R(62) G(52) B(255) A(255)
+0x3e34ffaa -> R(62) G(52) B(255) A(170)
+#ff0000 -> R(255) G(0) B(0) A(255)
+ff0000 -> R(255) G(0) B(0) A(255)
+0xff0000 at 1.0 -> R(255) G(0) B(0) A(255)
+red at 0xf -> R(255) G(0) B(0) A(15)
+red at 0.1 -> R(255) G(0) B(0) A(25)
+red at 0.5 -> R(255) G(0) B(0) A(127)
+red at 1.0 -> R(255) G(0) B(0) A(255)
+red at -0.0 -> R(255) G(0) B(0) A(0)



More information about the libav-commits mailing list