[glib/gvariant-varargs: 3/5] test g_variant_iter_copy
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gvariant-varargs: 3/5] test g_variant_iter_copy
- Date: Mon, 8 Mar 2010 00:11:06 +0000 (UTC)
commit 18ada4290de8f1482d8e67354b116484f7db86b9
Author: Ryan Lortie <desrt desrt ca>
Date: Sat Mar 6 11:28:38 2010 -0500
test g_variant_iter_copy
glib/tests/gvariant.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index ca38c53..d6b9541 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -2959,6 +2959,7 @@ test_varargs (void)
GVariantBuilder builder;
GVariantIter iter;
GVariantIter *i2;
+ GVariantIter *i3;
GVariant *value;
GVariant *sub;
gchar **strv;
@@ -2998,6 +2999,7 @@ test_varargs (void)
}
g_variant_iter_init (&iter, value);
+ i3 = g_variant_iter_copy (&iter);
while (g_variant_iter_loop (&iter, "@ag", &sub))
{
gchar *str = g_variant_print (sub, TRUE);
@@ -3006,8 +3008,14 @@ test_varargs (void)
g_free (str);
}
- g_variant_iter_init (&iter, value);
- while (g_variant_iter_loop (&iter, "*", &sub))
+ if (do_failed_test ("*NULL has already been returned*"))
+ {
+ g_variant_iter_next_value (&iter);
+ abort ();
+ }
+
+
+ while (g_variant_iter_loop (i3, "*", &sub))
{
gchar *str = g_variant_print (sub, TRUE);
g_assert_cmpstr (str, ==,
@@ -3015,6 +3023,8 @@ test_varargs (void)
g_free (str);
}
+ g_variant_iter_free (i3);
+
for (i = 0; i < g_variant_n_children (value); i++)
{
gint j;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]