Commit Graph

692 Commits

Author SHA1 Message Date
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
David Zeuthen
affc6f7475 GDBusObjectManagerClient: Add a GDestroyNotify to the user_data
For bindings, obviously.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-16 15:24:42 -04:00
David Zeuthen
3cef28a2f0 gdbus-codegen: Make generated code introspectable
Specific changes

 - Use get_type(), not get_gtype() for the GType function
   - so we need to use the lower-case name type_ for properties called type
 - Don't return a function pointer, just make the function returned
   available instead
 - Add (type) annotations in constructors so g-ir-scanner detects them as such
 - Add (transfer none) annotations to property getters
 - Add (out) annotations to D-Bus method call functions

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-16 14:08:47 -04:00
David Zeuthen
6bccc46d15 gdbus-codegen: Don't send out PropertiesChanged if value ends up not changing
A fairly typical pattern is to have code that does

 foo_set_bar (object, "");
 if (some_condition)
   {
     foo_set_bar (object, "yes");
   }

where some_condition is often true every time @object is updated.

With this code, bar is essentially always "yes" but because of how
gdbus-codegen works, useless PropertiesChanged events got scheduled
and sent out. With this patch, we avoid that by always keeping the
original value around and comparing it only when we deem it's time to
send out the ::PropertiesChanged signal (typically in an idle but can
be forced by the user via flush()).

Also add a test case for this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 15:53:28 -04:00
Colin Walters
01602e1695 Fix some compiler warnings from gcc 4.6 2011-04-15 15:51:25 -04:00
David Zeuthen
e19734d6c3 gdbus-codegen: Add support for the org.freedesktop.DBus.Deprecated annotation
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 12:56:07 -04:00
David Zeuthen
febfc45fbe GDBus: Support Ugly_Case and use org.gtk.GDBus.C.Name since it's C-only
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 08:24:40 -04:00
Simon McVittie
c2387ddff1 /gdbus/message-serialize-invalid test: be compatible with D-Bus 1.4.8
Older versions of libdbus would let you construct an invalid
DBusMessage, but that's a bug, which will be fixed in 1.4.8/1.5.0.
Instead, construct a valid message of the same length, then replace
substrings in the serialized blob with their invalid counterparts.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-15 06:00:16 -04:00
David Zeuthen
4da1824759 GResolver: Don't return duplicate addresses
... this was causing a GDBus test-case to fail so now that it is
fixed, also reenable the test case.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-14 12:46:54 -04:00
David Zeuthen
3b997d92c1 GDBus: Add test case for the ANONYMOUS authentication method
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 18:21:16 -04:00
David Zeuthen
6ccca55752 GDBus: Use Skeleton instead of Stub
After some brainstorming with Simon, see

 https://bugzilla.gnome.org/show_bug.cgi?id=647577#c8

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-13 16:33:51 -04:00
David Zeuthen
34a28f2f06 Add support for org.gtk.GDBus.Since annotation
And use this for a) documentation purposes; and b) to preserve C ABI
when an interface is extended. See

 https://bugzilla.gnome.org/show_bug.cgi?id=647577#c5

for more details. Also add test cases for this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 16:17:28 -04:00
David Zeuthen
76d3653721 gdbus-codegen: Add --c-generate-object-manager option + doc improvements
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 11:50:34 -04:00
David Zeuthen
8276d0e557 Spiff up the "Migrating to GDBus" docs a bit
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-12 09:28:09 -04:00
David Zeuthen
fc59b9d843 Update "Migrating to GDBus" chapter to take gdbus-codegen(1) into account
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 18:32:11 -04:00
David Zeuthen
e5525f1010 GDBus: Add ObjectManager example
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 16:35:14 -04:00
David Zeuthen
4dffec8906 Dist test-codegen.xml
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 14:59:19 -04:00
David Zeuthen
9c1941c07f GDBus: Add test-suite for new ObjectManager and gdbus-codegen(1) code
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 10:54:52 -04:00
David Zeuthen
982195b61c GDBus: Use thread-default GMainContext in _g_assert_property_notify + friends
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-11 10:51:37 -04:00
Ryan Lortie
45377252db Add test case for G_APPLICATION_NON_UNIQUE 2011-04-10 07:56:06 -04:00
Matthias Clasen
1a0424b7ff Fix another faulty GApplicationCommandline example
Several flaws were pointed out by Shaun McCance. We were
leaking handled arguments, and we were mishandling the last
argument, and we were actually skipping arguments too.

https://bugzilla.gnome.org/show_bug.cgi?id=647031
2011-04-08 17:02:01 -04:00
David Zeuthen
0729260141 Silence a bunch of -Wunused-but-set-variable warnings
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 15:44:25 -04:00
Matthias Clasen
edaf99be86 Avoid an interaction between GApplication and GOption
When using GOption to handle commandlines, we need to disable
the builtin help handling, since it calls exit(). Also mention
this particular pitfall in the docs.
2011-04-08 07:19:38 -04:00
Ryan Lortie
7a752e0817 Improve .gitignore 2011-03-31 15:51:01 +05:30
Ryan Lortie
d95b750a1d compile schemas test: open ranges for all types
We need to make sure that every value in the table actually parses with
GVariant.
2011-03-31 15:15:09 +05:30
Ryan Lortie
d2af82e820 gschema-test: invert expectation for min/max omit
It is now completely valid.

