summaryrefslogtreecommitdiffstats
path: root/test/glib
diff options
context:
space:
mode:
authorRobert McQueen <robot101@debian.org>2006-02-16 00:43:41 +0000
committerRobert McQueen <robot101@debian.org>2006-02-16 00:43:41 +0000
commit0d0642b31b9bac2546f9fa2c6bdc55b5ced0b7ad (patch)
treed8d1984ad270e2ca3db2e73b04e3b0dfcd5e69a6 /test/glib
parent397b0a4ec150c4400de8a041d077c819f6e978bd (diff)
2006-02-16 Robert McQueen <robot101@debian.org>
* dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Patch from Rob Taylor <rob.taylor@collabora.co.uk> to correct a bogus assertion that the next element to read from the iter is fixed in size. This is not the case when you are at the end of the iter, because the next element type is INVALID. * dbus/dbus-string.c (_dbus_string_init_const_len): Correct a a bogus assert which means that you may not initialise a 0-length string unless you provide a non-NULL pointer. This prevented you from marshalling messages containing zero-length arrays in some cases. * glib/dbus-gvalue.c (demarshal_collection_array): Another patch from Rob to correct bogus asserts when trying to demarshal an array and get_fixed_array got you 0 elements. Append nothing to the GArray in this case. * test/glib/test-dbus-glib.c: Add a test case for round-tripping an empty array via the glib bindings. Without all of the above patches, this new test fails.
Diffstat (limited to 'test/glib')
-rw-r--r--test/glib/test-dbus-glib.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/glib/test-dbus-glib.c b/test/glib/test-dbus-glib.c
index 0a99eda2..ebcfaeaa 100644
--- a/test/glib/test-dbus-glib.c
+++ b/test/glib/test-dbus-glib.c
@@ -761,6 +761,21 @@ main (int argc, char **argv)
{
GArray *array;
+ guint32 arraylen;
+
+ array = g_array_new (FALSE, TRUE, sizeof (guint32));
+
+ arraylen = 0;
+ g_print ("Calling (wrapped) zero-length recursive1\n");
+ if (!org_freedesktop_DBus_Tests_MyObject_recursive1 (proxy, array,
+ &arraylen, &error))
+ lose_gerror ("Failed to complete (wrapped) zero-length recursive1 call", error);
+ if (arraylen != 0)
+ lose ("(wrapped) zero-length recursive1 call returned invalid length %u", arraylen);
+ }
+
+ {
+ GArray *array;
guint32 val;
guint32 arraylen;