[FFmpeg-cvslog] eval/fate: try to fix nan printing format failures.
Michael Niedermayer
git at videolan.org
Tue Jul 5 10:50:18 CEST 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul 5 10:46:11 2011 +0200| [16a565d0cbb7e753f594236c60bbcc66657024f6] | committer: Michael Niedermayer
eval/fate: try to fix nan printing format failures.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16a565d0cbb7e753f594236c60bbcc66657024f6
---
libavutil/eval.c | 6 +++++-
tests/ref/fate/eval | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 066bf7b..3833ca8 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -659,7 +659,11 @@ int main(int argc, char **argv)
av_expr_parse_and_eval(&d, *expr,
const_names, const_values,
NULL, NULL, NULL, NULL, NULL, 0, NULL);
- printf("'%s' -> %f\n\n", *expr, d);
+ if(isnan(d)){
+ printf("'%s' -> nan\n\n", *expr);
+ }else{
+ printf("'%s' -> %f\n\n", *expr, d);
+ }
}
av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
diff --git a/tests/ref/fate/eval b/tests/ref/fate/eval
index 278c282..7042a01 100644
--- a/tests/ref/fate/eval
+++ b/tests/ref/fate/eval
@@ -134,7 +134,7 @@ Evaluating 'sqrt(1764)'
'sqrt(1764)' -> 42.000000
Evaluating 'sqrt(-1)'
-'sqrt(-1)' -> -nan
+'sqrt(-1)' -> nan
Evaluating 'not(1)'
'not(1)' -> 0.000000
@@ -155,7 +155,7 @@ Evaluating 'PI^1.23'
'PI^1.23' -> 4.087844
Evaluating 'pow(-1,1.23)'
-'pow(-1,1.23)' -> -nan
+'pow(-1,1.23)' -> nan
12.700000 == 12.7
0.931323 == 0.931322575
More information about the ffmpeg-cvslog
mailing list