aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-01-07 20:04:59 +0100
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commit9428a46392dd414d05a1126016d5894494a717c3 (patch)
tree09e2a3e72193a5f5556d91c7166ad04585c8329a
parent00cb5c4f38b36ed3daa074ecdfffcd4676b11468 (diff)
downloadserd-9428a46392dd414d05a1126016d5894494a717c3.tar.gz
serd-9428a46392dd414d05a1126016d5894494a717c3.tar.bz2
serd-9428a46392dd414d05a1126016d5894494a717c3.zip
Fix implicit float to double conversion warning
-rw-r--r--tests/serd_test.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 92d23aae..6f323f43 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -159,13 +159,27 @@ main(void)
// Test serd_new_decimal
- const double dbl_test_nums[] = {
- 0.0, 9.0, 10.0, .01, 2.05, -16.00001, 5.000000005, 0.0000000001, NAN, INFINITY
- };
-
- const char* dbl_test_strs[] = {
- "0.0", "9.0", "10.0", "0.01", "2.05", "-16.00001", "5.00000001", "0.0", NULL, NULL
- };
+ const double dbl_test_nums[] = { 0.0,
+ 9.0,
+ 10.0,
+ .01,
+ 2.05,
+ -16.00001,
+ 5.000000005,
+ 0.0000000001,
+ (double)NAN,
+ (double)INFINITY };
+
+ const char* dbl_test_strs[] = { "0.0",
+ "9.0",
+ "10.0",
+ "0.01",
+ "2.05",
+ "-16.00001",
+ "5.00000001",
+ "0.0",
+ NULL,
+ NULL };
for (unsigned i = 0; i < sizeof(dbl_test_nums) / sizeof(double); ++i) {
SerdNode* node = serd_new_decimal(dbl_test_nums[i], 8, NULL);