summaryrefslogtreecommitdiff
path: root/tests/gvariant-iter.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gvariant-iter.c')
-rw-r--r--tests/gvariant-iter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/gvariant-iter.c b/tests/gvariant-iter.c
index 37865ff..ff36db7 100644
--- a/tests/gvariant-iter.c
+++ b/tests/gvariant-iter.c
@@ -9,10 +9,12 @@
GVariant *value;
gchar *key;
+ dictionary = g_variant_new_array ((const GVariantType *) "{sv}", NULL, 0);
g_variant_iter_init (&iter, dictionary);
while (g_variant_iter_loop (&iter, "{sv}", &key, &value)) {
/* Something */
}
+ g_variant_unref (dictionary);
}
/*
@@ -26,10 +28,12 @@
gchar *not_a_value;
gchar *key;
+ dictionary = g_variant_new_array ((const GVariantType *) "{sv}", NULL, 0);
g_variant_iter_init (&iter, dictionary);
while (g_variant_iter_loop (&iter, "{sv}", &key, &not_a_value)) {
/* Something */
}
+ g_variant_unref (dictionary);
}
/*
@@ -41,6 +45,7 @@
GVariant *value;
gchar *key;
+ dictionary = g_variant_new_array ((const GVariantType *) "{sv}", NULL, 0);
g_variant_iter_init (&iter, dictionary);
while (g_variant_iter_next (&iter, "{sv}", &key, &value)) {
/* Something */
@@ -48,6 +53,7 @@
g_variant_unref (value);
g_free (key);
}
+ g_variant_unref (dictionary);
}
/*
@@ -61,6 +67,7 @@
gchar *not_a_value;
gchar *key;
+ dictionary = g_variant_new_array ((const GVariantType *) "{sv}", NULL, 0);
g_variant_iter_init (&iter, dictionary);
while (g_variant_iter_next (&iter, "{sv}", &key, &not_a_value)) {
/* Something */
@@ -68,4 +75,5 @@
g_free (not_a_value);
g_free (key);
}
+ g_variant_unref (dictionary);
}