aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ref/fate
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-01-15 22:59:42 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-01-17 12:03:30 +0100
commit999495734b9de597f59590708979902f28ebce61 (patch)
tree5d7bf9d6735a8aea4b5d93f8ed481eed738fc950 /tests/ref/fate
parenta798c20a76196d76db27f7446ab90f8062f3c4eb (diff)
downloadffmpeg-999495734b9de597f59590708979902f28ebce61.tar.gz
lavu/eval: add if() and ifnot() eval functions
They allow to implement the if/then/else logic, which cannot be implemented otherwise. For example the expression: A*B + not(A)*C always evaluates to NaN if B is NaN, even in the case where A is 0.
Diffstat (limited to 'tests/ref/fate')
-rw-r--r--tests/ref/fate/eval9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ref/fate/eval b/tests/ref/fate/eval
index 88d7e17bee..09e310f25d 100644
--- a/tests/ref/fate/eval
+++ b/tests/ref/fate/eval
@@ -160,5 +160,14 @@ Evaluating 'PI^1.23'
Evaluating 'pow(-1,1.23)'
'pow(-1,1.23)' -> nan
+Evaluating 'if(1, 2)'
+'if(1, 2)' -> 2.000000
+
+Evaluating 'ifnot(0, 23)'
+'ifnot(0, 23)' -> 23.000000
+
+Evaluating 'ifnot(1, NaN) + if(0, 1)'
+'ifnot(1, NaN) + if(0, 1)' -> 0.000000
+
12.700000 == 12.7
0.931323 == 0.931322575