Fix up what is now a legitimate range error in the schema used in one of
the tests.
2011-03-31 15:15:09 +05:30
David Zeuthen
1618ca572f Fix test suite breakage caused by Murray's commit
See https://bugzilla.gnome.org/show_bug.cgi?id=645682

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-25 17:56:59 -04:00
Murray Cumming
30fdc1a799 Docs: Changed can not to cannot. 2011-03-24 09:33:55 +01:00
Matthias Clasen
d377367b2c Forgotten file 2011-03-06 22:38:17 -05:00
Matthias Clasen
54e474931e Fix a typo 2011-03-04 01:55:18 -05:00
Matthias Clasen
321682871b Try harder to explain GApplicationCommandline
Trying to answer some of the questions in
https://bugzilla.gnome.org/show_bug.cgi?id=643468
2011-03-03 22:40:48 -05:00
Matthias Clasen
6f87ecc14e Add a (currently failing) testcase
This testcase check that we don't report the standard interfaces
more than one in the introspection XML, see
https://bugzilla.gnome.org/show_bug.cgi?id=642042
2011-02-15 19:49:24 -05:00
Matthias Clasen
f9ad7baf31 Fix memory leaks in the gdbus introspection parser
We were getting our length zero, yet NULL-terminated arrays in
a twist in some places. Stop passing around ignored length arguments
at the same time.
https://bugzilla.gnome.org/show_bug.cgi?id=635099
2011-02-15 02:29:15 -05:00
Matthias Clasen
309f5f978b Improve test coverage
Various test additions, mainly in GObject
2011-02-13 23:49:19 -05:00
Daiki Ueno
c0208940c5 Make g_unix_connection_send_fd() work as expected.
https://bugzilla.gnome.org/show_bug.cgi?id=637696
2011-01-12 16:01:32 -05:00
Cosimo Cecchi
f248ab1b60 tests: unbreak desktop-app-info test for jhbuild
If we have a jhbuilt version of gedit installed, this will fail, as it
will succeed in deleting its desktop file.
2010-12-28 12:18:51 +01:00
Xavier Claessens
30587a3a60 Add io-stream in gitignore 2010-12-20 18:52:44 +01:00
Cosimo Cecchi
678bcad92c appinfo: add g_app_info_set_as_last_used_for_type()
This commit also changes (maintaining compatibility) the way
user-specified default applications are stored (as in, those for which
g_app_info_set_as_default_for_type() has been called.

We now store the default application for a content type in a new group
in the mimeapps.list keyfile, and "Added Associations" tracks only the
applications that have been added by the user, following a
most-recently-used first order.

This is useful in GtkAppChooser-like widgets to pre-select the last used
application when constructing a widget.

https://bugzilla.gnome.org/show_bug.cgi?id=636311
2010-12-20 15:43:58 +01:00
Cosimo Cecchi
274ef35fd4 tests: remove a bogus assumption 2010-12-15 18:03:13 +01:00
Peng Huang
735fcf918e Bug 632544 – Cannot send a locked message with PRESERVE_SERIAL flag
https://bugzilla.gnome.org/show_bug.cgi?id=632544

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-12-13 13:09:38 -05:00
Xavier Claessens
0a2d47b626 Add g_io_stream_splice_async/finish()
That function splice the output stream of both GIOStreams to the input stream
of the other GIOStream.
2010-12-13 17:36:12 +01:00
Benjamin Otte
ca38bddd6e gio: Add a count to the resolver test for number of enumerators
This adds the nice stress-test feature of having 5 enumerators running
at the same time. Yay!
2010-12-07 19:39:24 +01:00
Benjamin Otte
07fd29c323 tls: Make g_tls_{client|server}_connection_new() return a GIOStream
The main use case for these objects is as an IO stream, so it makes
sense to return them that way from the start.
2010-12-07 19:39:24 +01:00
Christian Dywan
426f90e3cf Resolve warnings about istream and ostream in socket test 2010-12-03 16:33:24 +01:00
Benjamin Otte
b9a98a81da gio: Comment out a whole test
... instead of just commenting out the registration and leaving "unused
function" warnings for gcc.
2010-12-02 20:11:28 +01:00
Benjamin Otte
b92e2cd8f8 gio: Remove unused variables from test 2010-12-02 20:11:28 +01:00
Christian Persch
b4632e1c98 Fix the wrong-category schema test
It's supposed to test a <default l10n="..."> with a non-existent
category, so make it actually check this!

Bug #635882.
2010-11-28 17:26:30 -05:00
Christian Persch
57143e311d Inherit gettext-domain from <schemalist>
When the <schema> doesn't have a 'gettext-domain' attribute, but
the <schemalist> does, use that one.

Bug #635640.
2010-11-28 19:01:21 +01:00
Dan Winship
69129e8065 Make gio/tests/g-icon pass again
It got broken in two different ways by the g_str_hash() change
(354d655b)
2010-11-27 16:56:44 -05:00
Dan Winship
59d62726de Add initial TLS (SSL) support to gio
This adds an extension point for TLS connections to gio, with a
gnutls-based implementation in glib-networking.

Full TLS support is still a work in progress; the current API is
missing some features, and parts of it may still be changed before
2.28.

https://bugzilla.gnome.org/show_bug.cgi?id=588189
2010-11-26 15:57:11 -05:00
Dan Winship
c20c2c0abd Add pollable input/output streams
When interfacing with APIs that expect unix-style async I/O, it is
useful to be able to tell in advance whether a read/write is going to
block. This adds new interfaces GPollableInputStream and
GPollableOutputStream that can be implemented by a GInputStream or
GOutputStream to add _is_readable/_is_writable, _create_source, and
_read_nonblocking/_write_nonblocking methods.

Also, implement for GUnixInput/OutputStream and
GSocketInput/OutputStream

https://bugzilla.gnome.org/show_bug.cgi?id=634241
2010-11-26 15:08:08 -05:00
Cosimo Cecchi
5f958e4623 tests: add a test for recommended and fallback GAppInfos 2010-11-23 10:29:10 +01:00
Dan Winship
78bc8bec4f fix .gitignore 2010-11-07 12:56:44 -05:00
Dan Winship
791d91a957 fix make check 2010-11-07 12:56:08 -05:00
Matthias Clasen
38bc42d18e Fix up gapplication example 2010-11-05 14:29:15 -04:00
Matthias Clasen
8c7e284116 Tweak GApplication docs 2010-11-02 23:02:05 -04:00
Matthias Clasen
7887103193 Add an example of invoking actions 2010-10-31 22:05:20 -04:00
Matthias Clasen
cb8d29a558 Don't leak references in the actions example
These are not initially unowned...
2010-10-31 20:33:02 -04:00
Matthias Clasen
c34bcefa78 Add an example of using GApplication with actions 2010-10-30 22:19:02 -04:00
Matthias Clasen
b0e45c9799 Add another example for commandline handling
Also, clarify some aspects in the documentation.
2010-10-23 11:59:29 +02:00
Matthias Clasen
499d9ba8b8 Add some examples to the GApplication docs 2010-10-23 02:31:16 +02:00
Dan Winship
87d06109ab GSocket: set protocol when using g_socket_new_from_fd()
Otherwise, attempting to create a GSocketConnection from the socket
will likely return the wrong type, since the protocol won't match any
of the registered subtypes.

Also add the start of a GSocket test program (from davidz).

https://bugzilla.gnome.org/show_bug.cgi?id=627171
2010-10-22 14:42:41 -04:00
Ryan Lortie
a327bc51fc Cleanup and doc GApplicationCommandLine 2010-10-19 18:29:58 +02:00
Ryan Lortie
a2ac9c2515 GDBus: disable test to work around bug #631379
This test consistently prevents 'make distcheck' from passing on Ubuntu.
2010-10-19 13:45:20 +02:00
Ryan Lortie
d6ac6c1850 Rename methods on GActionGroup to include 'action'
Makes explicit the fact that you are interacting with the individual
action rather than the group and removes potential namespace conflicts
with classes implementing the interface (like g_application_activate()
vs g_application_activate_action()).
2010-10-19 01:16:46 +02:00
Ryan Lortie
582638d7ad GApplication test: test remote commandline
Also, a few small fixes/tweaks to other places in the test.
2010-10-19 01:16:46 +02:00
Ryan Lortie
2854c373e1 GApplication test case 2010-10-19 01:16:46 +02:00
Ryan Lortie
a7923a4aa3 new GApplication implementation 2010-10-19 01:16:46 +02:00
Ryan Lortie
1612a4d506 volume monitor: don't unref NULL
Fix a couple more cases of blindly calling g_object_unref() on the
result of a function that is documented as sometimes returning NULL.
2010-10-05 02:29:47 -04:00
Ryan Lortie
3c5b50c424 GSettings test: fix error match strings
The name of the internal function that appears in an assertion message
has changed.  Update the tests.
2010-10-04 21:07:50 -04:00
Ryan Lortie
d6d76783ae Bug 631263 - GSettings needs range/choice APIs
Add g_settings_get_range() to describe the possible values that may be
provided to g_settings_set_value() without causing an error.

Add a test case.
2010-10-04 02:58:46 -04:00
Ryan Lortie
90822327ac GSettings test: fix unsafe GObject properties use
The test case was passing a guint16 to g_object_get() for a guint
property.  That's invalid on all systems, although it works (more or
less) on little endian ones.  On big endian it's a total no-go.
2010-10-03 22:55:53 -04:00
Ryan Lortie
d2c0699440 Clean up g_settings_list_schemas()
In its previous form, g_settings_list_schemas() was not useful as a tool
to prevent aborts due to using g_settings_new() with an invalid schema
name.  This is because g_settings_list_scheams() also listed relocatable
schemas, and calling g_settings_new() for those would abort just the
same as if you called it for a non-existent schema.

