diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-24 00:56:48 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-24 00:56:48 +0000 |
commit | d8b5dd586db230db3f09bedba9bfc0bdb254fe57 (patch) | |
tree | cc03414893089bec421e755efb949a76d470fe6e /test/data/number | |
parent | f235d82dccb499f1af06e7ef3e1d7b9b57c12014 (diff) | |
download | libcss-d8b5dd586db230db3f09bedba9bfc0bdb254fe57.tar.gz libcss-d8b5dd586db230db3f09bedba9bfc0bdb254fe57.tar.bz2 |
Fix number parsing and make test code automatically determine correctness.
More test data, which covers everything.
Fix includes in libcss/types.h
svn path=/trunk/libcss/; revision=5764
Diffstat (limited to 'test/data/number')
-rw-r--r-- | test/data/number/number.dat | 102 |
1 files changed, 94 insertions, 8 deletions
diff --git a/test/data/number/number.dat b/test/data/number/number.dat index 0aeb6d0..a8c9cae 100644 --- a/test/data/number/number.dat +++ b/test/data/number/number.dat @@ -1,48 +1,134 @@ #data 1 #expected -1 +1.000 #reset #data .0 #expected -.0 +0.000 #reset #data .5 #expected -.5 +0.500 #reset #data .999 #expected -.999 +0.999 #reset #data 2097151 #expected -2097151 +2097151.000 #reset +# Test INT_MAX + 1. Note that, in converting the result to float, +# we'll end up with INT_MAX + 1 as the output. #data 2097152 #expected -2097151.999 +2097152.000 #reset #data --2097152 +-1 +#expected +-1.000 +#reset + +#data +-.0 +#expected +0.000 +#reset + +#data +-.5 #expected +-0.500 +#reset + +#data +-.999 +#expected +-0.999 +#reset + +#data +-2097151 +#expected +-2097151.000 +#reset + +#data -2097152 +#expected +-2097152.000 #reset #data -2097153 #expected --2097152.999 +-2097152.000 +#reset + +#data +-x +#expected +0.000 +#reset + +#data ++x +#expected +0.000 +#reset + +#data +x +#expected +0.000 +#reset + +#data +1.x +#expected +1.000 +#reset + +#data +.x +#expected +0.000 +#reset + +#data +- +#expected +0.000 +#reset + +#data ++ +#expected +0.000 +#reset + +#data +0.12345 +#expected +0.123 +#reset + +#data +0.12367 +#expected +0.124 #reset |