Commit Graph

580 Commits

Author SHA1 Message Date
Ryan Lortie
148f731748 Add test case and fix some bugs
Add the first test case for the schema source functionality and fix a
couple of bugs that got uncovered by that.
2011-11-17 14:03:39 +00:00
Benjamin Otte
6fe9791f24 gio: Add tests for g_file_attribute_matcher_subtract() 2011-11-16 17:21:21 +01:00
Benjamin Otte
60c42f6648 tests: Add tests for fileattributematchers 2011-11-16 17:18:58 +01:00
Dan Winship
74dad004d1 GUnixInput/OutputStream: fix blocking methods to always block
Previously, if you created a GUnixInputStream or GUnixOutputStream
from a non-blocking file descriptor, it might sometimes return
G_IO_ERROR_WOULD_BLOCK from g_input_stream_read/g_output_stream_write,
which is wrong. Fix that. (Use the GPollableInput/OutputStream methods
if you want non-blocking I/O.)

Also, add a test for this to gio/tests/unix-streams.

Also, fix the GError messages to say "Error reading from file
descriptor", etc instead of "Error reading from unix" (which was
presumably from a bad search and replace job).

https://bugzilla.gnome.org/show_bug.cgi?id=626866
2011-11-14 18:31:21 -05:00
Dan Winship
fe5ba0f291 add GNetworkMonitor, for... monitoring the network
Add GNetworkMonitor and its associated extension point, provide a base
implementation that always claims the network is available, and a
netlink-based implementation built on top of that that actually tracks
the network state.