Modify g_settings_list_schemas() so that it only returns schemas for
which it is safe to call g_settings_new().  Add another call for sake of
completeness: g_settings_list_relocatable_schemas().
2010-10-02 22:42:02 -04:00
Ryan Lortie
ba0e608478 Improve .gitignore 2010-10-01 11:21:17 -04:00
Ryan Lortie
e40f3932dd Bug 628937 - gracefully handle broken schemas
Implement the first of two features requested in the bug: when
encountering a broken .xml schema file, back out the changes in that
file and continue to parse other files.

This prevents a single broken .xml file from messing up GSettings for
everyone else.

Add a --strict option to get the old behaviour.  Use this from the test
cases.
2010-10-01 11:21:02 -04:00
David Zeuthen
4d9ae95ae0 GDBus: Don't use abstract sockets in test code
It doesn't really work right now because of a dbus-daemon(1) bug - see
the comment added in the TODO section of gdbusconnection.c. So revert
to old behavior. The downside is a lot of files in /tmp but right now
that's better than not being able to run tests in a loop.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 19:16:25 -04:00
David Zeuthen
a35eb70471 GDBus: Use abstract namespace in test cases to avoid littering all over /tmp
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 18:57:35 -04:00
David Zeuthen
7036415cc1 GDBusConnection: Use correct GMainContext when invoking free functions
Without this fix, the ./gdbus-connection test case occasionally fails, see

 https://bugzilla.gnome.org/show_bug.cgi?id=629945#c5

like this

 /gdbus/connection/basic: OK
 /gdbus/connection/life-cycle: **
ERROR:gdbus-connection.c:223:test_connection_life_cycle: assertion failed:
(!quit_mainloop_fired)
 cleaning up bus with pid 21794
 Aborted (core dumped)

because the callback didn't happen on the same thread as where we are
running the loop.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 17:36:07 -04:00
David Zeuthen
643e5526c5 GDBus: fix name test cases
Since we make message buses come and go, we need to ensure that the
singleton connection instance goes away before attempting to call
g_bus_get_sync() or similar.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 16:28:59 -04:00
David Zeuthen
71b1d738e2 GDBus: bump timeout for some tests
When under load, a one second timeout is just not enough. This can be
observed by e.g. restarting a CPU- and IO-intensive application like a
web browser with many tabs while running the test cases. Therefore,
bump the timeouts to 30 seconds.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 16:14:42 -04:00
David Zeuthen
1f6a9f1e2d GDBus: Move "slow" connection test cases into separate test program
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 15:49:04 -04:00
David Zeuthen
f0b04acfd3 GDBusConnection: Avoid callbacks on finalized connection
Turns out that GDBusWorker will issue callbacks (in its own thread)
even after g_dbus_worker_stop() has been called. This would rarely
happen (and unreffing a connection is even rarer) so only saw this bug
occasionally when running the gdbus-connection test case in a loop.

Fix up this issue by maintaining a set of GDBusConnection objects that
are currently "alive" and do nothing in the callbacks if the passed
user_data pointer is not in this set.

Also attempted to fix up a race condition with
_g_object_wait_for_single_ref_do() and its use of GObject toggle
references - for now, just resort to busy waiting, thereby
sidestepping the toggle reference mess altogether.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-23 15:16:56 -04:00
Ryan Lortie
b4ee303ed6 .gitignore some test cases 2010-09-17 13:26:50 -04:00
Ryan Lortie
2e78d07f86 Add g_data_input_stream_read_upto{,async,finish}
These functions are meant to replace the read_until() flavour, with the
following improvements:

  - consistency between the synchronous and asynchronous versions as to
    if the separator character is read (it never is).

  - support for using a nul byte as a separator character by way of
    addition of a length parameter which allows stop_chars to be treated
    as a byte array rather than a nul-terminated string.

The read_until() functions are not yet formally deprecated, but a note
has been added to the documentation warning not to use them as they will
be in the future.

This is bug #584284.
2010-09-13 13:14:25 -04:00
David Zeuthen
0b74058fa3 Add work-around for Bug 627724
The root problem is with GObject - for now, just work around it in
GDBus. Also include a test-case. See

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

for more information.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-10 16:23:14 -04:00
Ryan Lortie
77e3badcf3 split GSettings.list_items => list_{children,keys}
This is an incompatible public API/ABI change.
2010-09-09 16:42:55 -04:00
David Zeuthen
7c66068544 GDBusMessage: Don't reset serial number when copying
Ryan pointed out that it's safe to do this because we have the
G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag and that it simplifies
how filter functions work.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 15:15:13 -04:00
David Zeuthen
ee945d8f62 GDBusServer: Make ::new-connection return whether the connection was claimed
Otherwise things probably won't work in a garbage-collected world
(consider the trivial GC that never collects garbage).

This commit breaks GDBusServer ABI. No known released software is
using this code.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:02:31 -04:00
David Zeuthen
c3371efcaa Bug 624546 – Modification of GDBusMessage in filter function
Rework filter functions as per

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

This commit breaks ABI. However, this ABI break affects only
applications using filter functions. The only known user of is dconf.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 13:21:35 -04:00
David Zeuthen
67a00658ea GDBusMessage: Make it possible to lock and copy messages
Don't actually use this yet as that will require a couple of
modifications to the filter function signature. This is part of the
bug-fix for

 https://bugzilla.gnome.org/show_bug.cgi?id=624546#c8

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 12:00:32 -04:00
Emmanuele Bassi
19972a1b57 build: Quench the compiler's thirst for warnings 2010-09-04 18:24:50 +01:00
Christian Persch
db4fb1b115 Plug a mem leak in the gdbus-proxy test
==23341== 65 bytes in 3 blocks are definitely lost in loss record 927 of 1,020
==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23341==    by 0x4057094: g_malloc (gmem.c:134)
==23341==    by 0x40573DB: g_malloc_n (gmem.c:281)
==23341==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
==23341==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==23341==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==23341==    by 0x41240FF: g_object_get (gobject.c:1731)
==23341==    by 0x804C39E: test_basic (gdbus-proxy.c:522)

Bug #628331.
2010-09-03 16:05:28 -04:00
Christian Persch
5de1bf4a91 Plug a mem leak in the gdbus-proxy test
==23341== 85 (24 direct, 61 indirect) bytes in 1 blocks are definitely lost in loss record 900 of 971
==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==23341==    by 0x4057094: g_malloc (gmem.c:134)
==23341==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==23341==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==23341==    by 0x403A751: g_error_new_valist (gerror.c:54)
==23341==    by 0x403AAD4: g_set_error (gerror.c:240)
==23341==    by 0x420B807: decode_method_reply (gdbusconnection.c:4774)
==23341==    by 0x420C2BA: g_dbus_connection_call_sync (gdbusconnection.c:5188)
==23341==    by 0x421B7C9: g_dbus_proxy_call_sync (gdbusproxy.c:2477)
==23341==    by 0x804BD89: test_bogus_method_return (gdbus-proxy.c:430)

