diff options
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 61a76864..c54f379f 100644 --- a/tests/serd_test.c +++ b/tests/serd_test.c @@ -178,6 +178,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 }; |