diff options
author | David Robillard <d@drobilla.net> | 2019-12-18 20:05:18 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-06-21 18:12:03 +0200 |
commit | edf4beae75709472bfc29a824afdd0184fc65337 (patch) | |
tree | 2bec6280a93c84536190bf76b8eb6cf6e4cd7716 /tests | |
parent | 654d0cffd006573d7eedba19fbf2e627f04737b3 (diff) | |
download | serd-edf4beae75709472bfc29a824afdd0184fc65337.tar.gz serd-edf4beae75709472bfc29a824afdd0184fc65337.tar.bz2 serd-edf4beae75709472bfc29a824afdd0184fc65337.zip |
Add support for parsing NaN, INF, and -INF
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serd_test.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c index 85c9db27..5ab22846 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -179,6 +179,16 @@ test_string_to_double(void) test_strtod(dbl, 1 / (double)MAX); } + size_t end = 0; + assert(isnan(serd_strtod("NaN", &end))); + assert(end == 3); + + assert(serd_strtod("INF", &end) == INFINITY); + assert(end == 3); + + assert(serd_strtod("-INF", &end) == -INFINITY); + assert(end == 4); + const double expt_test_nums[] = { 2.0E18, -5e19, +8e20, 2e+24, -5e-5, 8e0, 9e-0, 2e+0 }; |