Commit graph

8 commits

Author SHA1 Message Date
Simon McVittie
8095e52e5c test/marshal: Don't leak a message and its marshalled buffer
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
2018-08-02 17:16:14 +01:00
Simon McVittie
e95dc1d58f tests: Call dbus_shutdown()
Not all of these tests will be fully valgrind-clean yet (or perhaps
ever), but it's easier to add this to all of them than to think
about it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107194
2018-08-02 17:14:39 +01:00
Simon McVittie
94610d7de6 Add a common test_init() for GLib tests which prevents hanging forever
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
2015-02-04 17:15:36 +00:00
Simon McVittie
30e7a81302 Tests: allow dbus-glib to be replaced with use of libdbus-internal
We only use dbus-glib for its main loop; within dbus, DBusLoop is
available as an alternative, although it isn't thread-safe and
isn't public API.

For tests that otherwise only use libdbus public API, it's desirable to
be able to avoid DBusLoop, so we can run them against an installed
libdbus as an integration test. However, if we don't have dbus-glib,
we're going to have to use an in-tree main loop, which might as well
be DBusLoop.

The major disadvantage of using dbus-glib is that it isn't safe to
link both dbus-1 and dbus-internal at the same time. This is awkward
for a future test case that wants to use _dbus_getsid() in dbus-daemon.c,
but only on Windows (fd.o #54445). If we use the same API wrapper around
both dbus-glib and DBusLoop, we can compile that test against dbus-glib
or against DBusLoop, depending on the platform.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-09-03 12:00:51 +01:00
Colin Walters
2de11abd56 test/marshal: Ensure we use suitably aligned buffers
This test was failing on s390; though it could fail
on other platforms too.  Basically we need to be sure
we're passing at least word-aligned buffers to the
demarshalling code.  malloc() will do that for us.

https://bugs.freedesktop.org/show_bug.cgi?id=67279
2013-07-24 17:52:58 -04:00
Simon McVittie
0c4a2087c6 Remove various never-used variables
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-08-05 12:26:51 +01:00
Simon McVittie
b92612945a marshal test: test dbus_message_demarshal_bytes_needed
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:49 +01:00
Simon McVittie
bf421f5a30 Add a test for marshalling and endian-swapping
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38120
2011-06-10 18:32:43 +01:00