summaryrefslogtreecommitdiff
path: root/json-glib/tests
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2014-02-13 22:21:18 +0100
committerStef Walter <stefw@redhat.com>2015-01-26 07:39:40 +0100
commit80e44db76dd179e4c12d1a11b24f27c7548dc382 (patch)
tree228e7e31a0fccdd9d432eaa393061ef6c5b4577b /json-glib/tests
parentaee569b0bc2542aa8f1d13d66ddadacbda1035ac (diff)
downloadjson-glib-80e44db76dd179e4c12d1a11b24f27c7548dc382.tar.gz
json-gvariant: Parse json doubles that are whole numbers
The json gvariant serializer encodes whole number doubles without a dot. The deserializer needs to be able to parse these as well. Fix problem, and add test cases. https://bugzilla.gnome.org/show_bug.cgi?id=724319
Diffstat (limited to 'json-glib/tests')
-rw-r--r--json-glib/tests/gvariant.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/json-glib/tests/gvariant.c b/json-glib/tests/gvariant.c
index 38c56b7..701997d 100644
--- a/json-glib/tests/gvariant.c
+++ b/json-glib/tests/gvariant.c
@@ -44,6 +44,9 @@ static const TestCase two_way_test_cases[] =
/* double */
{ "/double", "(d)", "(1.23,)", "[1.23]" },
+ /* double */
+ { "/double-whole", "(d)", "(123.0,)", "[123]" },
+
/* string */
{ "/string", "(s)", "('hello world!',)", "[\"hello world!\"]" },
@@ -155,6 +158,7 @@ static const TestCase json_to_gvariant_test_cases[] =
{ "/string-to-int64", "(x)", "(int64 -666999666999,)", "[\"-666999666999\"]" },
{ "/string-to-uint64", "(t)", "(uint64 1999999999999999,)", "[\"1999999999999999\"]" },
{ "/string-to-double", "(d)", "(1.23,)", "[\"1.23\"]" },
+ { "/string-to-double-whole", "(d)", "(123.0,)", "[\"123\"]" },
};
static void