https://bugzilla.gnome.org/show_bug.cgi?id=620932
2011-11-14 13:42:30 -05:00
Simon McVittie
fc21c6ced0 gdbus-exit-on-close test: don't leak a variant
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Bug-NB: NB#287088
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
2011-11-11 16:05:16 +00:00
Simon McVittie
f0c383917b gdbus-exit-on-close test: optionally be more verbose for debugging
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Bug-NB: NB#287088
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
2011-11-11 16:05:04 +00:00
Dan Winship
f09e71aff0 gio/tests/proxy: don't use deprecated functions 2011-11-07 13:50:00 -05:00
Matthias Clasen
fc0b8d4f28 Add a test for CDATA in gschema.xml files 2011-11-07 00:14:28 -05:00
David Zeuthen
1fc897352e g_bus_own_name: fix race when unowning a name immediately after owning it
... and also add a test to verify that the fix works.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-10-27 10:35:18 -04:00
Simon McVittie
612d238467 gdbus-non-socket test: avoid use of a GMainContext across a fork
See https://bugzilla.gnome.org/show_bug.cgi?id=658999 for why this would
be bad.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
2011-10-19 10:50:02 +01:00
Simon McVittie
be89f052c2 gdbus-exit-on-close test: cover more possibilities
We didn't previously test anything except the implicit default of TRUE.
Now we test implicit TRUE, explicit TRUE, explicit FALSE, and
disconnecting at the local end (which regressed while fixing Bug #651268).

Also avoid some questionable use of a main context, which fell foul of
Bug #658999 and caused this test to be disabled in master.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Bug-NB: NB#287088
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
2011-10-19 10:50:02 +01:00
Simon McVittie
6c33e1cd9d Revert "Disable two GDBus tests"
This reverts commit 05ef173466.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=662100
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: David Zeuthen <davidz@redhat.com>
2011-10-19 10:37:27 +01:00
Sjoerd Simons
f07201c314 GDBusConnection: Fix race in /gdbus/connection/life-cycle
GDBusConnection sets the closed flag in the worker thread, then adds an
idle callback (which refs the Connection) to signal this in the main
thread. The tests session_bus_down doesn't spin the mainloop, so the
"closed" signal will always fire if iterating the mainloop later (and
drops the ref when doing so). But _is_closed can return TRUE even before
signalling this, in which case the "closed" signal isn't fired and the
ref isn't dropped, causing the test to fail.

Instead simply always wait for the closed signal, which is a good thing
to check anyway and ensures the ref is closed.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=661896
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2011-10-18 13:18:09 +01:00
Alexander Larsson
52389bd010 Fix up testcase broken due to g_thread_new API change 2011-10-17 23:00:29 +02:00
Ryan Lortie
38e8ecd62a more 'static' adding in testcases
No dead code found this time...
2011-10-16 21:41:15 -04:00
Ryan Lortie
b264fccd23 contexts test: don't use deprecated GCond wait API 2011-10-16 21:41:15 -04:00
Ryan Lortie
c5aa8390b2 gitignore 2011-10-16 19:11:00 -04:00
Matthias Clasen
8ff94df632 Add a tests of some GVfs functions
https://bugzilla.gnome.org/show_bug.cgi?id=656621
2011-10-16 16:09:33 -04:00
Matthias Clasen
448be24cf3 Add app lauch environment test 2011-10-16 00:08:42 -04:00
Ryan Lortie
430c5635f2 g_thread_new: never fail
Remove the GError argument from g_thread_new() and abort on failure.
Introduce g_thread_try() for those who want to handle failure.
2011-10-13 01:00:57 -04:00
Ryan Lortie
015f4b4513 thread: nuke the concept of 'joinable'
And remove the 'joinable' argument from g_thread_new() and
g_thread_new_full().

Change the wording in the docs.  Clarify expectations for
(deprecated) g_thread_create().
2011-10-13 00:43:33 -04:00
Matthias Clasen
93e49aea1b Don't use deprecated GThread API in gio tests 2011-10-10 09:49:50 -04:00
Antoine Jacoutot
c739a5df14 gio: enable test_peer regression test for OpenBSD
https://bugzilla.gnome.org/show_bug.cgi?id=661255
2011-10-08 17:11:39 +02:00
David Zeuthen
3c4d3dec09 GDBusConnection: Make pending calls error when the connection is lost
If the connection to the bus is lost while a method call is ongoing,
the method call does not get cancelled. Instead it just sits around
until it times out.

This is visible here on XO laptops when stopping the display manager
during shutdown. imsettings starts sending a sync message to give up
its bus name (via g_bus_unown_name()), then systemd terminates the
session bus at approximately the same time. imsettings then hangs for
about 20 seconds before timing out the message.

 http://lists.freedesktop.org/archives/dbus/2011-September/014717.html

imsettings behaviour could be improved as described in that thread,
but I think this is a glib bug. I've also come up with the attached
patch which fixes it.

Credits for the bug-fix goes to Daniel Drake <dsd@laptop.org>. The test
case was written by David Zeuthen <zeuthen@gmail.com>.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-10-07 14:23:03 -04:00
David Zeuthen
f34908ef15 GDBus: Regenerate code when the codegen or options passed to it changes
https://bugzilla.gnome.org/show_bug.cgi?id=660498

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-10-05 12:42:06 -04:00
David Zeuthen
af55ff5a2b GDBus: disable two more GDBus tests using fork()
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-10-05 10:56:11 -04:00
David Zeuthen
2b963266b6 GDBusProxy: Correctly handle unknown members when having an expected interface
Since it is valid for a D-Bus interface / service to add new methods,
signals or properties we must NEVER warn about unknown properties or
drop unknown signals or disallow unknown method invocations when we
have an expected interface.

So this means that the expected_interface machinery is only useful for
checking that the service didn't break ABI.

Also update the docs so it is clear exactly what it means to have an
expected interface.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-10-05 10:45:22 -04:00
Ryan Lortie
6f343ca548 Remove g_mutex_new()/g_cond_new() in testcases
These were the last users of the dynamic allocation API.

Keep the uses in glib/tests/mutex.c since this is actually meant to test
the API (which has to continue working, even if it is deprecated).

https://bugzilla.gnome.org/show_bug.cgi?id=660739
2011-10-04 19:35:27 -04:00
Dan Winship
afa604f881 gio/tests/socket-client: fix a crash (and some indentation) 2011-10-04 13:19:21 -04:00
Ryan Lortie
3106391694 Revert "GSettings: don't abort on missing schemas"
This reverts commit c841c2ce3f.

This approach has been an unmitigated disaster.  We're getting all sorts
of crashes due to functions that are returning NULL because they can't
find the schema for the default value.  The people who get these crashes
are then confused about the root cause of the problem and waste a lot of
time trying to figure it out.

Until we find a better solution, we should go back to what we had
before.

https://bugzilla.gnome.org/show_bug.cgi?id=655366
2011-10-03 10:19:38 -04:00
Simon McVittie
7aad93c5b4 sleepy-stream test: use a real GError domain
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=660371
2011-09-30 13:17:27 +01:00
Dan Winship
0f4b278a4b update .gitignores 2011-09-28 12:20:09 -04:00
Edward Sheldrake
5b2c809dda Add another mimeapps test
This tests the interaction between mimeinfo.cache, defaults.list and
mimeapps.list to ensure g_app_info_set_as_last_used_for_type doesn't
incorrectly change the default.

https://bugzilla.gnome.org/show_bug.cgi?id=658188
2011-09-26 16:54:23 -04:00
Colin Walters
f42fe6cdc0 gvalue: Add explicitly signed g_value_get_schar() and g_value_set_schar()
The documentation for G_TYPE_CHAR says:

"The type designated by G_TYPE_CHAR is unconditionally an 8-bit signed
 integer."

However the return value for g_value_get_char() was just "char" which
in C has an unspecified signedness; on e.g. x86 it's signed (which
matches the GType), but on e.g. PowerPC or ARM, it's not.

