From: Stoian Ivanov Date: Thu, 6 Oct 2016 20:32:19 +0000 (+0300) Subject: gitignore test; add double value set checks in test X-Git-Tag: json-c-0.13-20171207~121^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a313f767f42dfdaa957ae836a1a7f20438baba4;p=json-c gitignore test; add double value set checks in test --- diff --git a/.gitignore b/.gitignore index ac8d17c..68b6fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ /tests/test_set_serializer /tests/test_compare /tests/test_util_file +/tests/test_set_value /tests/*.vg.out /tests/*.log /tests/*.trs diff --git a/tests/test_set_value.c b/tests/test_set_value.c index a321260..f64924c 100644 --- a/tests/test_set_value.c +++ b/tests/test_set_value.c @@ -23,8 +23,14 @@ int main(int argc, char **argv) assert (json_object_get_boolean(tmp)==TRUE); json_object_put(tmp); printf("BOOL PASSED\n"); - - + tmp=json_object_new_double(12.34); + assert (json_object_get_double(tmp)==12.34); + json_object_set_double(tmp,34.56); + assert (json_object_get_double(tmp)==34.56); + json_object_set_double(tmp,6435.34); + assert (json_object_get_double(tmp)==6435.34); + json_object_put(tmp); + printf("DOUBLE PASSED\n"); printf("PASSED\n"); return 0; } diff --git a/tests/test_set_value.expected b/tests/test_set_value.expected index 0ac57fe..ccc3f5c 100644 --- a/tests/test_set_value.expected +++ b/tests/test_set_value.expected @@ -1,4 +1,5 @@ INT PASSED INT64 PASSED BOOL PASSED +DOUBLE PASSED PASSED