Commit Graph

671 Commits

Author SHA1 Message Date
Tomas Bzatek
032e8dabd1 gdbus: Implement g_dbus_connection_get_last_serial()
This patch brings an ability to retrieve serial number of the last
message sent within the current thread.

https://bugzilla.gnome.org/show_bug.cgi?id=676825
2012-06-06 19:44:39 +02:00
Matthias Clasen
3e1b972c93 Improve GResource test coverage 2012-06-04 06:04:29 -04:00
Matthias Clasen
c7de2dd0e3 Improve GSocketAddress test coverage 2012-06-04 06:04:29 -04:00
Matthias Clasen
721366d088 Improve GNetworkMonitor test coverage 2012-06-04 06:04:29 -04:00
Matthias Clasen
4ad5210b35 Improve GIcon test coverage 2012-06-04 06:04:29 -04:00
Matthias Clasen
eeb5140ad2 Improve GMenu test coverage 2012-06-04 06:04:28 -04:00
Matthias Clasen
0a1079d171 Improve GApplication test coverage 2012-06-04 06:04:28 -04:00
Matthias Clasen
642e89f356 Improve GActionGroup test coverage 2012-06-04 06:04:27 -04:00
Matthias Clasen
a53a1b65b5 Improve GIcon test coverage 2012-06-04 06:04:27 -04:00
Matthias Clasen
26a1056bde Expand GAppInfo tests 2012-06-04 06:04:26 -04:00
Dan Winship
69e12cd3d5 GConverterInputStream: fix an edge case
Reading from a GConverterInputStream with both input_buffer and
converted_buffer non-empty would return bogus data (the data from
converted_buffer would essentially get skipped over, though the
returned nread reflected what the count would be if it hadn't been).

This was never noticed before because (a) it can't happen if all of
your reads are at least as large as either the internal buffer size or
the remaining length of the stream (which covers most real-world use),
and (b) it can't happen if all of your reads are 1 byte (which covers
most of tests/converter-test). (And (c) it only happens for some
converters/input streams.) But this was happening occasionally in
libsoup when content-sniffing a gzipped response, because the
SoupContentSnifferStream would first read 512 bytes (to sniff), and
then pass through larger reads after that.

Fixed and added a test to converter-test.

https://bugzilla.gnome.org/show_bug.cgi?id=676478
2012-05-30 09:02:33 -04:00
Christian Persch
4979c1d075 application: Add dbus register/unregister hooks
When the application is using its D-Bus backend, it is useful to be able
to export extra D-Bus objects at the right time, i.e. *before* the application
tries to own the bus name. This is accomplished here by adding a hook
in GApplicationClass for this; and a corresponding hook that will be called
on unregistration to undo whatever the register hook did.

Bug #675509.
2012-05-29 19:01:42 +02:00
Dan Winship
800d6ff111 gio: add GBytes-based input/output stream methods
Using a caller-supplied buffer for g_input_stream_read() doesn't
translate well to the semantics of many other languages, and using a
non-refcounted buffer for read_async() and write_async() makes it
impossible to manage the memory correctly currently in
garbage-collected languages.

Fix both of these issues by adding a new set of methods that work with
GBytes objects rather than plain buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=671139
2012-05-24 17:48:13 -04:00
Colin Walters
44d4990442 GMemoryOutputStream: Add API to return data as a GBytes
Matches the corresponding additions to GMemoryInputStream.

https://bugzilla.gnome.org/show_bug.cgi?id=672102
2012-05-21 13:45:15 -04:00
Dan Winship
8df2b96a69 proxy-test: work even when the upstream DNS lies
Rather than depending on the host's DNS configuration to properly
return an error for a non-existent hostname, just substitute in
a dummy GResolver implementation that does it for us.
2012-05-18 12:18:23 -04:00
Dan Winship
447a25ea50 update .gitignore 2012-05-16 12:00:44 -04:00
Giovanni Campagna
0417ddab6f GAppInfo: add a mechanism to query supported content types
This essentially adds an accessor for the MimeType field in desktop files,
to retrieve the list of all mime types supported by an application.
The interface though is part of GAppInfo, so it could be implemented
in the future by other backends.

https://bugzilla.gnome.org/show_bug.cgi?id=674111
2012-05-16 12:42:12 +02:00
Ryan Lortie
b31d872081 tests: temporarily disable GDBus async proxy test
It has never worked properly and, with the new GDBus testing stuff, it's
occasionally failing.

