glib/gio/tests
David Zeuthen bb6530eb34 GDBus: Fix serialization of empty arrays
It turns out that we didn't observe padding (neither when reading nor
writing) for empty arrays which (apparently) is needed according to
the D-Bus spec and reference implementation. A simple test case to
provoke this behavior is as follows (notice the lack of 4 bytes worth
of padding at position 0x0064):

 Error calling dbus_message_demarshal() on this blob: org.freedesktop.DBus.Error.InvalidArgs: Message is corrupted (Alignment padding not null)
 0000: 6c 01 00 01  2e 00 00 00  41 00 00 00  37 00 00 00    l.......A...7...
 0010: 08 01 67 00  08 73 61 7b  73 76 7d 61  73 00 00 00    ..g..sa{sv}as...
 0020: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
 0030: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
 0040: 4d 65 6d 62  65 72 00 00  11 00 00 00  30 31 32 33    Member......0123
 0050: 34 35 36 37  38 39 30 31  32 33 34 35  36 00 00 00    4567890123456...
 0060: 00 00 00 00  0e 00 00 00  09 00 00 00  53 6f 6d 65    ............Some
 0070: 74 68 69 6e  67 00                                    thing.

 The blob was generated from the following GVariant value:
 ('01234567890123456', @a{sv} {}, ['Something'])

 If the blob was encoded using DBusMessageIter, the payload would have been:

 0000: 6c 01 00 01  32 00 00 00  41 00 00 00  36 00 00 00    l...2...A...6...
 0010: 01 01 6f 00  08 00 00 00  2f 66 6f 6f  2f 62 61 72    ..o...../foo/bar
 0020: 00 00 00 00  00 00 00 00  03 01 73 00  06 00 00 00    ..........s.....
 0030: 4d 65 6d 62  65 72 00 00  08 01 67 00  08 73 61 7b    Member....g..sa{
 0040: 73 76 7d 61  73 00 00 00  11 00 00 00  30 31 32 33    sv}as.......0123
 0050: 34 35 36 37  38 39 30 31  32 33 34 35  36 00 00 00    4567890123456...
 0060: 00 00 00 00  00 00 00 00  0e 00 00 00  09 00 00 00    ................
 0070: 53 6f 6d 65  74 68 69 6e  67 00                       Something.
 ** ERROR:gdbus-serialization.c:547:check_serialization: code should not be reached
 Aborted