We can't break the old API, so we need to suck it up and add new API.
Port most internal users, but keep some tests of the old API too.

https://bugzilla.gnome.org/show_bug.cgi?id=659870
2011-09-22 20:05:38 -04:00
David Zeuthen
88f2b32eb0 GDBusObjectManagerServer: Add test for export_uniquely() method
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-19 17:31:21 -04:00
David Zeuthen
48494dd552 gdbus-codegen: Support Ugly_Case for given C namespace
https://bugzilla.gnome.org/show_bug.cgi?id=658976

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 16:01:13 -04:00
Simon McVittie
20497f7af9 Regression test for closing a stream, slowly, while a message is queued
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=651268
Bug-NB: NB#271520
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-09-16 12:00:22 -04:00
Ryan Lortie
05ef173466 Disable two GDBus tests
These tests try to use GMainContext across fork() which now fails a lot
more violently than it used to.

See https://bugzilla.gnome.org/show_bug.cgi?id=658999 for information.
2011-09-16 11:18:26 -04:00
Ryan Lortie
39294664a6 GApplication test: fix testcase to avoid fork()
The GApplication test case tried to fork() while using GMainLoop,
causing problems.  Avoid doing that by splitting the child process into
a separate program and spawning it in the usual way.

https://bugzilla.gnome.org/show_bug.cgi?id=658999
2011-09-14 14:09:12 -04:00
Matthias Clasen
73c427fab9 Expand mimeapps test
This adds a test involving both defaults.list and mimeapps.list.
2011-09-12 01:46:48 -04:00
Matthias Clasen
2ba5a79a70 Also check api results
In addition to looking at mimeapps.list, check that the default
and recommended apps returned by g_app_info api are as expected.
2011-09-11 23:39:29 -04:00
Matthias Clasen
938e57dd4b Adapt tests to string changes 2011-09-11 23:28:44 -04:00
Matthias Clasen
011c0b488f Add some tests for mimeapps.list handling
These tests directly look at mimeapps.list to verify that
we make the expected changes to the database.
2011-09-09 23:44:41 -04:00
Matthias Clasen
66a1dfc84f Avoid some compiler warnings 2011-09-09 23:44:41 -04:00
Dan Winship
5a30712dc7 Remove !g_thread_supported() codepaths in gio
In particular, remove the libasyncns import, which was only used by
GUnixResolver, which is only used when threads are not available.
Likewise remove GWin32Resolver, and the hacky broken non-threaded
parts of GIOScheduler.

