summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-26 14:28:40 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-26 16:30:46 +0100
commitaa407653e274480ae63b21017869e07de3a1aa4e (patch)
tree457aa101d5ddb7e5d50bcee1b805478067460967 /tests
parente6ac4848a0e613087b024af9f4c21fec3ee509ef (diff)
downloadtelepathy-glib-aa407653e274480ae63b21017869e07de3a1aa4e.tar.gz
Make more use of tp_value_array_unpack, tp_value_array_build
As well as being less code, they're not flagged as deprecated. This requires a bit of extra copying, because there's no tp_value_array_unpack_dup() or tp_value_array_build_take(), but it seems worth it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/contacts-conn.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/lib/contacts-conn.c b/tests/lib/contacts-conn.c
index 6cca69f02..9d4387bfb 100644
--- a/tests/lib/contacts-conn.c
+++ b/tests/lib/contacts-conn.c
@@ -638,21 +638,15 @@ tp_tests_contacts_connection_change_aliases (TpTestsContactsConnection *self,
for (i = 0; i < n; i++)
{
- GValueArray *pair = g_value_array_new (2);
+ GValueArray *pair = tp_value_array_build (2,
+ G_TYPE_UINT, handles[i],
+ G_TYPE_STRING, aliases[i],
+ G_TYPE_INVALID);
DEBUG ("contact#%u -> %s", handles[i], aliases[i]);
g_hash_table_insert (self->priv->aliases,
GUINT_TO_POINTER (handles[i]), g_strdup (aliases[i]));
-
- g_value_array_append (pair, NULL);
- g_value_init (pair->values + 0, G_TYPE_UINT);
- g_value_set_uint (pair->values + 0, handles[i]);
-
- g_value_array_append (pair, NULL);
- g_value_init (pair->values + 1, G_TYPE_STRING);
- g_value_set_string (pair->values + 1, aliases[i]);
-
g_ptr_array_add (structs, pair);
}