summaryrefslogtreecommitdiff
path: root/json-glib/tests/node.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2012-06-30 14:39:13 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2012-06-30 14:39:13 +0100
commitb6aad8b53e9250c6b7e9c8c7302c5f8bde3a2c72 (patch)
tree9d7eace9058592f9e156092df18958d7a0e08d08 /json-glib/tests/node.c
parent9fd65a138d6ec46b94eaf807f9c87ea5ada11cf0 (diff)
downloadjson-glib-b6aad8b53e9250c6b7e9c8c7302c5f8bde3a2c72.tar.gz
Improve test coverage
Diffstat (limited to 'json-glib/tests/node.c')
-rw-r--r--json-glib/tests/node.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/json-glib/tests/node.c b/json-glib/tests/node.c
index 13f16f0..a50d980 100644
--- a/json-glib/tests/node.c
+++ b/json-glib/tests/node.c
@@ -105,6 +105,7 @@ test_null (void)
JsonNode *node = json_node_new (JSON_NODE_NULL);
g_assert (JSON_NODE_HOLDS_NULL (node));
+ g_assert (json_node_is_null (node));
g_assert_cmpint (json_node_get_value_type (node), ==, G_TYPE_INVALID);
g_assert_cmpstr (json_node_type_name (node), ==, "NULL");
@@ -136,6 +137,23 @@ test_gvalue (void)
g_value_unset (&value);
g_value_unset (&check);
+
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, "Hello, World!");
+
+ g_assert_cmpint (G_VALUE_TYPE (&value), ==, G_TYPE_STRING);
+ g_assert_cmpstr (g_value_get_string (&value), ==, "Hello, World!");
+
+ json_node_set_value (node, &value);
+ json_node_get_value (node, &check);
+
+ g_assert_cmpint (G_VALUE_TYPE (&value), ==, G_VALUE_TYPE (&check));
+ g_assert_cmpstr (g_value_get_string (&value), ==, g_value_get_string (&check));
+ g_assert_cmpint (G_VALUE_TYPE (&check), ==, G_TYPE_STRING);
+ g_assert_cmpstr (g_value_get_string (&check), ==, "Hello, World!");
+
+ g_value_unset (&value);
+ g_value_unset (&check);
json_node_free (node);
}