and this is now in the libdbus-1-using serialization test case.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-14 12:56:09 -04:00
..
schema-tests Add testcases for <range> and <choices> 2010-04-25 20:07:26 -05:00
.gitignore .gitignore updates for gsettings stuff 2010-04-27 17:04:57 -04:00
async-close-output-stream.c Added test cases for g_output_stream_close_async 2010-05-12 09:21:12 +02:00
buffered-input-stream.c Add unit tests for some more methods 2009-12-08 17:05:09 +01:00
contexts.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
converter-stream.c Fix return type of g_converter_[in|out]put_stream. 2009-11-29 15:14:10 +01:00
data-input-stream.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
data-output-stream.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
de.po Merge GSettings tests 2010-04-17 01:48:05 -04:00
desktop-app-info.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
echo-server.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
filter-cat.c Fix GZlibCompressorFormat names 2009-11-24 13:02:05 +01:00
filter-streams.c Another few failing tests disabled 2010-01-25 12:43:10 -05:00
g-file-info.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
g-file.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
g-icon.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
gdbus-addresses.c More copyright year updates 2010-05-10 08:07:28 -04:00
gdbus-connection.c GDBus: Use call() instead of invoke_method() 2010-05-10 11:47:08 -04:00
gdbus-error.c More copyright year updates 2010-05-10 08:07:28 -04:00
gdbus-example-export.c remove the redundant interface_name parameter 2010-05-13 13:09:58 -04:00
gdbus-example-own-name.c Strip copyright headers from examples 2010-05-11 15:50:19 -04:00
gdbus-example-peer.c GDBus: Add GDBusAuthObserver param in g_dbus_connection_new_for_address() 2010-05-13 16:32:11 -04:00
gdbus-example-proxy-subclass.c GDBus: Catch up with new PropertiesChanged signal 2010-05-13 11:56:15 -04:00
gdbus-example-server.c remove the redundant interface_name parameter 2010-05-13 13:09:58 -04:00
gdbus-example-subtree.c Strip copyright headers from examples 2010-05-11 15:50:19 -04:00
gdbus-example-unix-fd-client.c Clean up platform-specific includes 2010-05-13 20:29:04 -04:00
gdbus-example-watch-name.c Strip copyright headers from examples 2010-05-11 15:50:19 -04:00
gdbus-example-watch-proxy.c GDBus: Don't take a GError for g_dbus_proxy_get_cached_property_names() 2010-05-13 17:10:15 -04:00
gdbus-exit-on-close.c More copyright year updates 2010-05-10 08:07:28 -04:00
gdbus-export.c remove the redundant interface_name parameter 2010-05-13 13:09:58 -04:00
gdbus-introspection.c More !srcdir build fixes 2010-05-14 10:25:31 -04:00
gdbus-names.c GDBus: Use call() instead of invoke_method() 2010-05-10 11:47:08 -04:00
gdbus-peer.c Clean up platform-specific includes 2010-05-13 20:29:04 -04:00
gdbus-proxy.c Fix !srcdir build 2010-05-14 01:36:25 -04:00
gdbus-serialization.c GDBus: Fix serialization of empty arrays 2010-05-14 12:56:09 -04:00
gdbus-sessionbus.c More copyright year updates 2010-05-10 08:07:28 -04:00
gdbus-sessionbus.h Initial GDBus code-drop from GDBus-standalone repo 2010-05-06 14:21:32 -04:00
gdbus-tests.c GDBus: Add GDBusAuthObserver param in g_dbus_connection_new_for_address() 2010-05-13 16:32:11 -04:00
gdbus-tests.h Initial GDBus code-drop from GDBus-standalone repo 2010-05-06 14:21:32 -04:00
gdbus-testserver.py GDBus: Catch up with new PropertiesChanged signal 2010-05-13 11:56:15 -04:00
gdbus-threading.c More !srcdir build fixes 2010-05-14 10:25:31 -04:00
gschema-compile.c Add testcases for <range> and <choices> 2010-04-25 20:07:26 -05:00
gsettings.c check for working gettext() before running tests 2010-05-14 01:01:40 +02:00
httpd.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
live-g-file.c Don't fail a couple of tests when running as root 2010-02-22 19:54:38 +01:00
live-g-file.txt Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
Makefile.am another !srcdir build fix 2010-05-14 10:49:03 -04:00
memory-input-stream.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
memory-output-stream.c Add properties to GMemoryOutputStream 2010-01-06 17:37:11 -05:00
org.gtk.test.gschema Merge GSettings tests 2010-04-17 01:48:05 -04:00
org.gtk.test.gschema.xml Add testcase for g_settings_bind with [u]int64 properties 2010-04-19 10:00:03 -04:00
readwrite.c Test for unexisting files in $TMP and not in $HOME 2010-02-23 18:37:39 +01:00
resolver.c Bug 591216 - Warning building resolver.o 2009-11-11 23:21:48 -05:00
send-data.c Fix leaks in GSocketClient and GThreadedResolver 2009-07-23 16:27:01 -04:00
simple-async-result.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
sleepy-stream.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
socket-client.c remove broken useless initialization in socket-client/socket-server 2010-05-07 19:08:13 -04:00
socket-common.c gio/tests/socket-client, socket-server: fix for win32 2010-04-23 12:24:30 -04:00
socket-server.c remove broken useless initialization in socket-client/socket-server 2010-05-07 19:08:13 -04:00
srvtarget.c Revert "Move gio tests from gio/tests/ to tests/gio/" 2009-07-05 22:49:24 -04:00
unix-fd.c GUnixSocketAddress: handle abstract sockets with non-0-padded names 2010-04-22 11:54:41 -04:00
unix-streams.c Fix compilation warning: Initialize the variable 2009-11-17 20:44:16 +01:00
win32-streams.c Add GWin32InputStream and GWin32OutputStream classes 2010-04-19 11:54:56 +03:00