aboutsummaryrefslogtreecommitdiffstats
path: root/tests/serd_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/serd_test.c')
-rw-r--r--tests/serd_test.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index c44fcb2f..dfa3d397 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -38,13 +38,18 @@ test_strtod(double dbl, double max_delta)
char buf[1024];
snprintf(buf, sizeof(buf), "%f", dbl);
- char* endptr = NULL;
- const double out = serd_strtod(buf, &endptr);
+ size_t end = 0;
+ const double out = serd_strtod(buf, &end);
const double diff = fabs(out - dbl);
if (diff > max_delta) {
FAILF("Parsed %lf != %lf (delta %lf)\n", dbl, out, diff);
}
+
+ if (end != strlen(buf)) {
+ FAILF("Parsed %lf length %zu != %zu\n", end, strlen(buf));
+ }
+
return 0;
}