summaryrefslogtreecommitdiff
path: root/tests/util.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2010-01-29 18:03:08 +1100
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2010-03-23 22:06:52 +1100
commit417e72c2140c296457065333b698b4412a22a7db (patch)
treec691ddc1d069924eb3b63648256de8480ff3cb27 /tests/util.c
parent0d5d659b9ae48183acc0ffa2d3460b4b8dea0715 (diff)
tp_value_array_unpack() a reverse to tp_value_array_build()
Diffstat (limited to 'tests/util.c')
-rw-r--r--tests/util.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/util.c b/tests/util.c
index 0c094562..c3adc3dc 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -27,16 +27,25 @@ test_value_array_build (void)
GValueArray *arr;
const gchar *host = "badger.snakes";
guint port = 128;
+ gchar *host_out = NULL;
+ guint port_out = 1234;
arr = tp_value_array_build (2,
G_TYPE_STRING, host,
G_TYPE_UINT, port,
G_TYPE_INVALID);
- g_assert (!tp_strdiff (g_value_get_string (g_value_array_get_nth (arr, 0)),
- host));
+ g_assert_cmpstr (g_value_get_string (g_value_array_get_nth (arr, 0)), ==,
+ host);
+ g_assert_cmpuint (g_value_get_uint (g_value_array_get_nth (arr, 1)), ==,
+ port);
- g_assert (g_value_get_uint (g_value_array_get_nth (arr, 1)) == port);
+ tp_value_array_unpack (arr, 2,
+ &host_out,
+ &port_out);
+
+ g_assert_cmpstr (host_out, ==, host);
+ g_assert_cmpuint (port_out, ==, port);
g_value_array_free (arr);
}