https://bugzilla.gnome.org/show_bug.cgi?id=616754
2011-09-09 12:47:39 -04:00
Dan Winship
15f1ba4721 gio/tests/tls-interaction: fix two sporadic errors
The threaded tests are using the default main context in the worker
thread, but were not g_main_context_acquire()ing it first, which meant
that g_tls_interaction_invoke_ask_password() in the main thread would
sometimes succeed in acquiring it itself and thus performing the
operation in the wrong thread. Fix that.

Also, we can't unref the loop from the worker thread, because the main
thread isn't holding a reference on it, and so it might end up being
destroyed while that thread is still inside g_main_loop_quit().
2011-09-04 10:33:37 -04:00
Dan Winship
4a371c2ce5 g_network_address_parse: deprecate symbolic port names
(which shouldn't ever have been part of the API. Grr.)

Solaris /etc/services doesn't even have "http", which was causing
tests/network-address to fail...
2011-09-03 19:58:40 -04:00
Stef Walter
49bb7cff4b gio: Add GTlsInteraction interaction method invocation guarantees
* Add 'invoke' style method, which can be used to call an interaction
   from any thread. The interaction will be run in the appropriate
   #GMainContext
 * Sync methods can be called whether main loop is running or not.
 * Derived classes can choose to implement only sync or async
   interaction method, and the invoke method will fill in the blanks.
 * Documentation for the above.
 * Tests for the above.

https://bugzilla.gnome.org/show_bug.cgi?id=657567
2011-08-30 18:30:02 +02:00
Dan Winship
302a5072c9 gio/tests/gdbus-peer: make this work on non-Linux unixes
The test was using a socket in a temporary directory, but not actually
creating that temporary directory. This worked fine on Linux since it
actually ended up using an abstract socket instead, but failed on
unixes without abstract sockets.

https://bugzilla.gnome.org/show_bug.cgi?id=657517
2011-08-30 09:52:46 -04:00
Dan Winship
fb74f6e303 GSocketAddress: create IPv4 addresses for IPv6 mapped-IPv4 addresses
IPv6-mapped-IPv4 addresses are annoying. Just translate them to real
IPv4 addresses.

based on a patch from Jonny Lamb
https://bugzilla.gnome.org/show_bug.cgi?id=646082
2011-08-29 23:42:39 -04:00
Kalev Lember
41e4db8076 gio/tests/gtlsconsoleinteraction: Work around missing getpass() on win32
Loosely based on a patch by Sam Thursfield <ssssam@gmail.com>.
https://bugzilla.gnome.org/show_bug.cgi?id=656341
2011-08-28 16:45:53 +03:00
Dan Winship
cef679d004 GSocket: fix GIOCondition on timed-out socket operation
The docs for g_socket_set_timeout() claimed that if an async operation
timed out, the GIOCondition passed to the source callback would be
G_IO_IN or G_IO_OUT (thus prompting the caller to call
g_socket_receive/send and get a G_IO_ERROR_TIMED_OUT), but in fact it
ended up being 0, and gio/tests/socket.c was erroneously testing for
that instead of the correct value. Fix this.
2011-08-27 12:28:03 -04:00
Stef Walter
41432cb375 Make GTlsInteraction virtual methods cancellable
* Add cancellable argument to g_tls_interaction_ask_password
   and g_tls_interaction_ask_password_async.
 * This is API breakage, but this API has not yet been released
   in a stable release (and very unlikely used yet).
 * Since we're breaking unreleased API, expand amount of padding
   on GTlsInteractionClass because we're going to need it.

https://bugzilla.gnome.org/show_bug.cgi?id=656443
2011-08-26 07:34:31 +02:00
Dieter Verfaillie
cd0cd95078 Introduce the UNINSTALLED_GLIB_SRCDIR environment variable
This makes it possible to avoid setting PYTHONPATH in
Makefile.am files.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:49 -04:00
Dieter Verfaillie
5391aae009 Introduce the UNINSTALLED_GLIB_BUILDDIR environment variable
This makes it possible to also use relative imports for
gdbus-codegen's config module.

https://bugzilla.gnome.org/show_bug.cgi?id=650763
2011-08-25 16:55:49 -04:00
David Zeuthen
05448a6bef gdbus-codegen: Rework C property getters
Rework property getters to use a vfunc so we can take the fast path
and avoid allocating memory for both the skeleton and the proxy
cases. This requires some special case because of how GVariant expects
you to free memory in some cases, see #657100. Add test cases for
this.

Document the _get_ functions as not being thread-safe and also
generate _dup_ C getters (which are thread-safe).

Mark all the generated _get_, _dup_ and _set_ as (skip) as non-C
languages should just use GObject properties and not the (socalled)
"C binding".

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-23 12:54:27 -04:00
Stef Walter
26548e05bb Merge branch 'concurrent-cancellable' 2011-08-19 11:21:11 +02:00
Stef Walter
54579bf88f gio: GCancellable can be used concurrently
* Update documentation to note that GCancellable can be used
   concurrently by multiple operations.
 * Add documentation to g_cancellable_reset that behavior is
   undefined if called from within cancelled handler.
 * Add test for multiple concurrent operations using the same
   cancellable.

https://bugzilla.gnome.org/show_bug.cgi?id=656387
2011-08-19 11:13:37 +02:00
Ryan Lortie
0a4663343f distcheck fixes 2011-08-15 21:01:23 -04:00
Simon McVittie
67cf3ea368 Add a stress-test for GDBusProxy in threads with no default main context
Destroying a GDBusProxy in a thread used to race with NameOwnerChanged
being delivered to the main context's thread (GNOME #651133).

Also, g_dbus_proxy_call_sync in a thread would race with NameOwnerChanged
being delivered to the main context's thread and rewriting the name_owner
(GNOME #656039).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=656039
Bug-NB: NB#259760
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:04 -04:00
Dan Winship
cfa90b8fc1 gio/tests/.gitignore: fix 2011-08-05 19:43:47 -04:00
Stef Walter
0f99cfa882 GTlsDatabase and related objects
The database is an abstract object implemented by the various TLS
backends, which is used by GTlsConnection to lookup certificates
and keys, as well as verify certificate chains.

Also add GTlsInteraction, which can be used to prompt the user
for a password or PIN (used with the database).

https://bugzilla.gnome.org/show_bug.cgi?id=636572
2011-08-04 08:54:55 +02:00
Nicolas Dufresne
dbb78fe57d Added TLS PEM parser unit test 2011-07-27 16:23:33 -04:00
David Zeuthen
b7f3638e5c More gdbus-codegen fixed to build on non-Unix
https://bugzilla.gnome.org/show_bug.cgi?id=655148#c6

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-26 10:05:57 -04:00
Dan Winship
eac8d47e37 gio/tests/socket: add some basic IPv4 and IPv6 tests 2011-07-24 14:55:05 -04:00
Matthias Clasen
4cb33b158b Explicitly unset the session bus address for the peer tests
Otherwise, we may run into trouble as opening a peer-to-peer
connection uses a socket client, which uses a proxy resolver
which may end up using gsettings, whose dconf backend may end
up using the session bus to talk to dconfd...
2011-07-23 21:59:49 -04:00
Matthias Clasen
d344e69dc2 Properly bring up a session bus for application tests
As pointed out in bug 644601, session_bus_up() requires
us to set up environment variables for things to work.
2011-07-23 21:16:28 -04:00
David Zeuthen
c404dbed11 gdbus-codegen: Add support for new org.gtk.GDBus.C.UnixFD annotation
Also add convenience _with_unix_fd_list variants to GDBusConnection,
GDBusProxy and GDBusMethodInvocation types to easily support this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-21 16:06:18 -04:00
David Zeuthen
419bfe325c gdbus-codegen: Use G_TYPE_STRV/gchar** for GVariant type 'ao'
This is possible now that we have better support for object path
arrays, see

 http://git.gnome.org/browse/glib/commit/?id=19878998bc386db78614f1c92ff8524a81479c7b

Note that this breaks the ABI of generated code but since
gdbus-codegen(1) has never yet been in a stable GLib release, this is
fine.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-07-21 09:32:38 -04:00
Ryan Lortie
c841c2ce3f GSettings: don't abort on missing schemas
Give a g_critical instead.
2011-07-20 14:06:36 +02:00
Tim-Philipp Müller
7654a848e2 tests: fix glib_translations_work()
If setlocale() to our test locale fails, translations
won't work either.

https://bugzilla.gnome.org/show_bug.cgi?id=654017
2011-07-11 00:08:14 -04:00
Matthias Clasen
2caddda534 Take out the timeout from the large-message test
This is an attempt to make the test not fail on build slaves,
which currently getting a timeout error here.
2011-07-10 23:11:30 -04:00
Ryan Lortie
e6a25caa82 actions: merge testcases change_state and entries
Since we have support for change_state in GActionEntry now.
2011-06-29 16:20:52 +01:00
Ryan Lortie
d5915a4be3 Add testcase for GSimpleAction::change-state 2011-06-29 16:20:52 +01:00
Ryan Lortie
5978a6edb5 Add a test case for GActionEntry 2011-06-29 16:20:52 +01:00
Ryan Lortie
5ff65d8695 Make 4 incompatible changes to the GAction API
This commit represents an API break to GAction in the following ways:

  - the 'set_state' entry in the GActionInterface vtable has been
    renamed to 'change_state'.  The number and order of vtable items has
    not otherwise changed.

  - g_action_set_state() has been renamed to g_action_change_state() to
    match the updated vtable entry.

  - the "state" property of the GAction interface has been changed to
    read-only to reflect the fact that g_action_set_state() no longer
    exists.

  - GSimpleActionClass has been hidden.  GSimpleAction can no longer be
    subclassed.

>> Rationale

g_action_set_state() has never been a true setter in the sense that
calling it will update the value of the "state" property.  It has always
been closer to "request 'state' to be changed to this value" with
semantics defined by the implementor of the interface.  This is why the
equivalent method in GActionGroup had its name changed from 'set' to
'change'.  This change makes the two interfaces more consistent and
removes any implication about the effect that calling set_state() should
have on the 'state' property.

>> Impact

This incompatible API break was undertaken only because I strongly
suspect that it will go entirely unnoticed.  If the break actually
affects anybody, then we will accommodate them (possibly going as far as
to revert this commit entirely).

The virtual table change only impacts implementors of GAction.  I
strongly suspect that this is nobody (except for GSimpleAction).

The hiding of GSimpleActionClass only impacts impacts subclasses of
GSimpleAction.  I strongly suspect that none of these exist.

The changing of the property to be read-only only affects people who
were trying to change the state by using GObject properties.  I strongly
suspect that this is nobody at all.

The removal of the g_action_set_state() call is the most dangerous, but
I still suspect that it will impact nobody outside of GLib.  If anybody
is impacted by this change then, at their request, I will reintroduce
the API as a deprecated alias for g_action_change_state().
2011-06-29 11:38:21 +01:00
Colin Walters
9053ad07ba Fix a srcdir!=builddir issue, and export that we support it
Future jhbuild versions will consume the BUILD API and automatically
use a builddir, so mark us as supporting it.
2011-06-21 10:30:07 -04:00
David Zeuthen
322e25b535 GDBus: Unref worker from worker-thread to avoid race
... otherwise we might end up using the worker after it has been
freed. Reported by Dan Winship and Colin Walters.

This fix uncovered a bug in the /gdbus/nonce-tcp test case so "fix"
that as well to use a better way of having one thread wait for another
(using quotes for the word "fix" since it's pretty hackish to
busy-wait in one thread to wait for another).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-20 16:32:03 -04:00
Colin Walters
d54c65448c gdbus-test-codegen: Allocate full integer space for uint16 properties
Because there is no G_TYPE_[U]INT16, we need to use integer types,
otherwise we'll end up overwriting memory (in this case on the stack).
2011-06-20 14:03:05 -04:00
Colin Walters
28254a38a7 GDataInputStream: Add _utf8() variants of _read_line
These will validate the resulting line, and throw a conversion error.
In practice these will likely be used by bindings, but it's good
for even C apps too that don't want to explode if that text file
they're reading into Pango actually has invalid UTF-8.

https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-16 20:03:02 -04:00
Matthias Clasen
01e6cf1360 Don't do < 0 on an unsigned value
It won't work. read() returns a signed value, anyway.
2011-06-14 11:40:32 -04:00
Colin Walters
5ec6eafb0e gdbus-codegen tests: Fix usage of top_srcddir
Based on a patch from Rico Tzschichholz.
2011-06-13 14:17:44 -04:00
David Zeuthen
f819aa5f17 gdbus-codegen: Fix build
See https://bugzilla.gnome.org/show_bug.cgi?id=651998 for details.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-09 11:53:08 -04:00
Matthias Clasen
d6b341c38c Test the previous fix
Just make one of the existing GApplication test cases use
a dash in the id.
2011-06-08 22:38:11 -04:00
Colin Walters
62072b2a04 gdbus codegen: Ensure PYTHONPATH is set correctly for srcdir != builddir
We need to pick up the Python files from the source directory, so set
PYTHONPATH.
2011-06-06 17:14:45 -04:00
Matthias Clasen
87dc08ee4d Distcheck fixes
Fix VPATH builds.
2011-06-04 10:46:38 -04:00
David Zeuthen
723adbc2fe Move gdbus-codegen example code and docs into separate directories
This avoids the generated types (e.g. ExampleAnimal, ExampleCat,
ExampleObject and ExampleObjectManagerClient) being referenced in the
core gio docs. This was requested by Matthias.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-03 14:18:56 -04:00
Matthias Clasen
2fb57ff46f Quiet down the build a bit 2011-05-28 14:29:08 -04:00
David Zeuthen
263ce3042c gdbus-codegen: Handle unexpected XML tags
This was reported in bug 650874. Add tests.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-23 23:23:10 -04:00
Antoine Jacoutot
ce0f7cafa1 Fix build with gcc-2.*.
https://bugzilla.gnome.org/show_bug.cgi?id=650884
2011-05-23 13:05:49 -04:00
Ryan Lortie
0e10116b3b Add debug output to GApplication actions example
Enough to clearly demonstrate bug #650236.
2011-05-18 16:13:03 -04:00
Matthias Clasen
d5d4659a60 Try to fix distcheck 2011-05-04 19:44:05 -04:00
David Zeuthen
1ab29b6c4a GDBusObjectManagerServer: Allow setting :connection property
.. and add a C setter to do this. Also make the C getter return a
reference since the property may be set from another thread. Also
change the constructor to _not_ take a GDBusConnection since this is
something you almost always want to do _after_ creating it. The
API/ABI break is fine as there has never been a GLib release with this
type.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-05-04 03:43:52 -04:00
Dan Winship
e56498ee0b Fix usage of _GNU_SOURCE
_GNU_SOURCE must be defined before including any other (system)
header, so defining it in glib-unix.h (and hoping no one has included
anything else before that) is wrong. And the "#define _USE_GNU"
workaround for this problem in gnetworkingprivate.h is even wronger
(and still prone to failure anyway due to single-include guards).

Fix this by defining _GNU_SOURCE in config.h when building against
glibc. In theory this is bad because new releases of glibc may include
symbols that conflict with glib symbols, which could then cause
compile failures. However, most people only see new releases of glibc
when they upgrade their distro, at which point they also generally get
new releases of gcc, which have new warnings/errors to clean up
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=649201
2011-05-03 07:07:41 -04:00
Dan Winship
181763438a Update .gitignores 2011-05-02 09:54:15 -04:00
David Zeuthen
0e352fdb18 Merge branch 'master' into gdbus-codegen 2011-04-29 12:01:35 -04:00
David Zeuthen
bbe945183b gdbus-codegen: Generate GDBusObject{,Proxy,Skeleton} subtypes
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-25 09:29:18 -04:00
David Zeuthen
58eb4da5c5 Fix build broken by previous commit
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-23 19:26:56 -04:00
David Zeuthen
b5b34fa2f2 gdbus-codegen: Include docs for generated code in the GIO docs
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-23 17:43:03 -04:00