[FFmpeg-cvslog] eval: add fate test

Mans Rullgard git at videolan.org
Tue Jul 5 02:52:25 CEST 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sun Jul  3 19:35:30 2011 +0100| [883fd9e393cea378bda99ddc6ee5d5ef2141a9f8] | committer: Mans Rullgard

eval: add fate test

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 tests/fate/libavutil.mak |    4 ++
 tests/ref/fate/eval      |  134 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/tests/fate/libavutil.mak b/tests/fate/libavutil.mak
index d83ced8..4299f08 100644
--- a/tests/fate/libavutil.mak
+++ b/tests/fate/libavutil.mak
@@ -21,6 +21,10 @@ fate-des: libavutil/des-test$(EXESUF)
 fate-des: CMD = run libavutil/des-test
 fate-des: REF = /dev/null
 
+FATE_TESTS += fate-eval
+fate-eval: libavutil/eval-test$(EXESUF)
+fate-eval: CMD = run libavutil/eval-test
+
 FATE_TESTS += fate-md5
 fate-md5: libavutil/md5-test$(EXESUF)
 fate-md5: CMD = run libavutil/md5-test
diff --git a/tests/ref/fate/eval b/tests/ref/fate/eval
new file mode 100644
index 0000000..bcc1a50
--- /dev/null
+++ b/tests/ref/fate/eval
@@ -0,0 +1,134 @@
+Evaluating ''
+'' -> nan
+
+Evaluating '1;2'
+'1;2' -> 2.000000
+
+Evaluating '-20'
+'-20' -> -20.000000
+
+Evaluating '-PI'
+'-PI' -> -3.141593
+
+Evaluating '+PI'
+'+PI' -> 3.141593
+
+Evaluating '1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)'
+'1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)' -> 12.700000
+
+Evaluating '80G/80Gi1k'
+'80G/80Gi1k' -> nan
+
+Evaluating '1Gi'
+'1Gi' -> 1073741824.000000
+
+Evaluating '1gi'
+'1gi' -> nan
+
+Evaluating '1GiFoo'
+'1GiFoo' -> nan
+
+Evaluating '1k+1k'
+'1k+1k' -> 2000.000000
+
+Evaluating '1Gi*3foo'
+'1Gi*3foo' -> nan
+
+Evaluating 'foo'
+'foo' -> nan
+
+Evaluating 'foo('
+'foo(' -> nan
+
+Evaluating 'foo()'
+'foo()' -> nan
+
+Evaluating 'foo)'
+'foo)' -> nan
+
+Evaluating 'sin'
+'sin' -> nan
+
+Evaluating 'sin('
+'sin(' -> nan
+
+Evaluating 'sin()'
+'sin()' -> nan
+
+Evaluating 'sin)'
+'sin)' -> nan
+
+Evaluating 'sin 10'
+'sin 10' -> nan
+
+Evaluating 'sin(1,2,3)'
+'sin(1,2,3)' -> nan
+
+Evaluating 'sin(1 )'
+'sin(1 )' -> 0.841471
+
+Evaluating '1'
+'1' -> 1.000000
+
+Evaluating '1foo'
+'1foo' -> nan
+
+Evaluating 'bar + PI + E + 100f*2 + foo'
+'bar + PI + E + 100f*2 + foo' -> nan
+
+Evaluating '13k + 12f - foo(1, 2)'
+'13k + 12f - foo(1, 2)' -> nan
+
+Evaluating '1gi'
+'1gi' -> nan
+
+Evaluating '1Gi'
+'1Gi' -> 1073741824.000000
+
+Evaluating 'st(0, 123)'
+'st(0, 123)' -> 123.000000
+
+Evaluating 'st(1, 123); ld(1)'
+'st(1, 123); ld(1)' -> 123.000000
+
+Evaluating 'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)'
+'st(0, 1); while(lte(ld(0), 100), st(1, ld(1)+ld(0));st(0, ld(0)+1)); ld(1)' -> 5073.000000
+
+Evaluating 'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)'
+'st(1, 1); st(2, 2); st(0, 1); while(lte(ld(0),10), st(3, ld(1)+ld(2)); st(1, ld(2)); st(2, ld(3)); st(0, ld(0)+1)); ld(3)' -> 144.000000
+
+Evaluating 'while(0, 10)'
+'while(0, 10)' -> nan
+
+Evaluating 'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))'
+'st(0, 1); while(lte(ld(0),100), st(1, ld(1)+ld(0)); st(0, ld(0)+1))' -> 100.000000
+
+Evaluating 'isnan(1)'
+'isnan(1)' -> 0.000000
+
+Evaluating 'isnan(NAN)'
+'isnan(NAN)' -> 1.000000
+
+Evaluating 'floor(NAN)'
+'floor(NAN)' -> nan
+
+Evaluating 'floor(123.123)'
+'floor(123.123)' -> 123.000000
+
+Evaluating 'floor(-123.123)'
+'floor(-123.123)' -> -124.000000
+
+Evaluating 'trunc(123.123)'
+'trunc(123.123)' -> 123.000000
+
+Evaluating 'trunc(-123.123)'
+'trunc(-123.123)' -> -123.000000
+
+Evaluating 'ceil(123.123)'
+'ceil(123.123)' -> 124.000000
+
+Evaluating 'ceil(-123.123)'
+'ceil(-123.123)' -> -123.000000
+
+12.700000 == 12.7
+0.931323 == 0.931322575



More information about the ffmpeg-cvslog mailing list