Bug #628331.
2010-09-03 16:04:29 -04:00
Christian Persch
be33ef85d0 Plug some mem leaks in gdbus-peer test
==29535== 56 (24 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 1,112 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D63A: test_nonce_tcp (gdbus-peer.c:1229)

==29535== 107 (24 direct, 83 indirect) bytes in 1 blocks are definitely lost in loss record 1,188 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D8E8: test_nonce_tcp (gdbus-peer.c:1259)

==29535== 112 (24 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 1,193 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804D79A: test_nonce_tcp (gdbus-peer.c:1248)

==29535== 73 (24 direct, 49 indirect) bytes in 1 blocks are definitely lost in loss record 1,152 of 1,264
==29535==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==29535==    by 0x4057094: g_malloc (gmem.c:134)
==29535==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==29535==    by 0x406F364: g_slice_copy (gslice.c:858)
==29535==    by 0x403A9B2: g_error_copy (gerror.c:160)
==29535==    by 0x42066D3: initable_init (gdbusconnection.c:2314)
==29535==    by 0x41A73E5: g_initable_init (ginitable.c:105)
==29535==    by 0x41A7587: g_initable_new_valist (ginitable.c:218)
==29535==    by 0x41A742A: g_initable_new (ginitable.c:138)
==29535==    by 0x4206DCC: g_dbus_connection_new_for_address_sync (gdbusconnection.c:2585)
==29535==    by 0x804C6CE: test_peer (gdbus-peer.c:803)

Bug #628331.
2010-09-03 16:03:48 -04:00
Christian Persch
3df5866139 Plug a mem leak in the gdbus-peer test
==6793== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 779 of 1,423
==6793==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==6793==    by 0x4057094: g_malloc (gmem.c:134)
==6793==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==6793==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==6793==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==6793==    by 0x412372A: g_object_constructor (gobject.c:1482)
==6793==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==6793==    by 0x4122B93: g_object_new (gobject.c:1178)
==6793==    by 0x41DB4F9: g_unix_fd_list_new (gunixfdlist.c:159)
==6793==    by 0x804AADD: test_interface_method_call (gdbus-peer.c:172)

Bug #628331.
2010-09-03 16:02:11 -04:00
Christian Persch
bd2faedefd Plug a mem leak in network-address test
==4616== 46 (32 direct, 14 indirect) bytes in 1 blocks are definitely lost in loss record 193 of 305
==4616==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==4616==    by 0x4057094: g_malloc (gmem.c:134)
==4616==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==4616==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==4616==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==4616==    by 0x412372A: g_object_constructor (gobject.c:1482)
==4616==    by 0x4123147: g_object_newv (gobject.c:1347)
==4616==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==4616==    by 0x4122BB4: g_object_new (gobject.c:1181)
==4616==    by 0x41B2D0F: g_network_address_new (gnetworkaddress.c:262)
==4616==    by 0x8048A70: test_basic (network-address.c:10)

Bug #628331.
2010-09-03 16:01:10 -04:00
Christian Persch
fa6937603c Plug a mem leak in contexts test
==14059== 96 bytes in 2 blocks are definitely lost in loss record 520 of 543
==14059==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==14059==    by 0x4057094: g_malloc (gmem.c:134)
==14059==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==14059==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==14059==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==14059==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==14059==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==14059==    by 0x411DB93: g_object_new (gobject.c:1178)
==14059==    by 0x42296AF: _g_local_file_input_stream_new (glocalfileinputstream.c:152)
==14059==    by 0x422281F: g_local_file_read (glocalfile.c:1322)
==14059==    by 0x418A8A9: open_read_async_thread (gfile.c:5050)
==14059==    by 0x41B71BB: run_in_thread (gsimpleasyncresult.c:853)
==14059==    by 0x41A5FBC: io_job_thread (gioscheduler.c:181)
==14059==    by 0x407DCDE: g_thread_pool_thread_proxy (gthreadpool.c:314)
==14059==    by 0x407C6B0: g_thread_create_proxy (gthread.c:1897)
==14059==    by 0x57D918: start_thread (pthread_create.c:301)
==14059==    by 0x4C6CBD: clone (clone.S:133)

Bug #628331.
2010-09-03 16:00:15 -04:00
Christian Persch
60349ecc4d Plug mem leaks in contexts test
==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 515 of 547
==2464==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2464==    by 0x4057094: g_malloc (gmem.c:134)
==2464==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2464==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2464==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==2464==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==2464==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==2464==    by 0x411DB93: g_object_new (gobject.c:1178)
==2464==    by 0x4220D74: _g_local_file_new (glocalfile.c:310)
==2464==    by 0x422C897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2464==    by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94)
==2464==    by 0x418C1B6: g_file_new_for_path (gfile.c:5898)
==2464==    by 0x8049509: test1_thread (contexts.c:110)

==2464== 80 (16 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 516 of 547
==2464==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2464==    by 0x4057094: g_malloc (gmem.c:134)
==2464==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2464==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2464==    by 0x41385BB: g_type_create_instance (gtype.c:1867)
==2464==    by 0x411E72A: g_object_constructor (gobject.c:1482)
==2464==    by 0x411DE1D: g_object_newv (gobject.c:1266)
==2464==    by 0x411DB93: g_object_new (gobject.c:1178)
==2464==    by 0x4220D74: _g_local_file_new (glocalfile.c:310)
==2464==    by 0x422C897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2464==    by 0x41CA91C: g_vfs_get_file_for_path (gvfs.c:94)
==2464==    by 0x418C1B6: g_file_new_for_path (gfile.c:5898)
==2464==    by 0x804964D: test_context_independence (contexts.c:144)

Bug #628331.
2010-09-03 15:58:51 -04:00
Christian Persch
e4a6b1dcdc Plug a mem leak in buffered-input-stream test
==2429== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 276 of 355
==2429==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2429==    by 0x4057094: g_malloc (gmem.c:134)
==2429==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2429==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2429==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2429==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2429==    by 0x4175525: g_buffered_input_stream_read_byte (gbufferedinputstream.c:880)
==2429==    by 0x804A21A: test_read_byte (buffered-input-stream.c:153)

Bug #628331.
2010-09-03 15:57:26 -04:00
Christian Persch
01a19dee68 Plug a mem leak in g-icon test
==2428== 256 bytes in 1 blocks are definitely lost in loss record 591 of 604
==2428==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==2428==    by 0x40571A5: g_realloc (gmem.c:181)
==2428==    by 0x4075287: g_string_maybe_expand (gstring.c:395)
==2428==    by 0x40760D8: g_string_insert_c (gstring.c:1049)
==2428==    by 0x4074D41: g_string_append_c_inline (gstring.h:153)
==2428==    by 0x4075B3C: g_string_append_uri_escaped (gstring.c:822)
==2428==    by 0x41A46AC: g_icon_to_string_tokenized (gicon.c:164)
==2428==    by 0x41A498F: g_icon_to_string (gicon.c:252)
==2428==    by 0x8049E1A: test_g_icon_serialize (g-icon.c:222)

Bug #628331.
2010-09-03 15:56:23 -04:00
Christian Persch
e8bdd2cb7a Plug a huge mem leak in data-output-stream test
==12763== 16,777,215 bytes in 1 blocks are possibly lost in loss record 357 of 357
==12763==    at 0x4004F1B: calloc (vg_replace_malloc.c:418)
==12763==    by 0x405711D: g_malloc0 (gmem.c:157)
==12763==    by 0x8048ED6: test_basic (data-output-stream.c:40)

Bug #628331.
2010-09-03 15:55:10 -04:00
Christian Persch
05d6fcf88c Plug a mem leak in data-output-stream test
==2426== 45,034 bytes in 4,094 blocks are definitely lost in loss record 358 of 361
==2426==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2426==    by 0x4057094: g_malloc (gmem.c:134)
==2426==    by 0x40573DB: g_malloc_n (gmem.c:281)
==2426==    by 0x4071ABD: g_strconcat (gstrfuncs.c:315)
==2426==    by 0x804916A: test_read_lines (data-output-stream.c:83)

Bug #628331.
2010-09-03 15:53:56 -04:00
Christian Persch
45331a4640 Plug a mem leak in data-input-stream test
==12351== 45,045 bytes in 4,095 blocks are definitely lost in loss record 377 of 380
==12351==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==12351==    by 0x4057094: g_malloc (gmem.c:134)
==12351==    by 0x40573DB: g_malloc_n (gmem.c:281)
==12351==    by 0x4071ABD: g_strconcat (gstrfuncs.c:315)
==12351==    by 0x8049811: test_read_lines (data-input-stream.c:99)

Bug #628331.
2010-09-03 15:53:05 -04:00
Christian Persch
36c7d95c9c Plug a mem leak in data-input-stream test
==2415== 45,045 bytes in 4,095 blocks are definitely lost in loss record 393 of 399
==2415==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2415==    by 0x4057094: g_malloc (gmem.c:134)
==2415==    by 0x417FC29: g_data_input_stream_read_line (gdatainputstream.c:797)
==2415==    by 0x8049874: test_read_lines (data-input-stream.c:111)

==12088== 360 bytes in 40 blocks are definitely lost in loss record 368 of 381
==12088==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==12088==    by 0x4057094: g_malloc (gmem.c:134)
==12088==    by 0x417FF4C: g_data_input_stream_read_until (gdatainputstream.c:914)
==12088==    by 0x8049B6F: test_read_until (data-input-stream.c:182)

Bug #628331.
2010-09-03 15:47:38 -04:00
Christian Persch
91e3803596 Plug a mem leak in data-input-stream test
==2415== 165 (72 direct, 93 indirect) bytes in 3 blocks are definitely lost in loss record 373 of 399
==2415==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2415==    by 0x4057094: g_malloc (gmem.c:134)
==2415==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2415==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2415==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2415==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2415==    by 0x417ED29: read_data (gdatainputstream.c:309)
==2415==    by 0x417EE9D: g_data_input_stream_read_byte (gdatainputstream.c:344)
==2415==    by 0x8049DEC: test_data_array (data-input-stream.c:263)

Bug #628331.
2010-09-03 15:45:48 -04:00
Christian Persch
31b15451cf Plug a mem leak in readwrite test
==10395== 80 (24 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 529 of 561
==10395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==10395==    by 0x4057094: g_malloc (gmem.c:134)
==10395==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==10395==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==10395==    by 0x403A751: g_error_new_valist (gerror.c:54)
==10395==    by 0x403AAD4: g_set_error (gerror.c:240)
==10395==    by 0x4230328: _g_local_file_output_stream_create (glocalfileoutputstream.c:628)
==10395==    by 0x4227A04: g_local_file_create_readwrite (glocalfile.c:1388)
==10395==    by 0x418974C: g_file_create_readwrite (gfile.c:1784)
==10395==    by 0x8049FCD: test_g_file_create_readwrite (readwrite.c:187)

Bug #628331.
2010-09-03 15:44:28 -04:00
Christian Persch
94102a40f7 Plug some huge mem leaks in converter-stream test
==8564== 24,000,000 bytes in 6 blocks are possibly lost in loss record 592 of 594
==8564==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==8564==    by 0x4057094: g_malloc (gmem.c:134)
==8564==    by 0x804AA37: test_corruption (converter-stream.c:589)
==8564==    by 0x804B05B: test_roundtrip (converter-stream.c:652)

==9459== 25,165,824 bytes in 6 blocks are possibly lost in loss record 593 of 594
==9459==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==9459==    by 0x40571A5: g_realloc (gmem.c:181)
==9459==    by 0x41B08A3: array_resize (gmemoryoutputstream.c:501)
==9459==    by 0x41B0A5D: g_memory_output_stream_write (gmemoryoutputstream.c:578)
==9459==    by 0x41B57EF: g_output_stream_write (goutputstream.c:216)
==9459==    by 0x41B591B: g_output_stream_write_all (goutputstream.c:268)
==9459==    by 0x417D617: flush_buffer (gconverteroutputstream.c:359)
==9459==    by 0x417D958: g_converter_output_stream_write (gconverteroutputstream.c:502)
==9459==    by 0x41B5D7F: g_output_stream_real_splice (goutputstream.c:428)
==9459==    by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380)
==9459==    by 0x804AB10: test_corruption (converter-stream.c:600)

==9785== 25,165,824 bytes in 6 blocks are possibly lost in loss record 592 of 592
==9785==    at 0x4005CD2: realloc (vg_replace_malloc.c:476)
==9785==    by 0x40571A5: g_realloc (gmem.c:181)
==9785==    by 0x41B08A3: array_resize (gmemoryoutputstream.c:501)
==9785==    by 0x41B0A5D: g_memory_output_stream_write (gmemoryoutputstream.c:578)
==9785==    by 0x41B5D7F: g_output_stream_real_splice (goutputstream.c:428)
==9785==    by 0x41B5C6C: g_output_stream_splice (goutputstream.c:380)
==9785==    by 0x804ADF1: test_corruption (converter-stream.c:622)
==9785==    by 0x804B06C: test_roundtrip (converter-stream.c:652)

Bug #628331.
2010-09-03 15:43:03 -04:00
Christian Persch
24bee1a130 Plug a mem leak in convert-stream test
==7540== 487 (64 direct, 423 indirect) bytes in 2 blocks are definitely lost in loss record 597 of 615
==7540==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==7540==    by 0x4057094: g_malloc (gmem.c:134)
==7540==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==7540==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==7540==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==7540==    by 0x412372A: g_object_constructor (gobject.c:1482)
==7540==    by 0x4123147: g_object_newv (gobject.c:1347)
==7540==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==7540==    by 0x41A756E: g_initable_new_valist (ginitable.c:214)
==7540==    by 0x41A743E: g_initable_new (ginitable.c:138)
==7540==    by 0x417B67A: g_charset_converter_new (gcharsetconverter.c:215)
==7540==    by 0x804B043: test_charset (converter-stream.c:675)

Bug #628331.
2010-09-03 15:40:55 -04:00
Christian Persch
ac8600a14b Plug a mem leak in converter-stream test
==2396== 168 (92 direct, 76 indirect) bytes in 1 blocks are definitely lost in loss record 598 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2396==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2396==    by 0x4123147: g_object_newv (gobject.c:1347)
==2396==    by 0x41236BB: g_object_new_valist (gobject.c:1463)
==2396==    by 0x4122BB4: g_object_new (gobject.c:1181)
==2396==    by 0x417C54D: g_converter_input_stream_new (gconverterinputstream.c:204)
==2396==    by 0x804A53E: test_compressor (converter-stream.c:484)

Bug #628331.
2010-09-03 15:39:58 -04:00
Christian Persch
85179745ac Plug a mem leak in converter-stream test
==2396== 66 (24 direct, 42 indirect) bytes in 1 blocks are definitely lost in loss record 565 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2396==    by 0x417BA38: g_charset_converter_convert (gcharsetconverter.c:344)
==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==2396==    by 0x417C9EB: g_converter_input_stream_read (gconverterinputstream.c:403)
==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
==2396==    by 0x41A7B43: g_input_stream_read_all (ginputstream.c:256)
==2396==    by 0x804B0E4: test_charset (converter-stream.c:682)

Bug #628331.
2010-09-03 15:39:07 -04:00
Christian Persch
7ec414229b Plug a mem leak in converter-stream test
==2396== 39 (24 direct, 15 indirect) bytes in 1 blocks are definitely lost in loss record 398 of 625
==2396==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2396==    by 0x4057094: g_malloc (gmem.c:134)
==2396==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2396==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2396==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2396==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2396==    by 0x80498F7: g_compressor_converter_convert (converter-stream.c:244)
==2396==    by 0x417BF67: g_converter_convert (gconverter.c:174)
==2396==    by 0x417CBDE: g_converter_input_stream_read (gconverterinputstream.c:460)
==2396==    by 0x41A7A17: g_input_stream_read (ginputstream.c:204)
==2396==    by 0x804A832: test_compressor (converter-stream.c:545)

Bug #628331.
2010-09-03 15:37:56 -04:00
Christian Persch
d5d277dccf Plug a mem leak in g-file-info test
==2395== 64 bytes in 1 blocks are definitely lost in loss record 381 of 407
==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==2395==    by 0x40571A5: g_realloc (gmem.c:181)
==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
==2395==    by 0x4199AA9: g_file_info_list_attributes (gfileinfo.c:646)
==2395==    by 0x80491CE: test_g_file_info (g-file-info.c:76)

==2395== 132 (64 direct, 68 indirect) bytes in 1 blocks are definitely lost in loss record 396 of 407
==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
==2395==    by 0x40571A5: g_realloc (gmem.c:181)
==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
==2395==    by 0x4199A82: g_file_info_list_attributes (gfileinfo.c:642)
==2395==    by 0x80492B7: test_g_file_info (g-file-info.c:86)

Bug #628331.
2010-09-03 15:37:08 -04:00
Christian Persch
35e101fa0a Plug a mem leak in the readwrite test
And use g_assert_[no_]error().

==2392== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 451 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2392==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2392==    by 0x41B7619: g_output_stream_set_pending (goutputstream.c:1198)
==2392==    by 0x41B5799: g_output_stream_write (goutputstream.c:210)
==2392==    by 0x41B590B: g_output_stream_write_all (goutputstream.c:268)
==2392==    by 0x8049B54: verify_iostream (readwrite.c:110)

Bug #628331.
2010-09-03 15:35:44 -04:00
Christian Persch
93d85ade57 Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 369 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x804A2B9: test_g_file_replace_readwrite (readwrite.c:235)

Bug #628331.
2010-09-03 15:34:12 -04:00
Christian Persch
9fba7a43be Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 368 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x8049F23: test_g_file_create_readwrite (readwrite.c:183)

Bug #628331.
2010-09-03 15:33:28 -04:00
Christian Persch
e481bf8bf6 Plug a mem leak in the readwrite test
==2392== 38 (16 direct, 22 indirect) bytes in 1 blocks are definitely lost in loss record 367 of 573
==2392==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2392==    by 0x4057094: g_malloc (gmem.c:134)
==2392==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2392==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2392==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2392==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2392==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2392==    by 0x4122B93: g_object_new (gobject.c:1178)
==2392==    by 0x4225D74: _g_local_file_new (glocalfile.c:310)
==2392==    by 0x4231897: g_local_vfs_get_file_for_path (glocalvfs.c:84)
==2392==    by 0x41CF91C: g_vfs_get_file_for_path (gvfs.c:94)
==2392==    by 0x41911B6: g_file_new_for_path (gfile.c:5898)
==2392==    by 0x8049E30: test_g_file_open_readwrite (readwrite.c:153)

Bug #628331.
2010-09-03 15:32:32 -04:00
Christian Persch
689b054b6e Plug a mem leak in the memory-input-stream test
==2389== 84 (44 direct, 40 indirect) bytes in 1 blocks are definitely lost in loss record 299 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x413D5BB: g_type_create_instance (gtype.c:1867)
==2389==    by 0x412372A: g_object_constructor (gobject.c:1482)
==2389==    by 0x4122E1D: g_object_newv (gobject.c:1266)
==2389==    by 0x4122B93: g_object_new (gobject.c:1178)
==2389==    by 0x41AF54C: g_memory_input_stream_new (gmemoryinputstream.c:199)
==2389==    by 0x8048BD1: test_read_chunks (memory-input-stream.c:40)

Bug #628331.
2010-09-03 15:31:37 -04:00
Christian Persch
53ae72b926 Plug a mem leak in the memory-input-stream test
==2389== 59 (24 direct, 35 indirect) bytes in 1 blocks are definitely lost in loss record 290 of 315
==2389==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389==    by 0x4057094: g_malloc (gmem.c:134)
==2389==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389==    by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389==    by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2389==    by 0x403AC31: g_set_error_literal (gerror.c:314)
==2389==    by 0x41AFD15: g_memory_input_stream_truncate (gmemoryinputstream.c:517)
==2389==    by 0x41BAC0F: g_seekable_truncate (gseekable.c:174)
==2389==    by 0x8049595: test_truncate (memory-input-stream.c:123)

Bug #628331.
2010-09-03 15:30:47 -04:00
Christian Persch
6320b04fe9 Plug a mem leak in gsettings test
==2530== 13 bytes in 1 blocks are definitely lost in loss record 373 of 681
==2530==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2530==    by 0x4057094: g_malloc (gmem.c:134)
==2530==    by 0x40573DB: g_malloc_n (gmem.c:281)
==2530==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
==2530==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==2530==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==2530==    by 0x41240FF: g_object_get (gobject.c:1731)
==2530==    by 0x804A4BA: test_basic (gsettings.c:28)

Bug #628331.
2010-09-03 15:29:51 -04:00
Ryan Lortie
846b0b3466 GAction is now an interface
the new class GSimpleAction is the implementation half
2010-08-30 19:26:37 +02:00
Ryan Lortie
6cd62920bb GActionGroup is now an interface
- make GAction.get_state() return a reference
 - fix some leaks/warnings in the tests
 - fix signal propagation in GSimpleActionGroup
2010-08-30 19:26:37 +02:00
Christian Persch
fa671dc5e2 Fix invalid reads
Don't use a guint16* when getting a guint property via g_object_get()!

Bug #628323.
2010-08-30 10:21:43 -04:00
Matthias Clasen
b8ff287167 Disable the 'extra data' test for now 2010-08-30 08:58:31 -04:00
Matthias Clasen
c3135d1d39 Add some more gdbus introspection tests (currently failing) 2010-08-30 08:49:41 -04:00
David Zeuthen
1e7243ad7b Bug 628084 – gdbus-peer fails with assertion
Make it work on systems where /etc/hosts is bigger than 1024 bytes.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-27 10:50:03 -04:00
Matthias Clasen
8f40c0e45a Improve GDBus introspection test coverage 2010-08-23 00:38:19 -04:00
David Zeuthen
3ff9894826 Bug 624546 – Modification of GDBusMessage in filter function
Allow modifying a GDBusMessage in a filter function and also add tests
for this. This breaks API but leaves ABI (almost) intact - at least
dconf's GSettings backend (the only big user I know of) will keep
working.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-05 20:37:27 -04:00
Matthias Clasen
41ce91d057 Better fix for the build problem
Use gnetworkingprivate.h instead, patch by Emilio Pozuelo Monfort,
bug 627407.
2010-08-21 22:09:32 -04:00
Matthias Clasen
3d01283f69 Make gdbus-peer build on !linux
Based on a patch by Koop Mast, bug 627088.
2010-08-21 22:06:56 -04:00
Matthias Clasen
892f9b6458 Improve test coverage for actions and action groups 2010-08-21 19:18:40 -04:00
Ryan Lortie
5b38bc5ad5 Simplify/fix state logic in GAction, test it. 2010-08-21 17:35:32 -04:00
Dan Winship
8f5ec0dad3 Fix misc compiler warnings in (mostly) test programs 2010-08-19 18:24:53 -04:00
Nicolas Dufresne
e2a90bcb5f Implemented proxy sample code that connect to proxy 2010-08-19 16:32:38 -04:00
Nicolas Dufresne
1094c84238 Implemented proxy sample for all Connectables 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6749ffce59 Added GProxyAddressEnumerator to proxy sample code 2010-08-19 16:32:37 -04:00
Nicolas Dufresne
6b1d851cc5 Implemented proxy sample code
Reviewed-by: Dan Winship <danw@gnome.org>
2010-08-19 16:32:36 -04:00
David Zeuthen
7d6a6ca57b Bug 627188 – gdbus-non-socket test occasionally fails
Fix logical bug in test case to avoid race condition between the
client and the server.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-18 13:09:04 -04:00
Ryan Lortie
5db9e5ad58 add GSimpleActionGroup
and a simple test
2010-08-18 02:18:54 -04:00
Ryan Lortie
8014e9c6e6 add testcase for GAction
fix some small bugs it found
2010-08-18 01:55:48 -04:00
Dan Winship
ddad707b85 update gio/tests/.gitignore 2010-08-17 18:38:34 -04:00
Christian Persch
a91a4a420e Plug a mem leak in gdbus-connection test
==26538== 145 (24 direct, 121 indirect) bytes in 1 blocks are definitely lost in loss record 765 of 790
==26538==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==26538==    by 0x405233C: g_malloc (gmem.c:134)
==26538==    by 0x406A57E: g_slice_alloc (gslice.c:836)
==26538==    by 0x406A60C: g_slice_copy (gslice.c:858)
==26538==    by 0x4035C5A: g_error_copy (gerror.c:160)
==26538==    by 0x41B6387: g_simple_async_result_set_from_error (gsimpleasyncresult.c:638)
==26538==    by 0x41FCDEB: g_dbus_connection_call_done (gdbusconnection.c:4808)
==26538==    by 0x41B682E: g_simple_async_result_complete (gsimpleasyncresult.c:762)
==26538==    by 0x41B686A: complete_in_idle_cb (gsimpleasyncresult.c:772)
==26538==    by 0x404DA7C: g_idle_dispatch (gmain.c:4224)
==26538==    by 0x4049FCD: g_main_dispatch (gmain.c:2119)
==26538==    by 0x404B2C1: g_main_context_dispatch (gmain.c:2672)
==26538==    by 0x404B716: g_main_context_iterate (gmain.c:2750)
==26538==    by 0x404BE7F: g_main_loop_run (gmain.c:2958)
==26538==    by 0x804B5CC: test_connection_send (gdbus-connection.c:407)
==26538==    by 0x4073D04: test_case_run (gtestutils.c:1174)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
75563e81c2 Plug a mem leak in gdbus-connection test
==25403== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 603 of 787
==25403==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==25403==    by 0x405233C: g_malloc (gmem.c:134)
==25403==    by 0x406A57E: g_slice_alloc (gslice.c:836)
==25403==    by 0x406A5C3: g_slice_alloc0 (gslice.c:848)
==25403==    by 0x4035B4E: g_error_new_literal (gerror.c:117)
==25403==    by 0x4035ED9: g_set_error_literal (gerror.c:314)
==25403==    by 0x41F6434: g_dbus_connection_close_sync (gdbusconnection.c:1284)
==25403==    by 0x804A861: test_connection_life_cycle (gdbus-connection.c:158)
==25403==    by 0x4073D04: test_case_run (gtestutils.c:1174)
==25403==    by 0x4073FC2: g_test_run_suite_internal (gtestutils.c:1223)
==25403==    by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403==    by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403==    by 0x40741FB: g_test_run_suite (gtestutils.c:1274)
==25403==    by 0x40733E5: g_test_run (gtestutils.c:877)
==25403==    by 0x804DC92: main (gdbus-connection.c:1024)

Bug #627187.
2010-08-18 00:13:41 +02:00
Christian Persch
a62a2fd8ed Plug a mem leak in the gdbus-connection test
Bug #627182.
2010-08-18 00:13:41 +02:00
Christian Persch
cae86073ea Add GZIP header processing to GZlibCompressor/GZlibDecompressor
Add GZlibCompressor:file-info property. If it contains a non-NULL
GFileInfo, and the compressor is in GZIP mode, the filename and
modification time from the file info are written to the GZIP header
in the output data.

Add GZlibDeompressor:file-info property. If the decompressor is in GZIP
mode, and the GZIP data contains a GZIP header, the filename and
modification time are read from it, stored in a GFileInfo, and the
file-info property is notified.

Bug #617691.
2010-08-17 17:37:32 +02:00
David Zeuthen
8a3a4596e2 Bug 626748 – Use async methods for writing and handle EAGAIN
If sending a lot of data and/or the other peer is not reading it, then
socket buffers can overflow. This is communicated from the kernel by
returning EAGAIN. In GIO, it is modelled by g_output_stream_write()
and g_socket_send_message() returning G_IO_ERROR_WOULD_BLOCK.

It is also problematic that that we're using synchronous IO in the
shared GDBus IO thread. It means that one GDBusConnection can lock up
others.

It turns out that by porting from g_output_stream_write() to
g_output_stream_write_async() we fix the EAGAIN issue. For GSocket, we
still need to handle things manually (by creating a GSource) as
g_socket_send_message() is used.

We check the new behavior in Michael's producer/consumer test case (at
/gdbus/overflow in gdbus-peer.c) added in the last commit.

Also add a test case that sends and receives a 20 MiB message.

Also add a new `transport' G_DBUS_DEBUG option so it is easy to
inspect partial writes:

 $ G_DBUS_DEBUG=transport ./gdbus-connection -p /gdbus/connection/large_message
 [...]
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 0 on a GSocketOutputStream
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 128000 on a GSocketOutputStream
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 128000 bytes of message with serial 4 and
        size 20971669 from offset 256000 on a GSocketOutputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   >>>> WROTE 43669 bytes of message with serial 4 and
        size 20971669 from offset 20928000 on a GSocketOutputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 16 bytes of message with serial 3 and
        size 20971620 to offset 0 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 15984 bytes of message with serial 3 and
        size 20971620 to offset 16 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 16000 bytes of message with serial 3 and
        size 20971620 to offset 16000 from a GSocketInputStream
 [...]
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 144000 bytes of message with serial 3 and
        size 20971620 to offset 20720000 from a GSocketInputStream
 ========================================================================
 GDBus-debug:Transport:
   <<<< READ 107620 bytes of message with serial 3 and
        size 20971620 to offset 20864000 from a GSocketInputStream
 OK

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-16 13:54:13 -04:00
Dan Winship
16bafb4799 GSocketClient: add a timeout property
GSocket has a timeout flag now, but when using GSocketClient there was
no way to set the timeout until after connecting (or failing). Fix
that by adding a timeout property to GSocketClient.
2010-08-14 15:26:16 -04:00
Matthias Clasen
e02571e93b Add bug references to some tests 2010-08-13 21:23:23 -04:00
Matthias Clasen
4160c5c74a Add tests for async file replace and load 2010-08-13 19:40:48 -04:00
Matthias Clasen
93bd5298c7 Add an async file create/write/read/delete test 2010-08-13 17:23:44 -04:00
Matthias Clasen
13e55b84eb Run volumemonitor test with local vfs
This is an attempt to stop the test from hanging on some build bots
in build.gnome.org.
2010-08-13 17:23:44 -04:00
David Zeuthen
d344ff9d67 Bug 626841 – Add test-case for non-socket GIOStream
Also fix a couple of bugs so it actually works.

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

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-13 14:01:36 -04:00
Michael Meeks
9be94e8899 Add test for EAGAIN overflow in gdbusconnection based on David's test. 2010-08-13 17:56:19 +01:00
Matthias Clasen
5d9d3f0318 Add some async file tests 2010-08-13 12:04:21 -04:00
Matthias Clasen
584787f580 Improve the async result test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
7c129c9011 Improve dbus address test coverage 2010-08-08 21:32:03 -04:00
Matthias Clasen
8e236f7ec1 Add some more test about gdbus_error apis 2010-08-07 18:55:21 -04:00
Matthias Clasen
402ad1958c Make the closure variants of name owning and watching actually work
The GClosure API is a bit funky (and badly documented), and requires
you to set a marshaller on the closure, and the marshaller has an
implicit 'this' argument, and the caller is reponsible for unsetting
the values after invoking the closure.

I've added some calls of the _with_closures variants to the
gdbus-names test now.
2010-08-07 17:10:17 -04:00
Ryan Lortie
b91f9274d9 Fix volumemonitor test case
Don't blindly g_object_unref() that which may be NULL.
2010-08-06 13:12:20 -04:00
Ryan Lortie
b3b7ea8e22 Replace -I with $(glib_INCLUDES) and friends
Stop using ad hoc -I in all of our Makefile.am.  Use the new variables
instead.
2010-08-06 13:10:34 -04:00
Ryan Lortie
ba0208b3a8 Clean up improper #includes
We have a lot of broken #including going on around the tree.  This has
gone unnoticed due to our sloppy use of -I.
2010-08-06 13:05:18 -04:00
paul
9f6faaffb6 Add $(top_builddir)/glib to includes
This is required to find glibconfig.h during srcdir != builddir builds
2010-08-05 09:08:34 -04:00
David Zeuthen
89a1b571ad GDBusMessage: Validate header fields when serializing/deserializing
The D-Bus spec mentions exactly what header fields are required for
various message types. Add tests for this as well.

Also disallow empty interfaces for signals since the D-Bus spec says
this is Verboten already.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 14:38:51 -04:00
David Zeuthen
6f070be65b GDBusMessage: Add a way to get/set byte order of a message
Also use this in the test cases to check that serialization to and
from both big and little endian works.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 13:34:14 -04:00
David Zeuthen
5bd34a820e GDBusMessage: Validate UTF-8 strings when serializing from blob
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-04 11:26:48 -04:00
Dan Winship
e62bc8e8f6 remove a junk line 2010-08-04 07:36:34 -04:00
David Zeuthen
86d947f01f Fix gdbus-exit-on-close test case
Forgot to update the test case after last commit.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-08-03 12:47:07 -04:00
Matthias Clasen
b2715bbc5e Fix a possible deadlock
the FdSource was calling g_cancellable_disconnect while holding the
main context lock, which is bad news if the ::cancelled handler is
trying to get that lock to wake up the mainloop...

Bug 586432
2010-08-03 10:41:21 -04:00
Emmanuele Bassi
b3de028a43 Update the Git ignore files 2010-08-03 14:21:02 +01:00
Ryan Lortie
ca3b7b75bf GSettings: add G_SETTINGS_BIND_INVERT_BOOLEAN flag
When binding a boolean setting to a boolean property, invert the values.
This avoids the requirement for writing a pair of mapping functions for
this extremely common case.

Add a test.

https://bugzilla.gnome.org/show_bug.cgi?id=625833
2010-08-03 02:09:10 -04:00
Matthias Clasen
8246bf4bde Improve gdbus test coverage 2010-07-31 00:13:02 -04:00
Matthias Clasen
5033be80d1 Add a test for g_dbus_proxy_get_cached_property_names 2010-07-30 19:51:22 -04:00
Matthias Clasen
aa196c60df Improve coverage of buffered output stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
ffa938fc65 Improve coverage of credentials tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
670528c187 Improve coverage of converter stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
9794a648a9 Improve coverage of memory stream tests 2010-07-30 19:51:21 -04:00
Matthias Clasen
620582e59c Remove redundant include 2010-07-30 19:51:20 -04:00
Matthias Clasen
17d4898d75 Improve coverage of icon tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
7710c50fb2 Improve coverage of application tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
758c3216cd Improve coverage of stream tests 2010-07-30 19:51:20 -04:00
Matthias Clasen
c6b0507167 Reenable unix-streams test 2010-07-30 19:51:20 -04:00
Matthias Clasen
04c7abba11 Work around deadlock in unix-streams test 2010-07-30 19:51:20 -04:00
Matthias Clasen
b463b2ea25 Add tests about file associations 2010-07-30 19:51:20 -04:00
Matthias Clasen
13ac9f94fd Add some more GFile tests 2010-07-30 19:51:19 -04:00
Matthias Clasen
8263d691cb Improve compressor test coverage a bit 2010-07-30 19:51:19 -04:00
Matthias Clasen
b77a19f238 Test g_settings_list_schemas 2010-07-30 19:51:19 -04:00
Matthias Clasen
caa9453b72 Fix a warning 2010-07-30 19:51:18 -04:00
Matthias Clasen
d0750c9d6e Don't leak in converter test 2010-07-30 19:51:18 -04:00
Matthias Clasen
63bdeb0dab Fix an icon test 2010-07-30 19:51:17 -04:00
Matthias Clasen
a8f83ea834 Add tests for GNetworkAddress 2010-07-30 19:51:17 -04:00