https://bugzilla.gnome.org/show_bug.cgi?id=672248
2012-05-01 15:16:05 -07:00
Ryan Lortie
56ca8add10 contenttype test: don't pass -1 as length
g_content_type_guess() takes a gsize, not a gssize, and -1 does not mean
"I am passing a NULL terminated string".
2012-05-01 15:16:05 -07:00
Dan Winship
7d4d0668b3 Update gio/tests/.gitignore 2012-04-30 09:28:42 -04:00
Dan Winship
c37273dccb fix warnings 2012-04-30 09:28:42 -04:00
Dieter Verfaillie
b053f990c9 win32: More srcdir != builddir fixing 2012-04-24 16:39:21 +02:00
Maciej Piechotka
a44e801983 Make GDataOutputStream implement GSeekable
https://bugzilla.gnome.org/show_bug.cgi?id=673034
2012-04-23 10:57:12 +02:00
Maciej Piechotka
43895e3089 Make GBufferedOutputStream implement GSeekable
https://bugzilla.gnome.org/show_bug.cgi?id=673034
2012-04-23 10:57:07 +02:00
Maciej Piechotka
90739baec0 Make GBufferedInputStream implement GSeekable
https://bugzilla.gnome.org/show_bug.cgi?id=673034
2012-04-23 10:57:01 +02:00
Dan Winship
2a37bc0dc6 gio: add a proxy test program
Test GProxy, GProxyResolver, GProxyAddress, and
GProxyAddressEnumerator, plus GSocketClient's proxy-resolving
codepaths.
2012-04-22 15:24:36 -04:00
Alexander Larsson
0d8b1b14d2 Add gdbus-daemon test app 2012-04-20 15:02:48 +02:00
Alexander Larsson
21e049b253 Tests: Move dbus specific tests to if HAVE_DBUS_DAEMON
These used to only be built on unix, but if you have dbus-daemon on
win32 we should really build them there too.
2012-04-19 18:19:10 +02:00
Alexander Larsson
234ddf131b Fix test building on win32 2012-04-19 18:19:10 +02:00
Alexander Larsson
0d9a7f2117 Remove ununsed include 2012-04-19 10:24:08 +02:00
Alexander Larsson
b77af49b0a Fix race in gdbus-connection test
We need to flush the AddMatches before even connecting to the bus, or we
risk missing the NameOwnerChanged from the new connections.
2012-04-19 10:24:08 +02:00
Xavier Claessens
415a8d81f6 Use GTestDBus in all GDBus unit tests
To make port easier, this rewrites dbus-sessionbus.c using a
GTestDBus singleton internally.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
2012-04-19 10:07:39 +02:00
David Zeuthen
a6f83d73e5 Revert "Add GTestDBus object"
This reverts commit 1b5f70b5b0.
2012-04-18 13:47:51 -04:00
David Zeuthen
9dce93514e GMenuModel: Don't leak GDBusConnection in test
See https://bugzilla.gnome.org/show_bug.cgi?id=672985#c89

Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-04-18 13:33:00 -04:00
Xavier Claessens
1b5f70b5b0 Add GTestDBus object
This is a helper to write unit tests using a private dbus-daemon.

session_bus_up/down() are now just wrappers around a GTestDBus singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
2012-04-18 11:19:13 -04:00
David Zeuthen
7f5f47ae15 gdbus-codegen: Don't leak stuff in tests
Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-04-17 17:51:55 -04:00
Dan Winship
82ec4dcaed gio: implement GPollableInput/OutputStream in more stream types
Implement GPollableInputStream in GMemoryInputStream and
GConverterInputStream, and likewise implement GPollableOutputStream in
the corresponding output streams.

https://bugzilla.gnome.org/show_bug.cgi?id=673997
2012-04-17 12:33:12 -04:00
Kalev Lember
b3b32be1e1 Only build gmenumodel test on unix
It depends on gdbus-sessionbus.c which only builds on unix.
2012-04-16 18:46:12 +03:00
Stef Walter
666374c16f Add support for MX, TXT, NS and SOA records to GResolver
* Add resolver functions for looking up DNS records of
   various types. Currently implemented: MX, TXT, SOA, SRV, NS
 * Return records as GVariant tuples.
 * Make the GSrvTarget lookups a wrapper over this new
   functionality.
 * Rework the resolver test so that it has support for
   looking up MX, NS, SOA, TXT records, and uses GOptionContext

https://bugzilla.gnome.org/show_bug.cgi?id=672944
2012-04-16 15:51:39 +02:00
David Zeuthen
b9d1fe7db2 Check that auth methods work and interoperate with libdbus-1
See https://bugzilla.gnome.org/show_bug.cgi?id=673943

Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-04-14 12:33:14 -04:00
Giovanni Campagna
bb7f3e0cbd GDesktopAppInfo: add an accessor for StartupWMClass
Components using GIO to do window to application matching can
use that field to retrieve potential candidates.

https://bugzilla.gnome.org/show_bug.cgi?id=673659
2012-04-14 02:44:25 +02:00
Will Thompson
c037879bd1 gdbus: test case for 673612
When presented with an array of empty arrays of 8-byte-aligned types,
GDBus would incorrectly apply the 8-byte alignment when reading back.

https://bugzilla.gnome.org/show_bug.cgi?id=673612

Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-04-10 16:39:49 -04:00
Matthias Clasen
43806fca69 settings: Improve test coverage 2012-04-08 10:24:51 -04:00
Matthias Clasen
3072e7afee gdbusserver: Improve test coverage 2012-04-08 10:24:51 -04:00
Matthias Clasen
26145b9708 icon: Improve test coverage 2012-04-08 10:24:51 -04:00
Matthias Clasen
a8c869e945 contenttype: Improve test coverage
Excercise more parts of the guessing machinery.
These tests rely on the mime database being present.
2012-04-08 10:24:51 -04:00
Matthias Clasen
1e2cf010e7 networkaddress: Improve test coverage 2012-04-08 10:24:51 -04:00
Matthias Clasen
6a57bf1243 Make the dbus menu tests independent from the session bus
With this change,
DBUS_SESSION_BUS_ADDRESS= make check
succeed here.
2012-04-08 10:24:50 -04:00
Matthias Clasen
d036960d30 ifdef out some unused code
Nothing wrong with leaving debug spew in the code, but we should
not build it if it is not used.
2012-04-08 10:24:50 -04:00
Matthias Clasen
d0b429af48 Revert "GDesktopAppInfo: add an accessor for StartupWMClass"
This reverts commit 3ccc4cf91d.
2012-04-06 19:15:53 -04:00