platform/upstream/glib.git
10 years agoGenerate overview images for coverage
Matthias Clasen [Thu, 28 Nov 2013 19:50:59 +0000 (14:50 -0500)]
Generate overview images for coverage

lcov has the options to generate overview images for each source
file with the --frames option. Lets try this.

10 years agoImprove GSettings test coverage
Matthias Clasen [Thu, 28 Nov 2013 19:33:03 +0000 (14:33 -0500)]
Improve GSettings test coverage

This covers some more GSettingsSchemaKey api.

10 years agoImprove search utils test coverage
Matthias Clasen [Thu, 28 Nov 2013 18:54:50 +0000 (13:54 -0500)]
Improve search utils test coverage

This adds test cases for the Turkish i.

10 years agoImprove GNotification test coverage
Matthias Clasen [Thu, 28 Nov 2013 18:54:17 +0000 (13:54 -0500)]
Improve GNotification test coverage

10 years agoImprove GKeyFile test coverage
Matthias Clasen [Thu, 28 Nov 2013 18:00:03 +0000 (13:00 -0500)]
Improve GKeyFile test coverage

10 years agoImprove test coverage for GHashTable
Matthias Clasen [Thu, 28 Nov 2013 17:59:32 +0000 (12:59 -0500)]
Improve test coverage for GHashTable

10 years agoImprove test coverage for GSubprocess
Matthias Clasen [Thu, 28 Nov 2013 17:59:11 +0000 (12:59 -0500)]
Improve test coverage for GSubprocess

10 years agoImprove test coverage for gsettings
Matthias Clasen [Thu, 28 Nov 2013 17:58:44 +0000 (12:58 -0500)]
Improve test coverage for gsettings

10 years agoTest new gsettings api
Matthias Clasen [Thu, 28 Nov 2013 07:01:48 +0000 (02:01 -0500)]
Test new gsettings api

g_settings_get_user_value and g_settings_get_default_value
are now covered.

10 years agogio: Replace g_clear_object() with if()…g_object_unref()
Philip Withnall [Thu, 28 Nov 2013 20:41:49 +0000 (20:41 +0000)]
gio: Replace g_clear_object() with if()…g_object_unref()

As per https://bugzilla.gnome.org/show_bug.cgi?id=113075#c39.

10 years agogdbus-codegen: Fix leak in property setter
djcb [Thu, 28 Nov 2013 13:25:20 +0000 (08:25 -0500)]
gdbus-codegen: Fix leak in property setter

Comparing the code generated for the setter and other methods without
(real) return value, I noticed that the setter does not unref the
gvariant it gets.

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

10 years agoTest g_subprocess_launcher_spawn
Matthias Clasen [Thu, 28 Nov 2013 06:36:29 +0000 (01:36 -0500)]
Test g_subprocess_launcher_spawn

The spawnv variant of this function already had a test, but
spawn was not tested.

10 years agoFix g_subprocess_launcher_spawn
Matthias Clasen [Thu, 28 Nov 2013 06:34:52 +0000 (01:34 -0500)]
Fix g_subprocess_launcher_spawn

This function turns a varargs argument list into a string array,
but forgets to NULL-terminate it. This function was not covered
by unit tests...so it was broken.

10 years agoTest some more GSubProcess api
Matthias Clasen [Thu, 28 Nov 2013 06:12:26 +0000 (01:12 -0500)]
Test some more GSubProcess api

This covers g_subprocess_set_environ, g_subprocess_setenv,
g_subprocess_getenv, and g_subprocess_set_flags.

10 years agoAdd a GAppInfoMonitor test
Matthias Clasen [Thu, 28 Nov 2013 05:19:19 +0000 (00:19 -0500)]
Add a GAppInfoMonitor test

The test reveals that there's something fishy with this monitor.
One has to call g_app_info_get_all() for it to start working,
and then it only works once.

10 years agoAdd tests for new GAction api
Matthias Clasen [Thu, 28 Nov 2013 03:48:06 +0000 (22:48 -0500)]
Add tests for new GAction api

g_action_name_is_valid and g_action_parse_detailed_name are
now covered.

10 years agoFix g_win32_run_session_bus hook for MinGW-w64
Manuel Bachmann [Wed, 27 Nov 2013 22:18:54 +0000 (23:18 +0100)]
Fix g_win32_run_session_bus hook for MinGW-w64

On win64, g_win32_run_session_bus gets exported with this
precise name, with MinGW as well as MSVC.

Fixes annoying "Entry not found" UI warning.

10 years agogsettings tool: stop using GMainLoop
Ryan Lortie [Wed, 27 Nov 2013 17:41:33 +0000 (12:41 -0500)]
gsettings tool: stop using GMainLoop

Just iterate directly.

10 years agogsettings tool: fix some sed damage
Ryan Lortie [Wed, 27 Nov 2013 17:40:27 +0000 (12:40 -0500)]
gsettings tool: fix some sed damage

The previous patch to simplify the GSettings commandline tool by making
more use of global variables went a bit too far and broke 'gsettings
monitor' when used without a specific key.

Fix that up again.

10 years agoFix a warning about _g_log_abort()
Dan Winship [Wed, 27 Nov 2013 15:57:43 +0000 (10:57 -0500)]
Fix a warning about _g_log_abort()

G_BREAKPOINT is not noreturn, so make it so that we abort() if it
returns, to make _g_log_abort() be properly noreturn again.

10 years agoFix the gtestutils core dump prevention again
Dan Winship [Wed, 27 Nov 2013 15:15:44 +0000 (10:15 -0500)]
Fix the gtestutils core dump prevention again

The previous patch was preventing core dumps on failed assertions, but
not on g_error()s.

10 years agoGDBusObjectManagerClient: keep the manager alive while firing signals
Rui Matos [Wed, 27 Nov 2013 13:32:05 +0000 (14:32 +0100)]
GDBusObjectManagerClient: keep the manager alive while firing signals

Handlers for the signals we emit might unref the object manager. Make
sure we keep it alive until we are done with it.

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

10 years agotests: move /param/implement to -m slow
Ryan Lortie [Wed, 27 Nov 2013 15:13:10 +0000 (10:13 -0500)]
tests: move /param/implement to -m slow

Take this test out of 'make check'.  It's causing problems for a lot of people
due to fact that it's essentially a forkbomb.  It's causing failures for Debian
on ARM and it's DoSing coredumps to system crash collectors.

The conditional only covers registration of the master, not the
subprocess parts.  This is because g_test_slow() always return FALSE in
the subprocesses, so they would fail to run if we didn't register them
unconditionally.

10 years agogbytes: Clarify the nullability of GBytes->data
Philip Withnall [Mon, 25 Nov 2013 13:26:45 +0000 (13:26 +0000)]
gbytes: Clarify the nullability of GBytes->data

Clarify that it is permitted for a GBytes to contain a NULL data
pointer, as long as its size is 0.

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

10 years agogfileutils: Fix a potential integer overflow
Philip Withnall [Mon, 25 Nov 2013 14:06:01 +0000 (14:06 +0000)]
gfileutils: Fix a potential integer overflow

When calculating the array sizes in get_contents_stdio(), there is a
possibility of overflow for very large files. Rearrange the overflow
checks to avoid this.

The code already handled some possibilities of files being too large, so
no new GError has been added to handle this; the existing
G_FILE_ERROR_FAILED is re-used.

Found by scan-build.

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

10 years agogvariant: Fix a potential memcpy(NULL) call
Philip Withnall [Mon, 25 Nov 2013 13:50:20 +0000 (13:50 +0000)]
gvariant: Fix a potential memcpy(NULL) call

This probably won’t crash, as it can only happen if (size == 0), but
add a check to be safe, and to shut up the static analyser.

This case can be reached with the following call:
    gvs_read_unaligned_le(NULL, 0)
which can be called from:
    gvs_tuple_get_child(value, index_)
with (value.data == NULL) and (value.size == 0).

Found by scan-build.

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

10 years agogio/tests: Add a dynamic type check assertion
Philip Withnall [Tue, 26 Nov 2013 11:21:37 +0000 (11:21 +0000)]
gio/tests: Add a dynamic type check assertion

This shuts up a static analysis false positive, and adds some extra
checking.

Found by scan-build.

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

10 years agogio/tests: Add a non-NULL assertion to help static analysis
Philip Withnall [Tue, 26 Nov 2013 11:20:01 +0000 (11:20 +0000)]
gio/tests: Add a non-NULL assertion to help static analysis

The static analyser (correctly) considers a type check to fail if the
variable is NULL. In this case, the address must be non-NULL as no error
was thrown by g_socket_connection_get_remote_address(), but the static
analyser doesn’t know this.

Add a non-NULL assertion anyway, both to shut the analyser up, and
because it’s good extra testing.

Found by scan-build.

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

10 years agogio/tests: Add non-NULL assertions to help static analysis
Philip Withnall [Tue, 26 Nov 2013 11:18:35 +0000 (11:18 +0000)]
gio/tests: Add non-NULL assertions to help static analysis

These prevent some false positives from the static analyser which are
caused by it not inspecting the invariants of
g_subprocess_communicate[_utf8]_finish() (i.e. that stdout and
stdout_str will always be set unless an error was returned).

They’re also good testing anyway.

Found by scan-build.

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

10 years agogio/tests: Fix a g_return_val_if_fail() in a void function
Philip Withnall [Tue, 26 Nov 2013 11:18:01 +0000 (11:18 +0000)]
gio/tests: Fix a g_return_val_if_fail() in a void function

Should be g_return_if_fail() instead.

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

10 years agogunixmounts: Fix a potential strcmp(NULL) call
Philip Withnall [Tue, 26 Nov 2013 11:16:57 +0000 (11:16 +0000)]
gunixmounts: Fix a potential strcmp(NULL) call

mntent->mnt_fsname may be NULL at this point; if so, fall to the second
branch and set mount_entry->device_path = NULL.

Found by scan-build.

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

10 years agogcontenttype: Fix a potential NULL pointer dereference
Philip Withnall [Tue, 26 Nov 2013 11:12:48 +0000 (11:12 +0000)]
gcontenttype: Fix a potential NULL pointer dereference

If the initial part of the header (‘MIME-TreeMagic’) is valid, but the
following line does not start with ‘[’ (i.e. is not a valid section
line), insert_matchlet() will be called with a NULL match pointer, and
will crash with a NULL pointer dereference.

Fix this by bailing out if a valid section line isn’t encountered before
the first insert_matchlet() call (i.e. between the header line and the
first data line).

Note that this has not been tested against a real treemagic file; the
fix is purely theoretical.

Found by scan-build.

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

10 years agogunixfdlist: Fix a potential NULL pointer dereference
Philip Withnall [Tue, 26 Nov 2013 11:11:21 +0000 (11:11 +0000)]
gunixfdlist: Fix a potential NULL pointer dereference

In the case that (n_fds == 0 && fds == NULL), memcpy() would be called
against a NULL src pointer. Even though the number of bytes to copy is
0, avoid the possibility of a crash by only calling if fds is non-NULL.

Found by scan-build.

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

10 years agogsocketaddress: Add an assertion to help static analysis
Philip Withnall [Tue, 26 Nov 2013 11:09:58 +0000 (11:09 +0000)]
gsocketaddress: Add an assertion to help static analysis

The static analyser will check dynamic type assertions and assume that
if they fail, the variable can either have the wrong type, or be NULL
(which is correct). The analyser doesn’t know that other constraints in
the API ensure the variable is non-NULL.

Add a non-null assertion to help the static analyser and shut it up in
this case.

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

10 years agogdbusserver: Fix a potential g_object_unref(NULL) call
Philip Withnall [Tue, 26 Nov 2013 11:08:50 +0000 (11:08 +0000)]
gdbusserver: Fix a potential g_object_unref(NULL) call

This can happen if the hash table lookup for ‘noncefile’ fails, and
hence the first ‘goto out’ is hit, at which point resolver is still
NULL.

Found with scan-build.

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

10 years agogcontenttype: Fix a potential g_object_unref(NULL) call
Philip Withnall [Tue, 26 Nov 2013 11:07:45 +0000 (11:07 +0000)]
gcontenttype: Fix a potential g_object_unref(NULL) call

This can happen if the g_file_query_info() call fails, returning NULL.

Found with scan-build.

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

10 years agogio/tests/memory-output-stream.c: Avoid an uninitialized variable
Chun-wei Fan [Fri, 15 Nov 2013 05:00:55 +0000 (13:00 +0800)]
gio/tests/memory-output-stream.c: Avoid an uninitialized variable

Be a little bit more careful in regards to initializing a primitive type
variable before passing it by reference, as it could have random stuff
in the variable's address depending on the CRT, such as MSVCR110.DLL,
causing random, invalid stuff being written in that address.

This will fix this test when built with Visual Studio 2012.

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

10 years agoglib/tests/enviroment.c: Fix running on Windows
Chun-wei Fan [Tue, 26 Nov 2013 10:57:04 +0000 (18:57 +0800)]
glib/tests/enviroment.c: Fix running on Windows

Don't attempt to insert environmental variables in the hash table during
the test listenv that is an empty string, as GetEnvironmentStringsW() also
returns special enviroment variables which have empty strings as their
variable names, at least on Windows 7 and 8.

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

10 years agogio: remove precondition checks from g_output_stream_printf()
Michael Natterer [Tue, 26 Nov 2013 22:00:52 +0000 (23:00 +0100)]
gio: remove precondition checks from g_output_stream_printf()

because we call g_output_stream_vprintf() which does exactly the same
checks.

10 years agogthread-posix: Don't use gslice allocated GRecMutex
Stef Walter [Thu, 31 Oct 2013 22:03:58 +0000 (23:03 +0100)]
gthread-posix: Don't use gslice allocated GRecMutex

This leads to problems during cleanup, and seems strange
to have locks defined in terms of things that need locking.

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

10 years agogio: add g_output_string_[v]printf()
Michael Natterer [Mon, 25 Nov 2013 22:26:21 +0000 (23:26 +0100)]
gio: add g_output_string_[v]printf()

which are useful for porting FILE* based output code.

10 years agogio/gdbusauthmechanismsha1.c: Move G_OS_* checks down
Chun-wei Fan [Tue, 26 Nov 2013 05:16:15 +0000 (13:16 +0800)]
gio/gdbusauthmechanismsha1.c: Move G_OS_* checks down

The G_OS_* checks are only valid if the GLib headers have been previously
included, so that io.h can be included properly on Windows

10 years agogsubprocess: Document g_subprocess_get_identifier()
Colin Walters [Mon, 25 Nov 2013 23:39:46 +0000 (18:39 -0500)]
gsubprocess: Document g_subprocess_get_identifier()

10 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 25 Nov 2013 16:27:43 +0000 (17:27 +0100)]
Updated Spanish translation

10 years agogsubprocess: Fix potential strlen(NULL) calls
Philip Withnall [Mon, 25 Nov 2013 13:35:53 +0000 (13:35 +0000)]
gsubprocess: Fix potential strlen(NULL) calls

Also clarify the nullability of stdin_buf arguments in GSubprocess
communication calls.

Found with scan-build.

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

10 years agoutf8: report allocation error
Marc-André Lureau [Wed, 6 Nov 2013 11:21:58 +0000 (12:21 +0100)]
utf8: report allocation error

Make some of the conversion functions a bit more friendly to allocation
failure.

Even though the glib policy is to abort() on allocation failure by
default, it can be quite helpful to return an allocation error for
functions already providing a GError.

I needed a safer g_utf16_to_utf8() to solve crash on big clipboard
operations with win32, related to rhbz#1017250 (and coming gdk handling
bug).

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

10 years agomsvc_recommended_pragmas.h: Treat C4819 warnings as errors
Chun-wei Fan [Mon, 25 Nov 2013 07:26:25 +0000 (15:26 +0800)]
msvc_recommended_pragmas.h: Treat C4819 warnings as errors

Warning C4819 in Visual Studio builds indicates an issue of Visual Studio
2005 and later running on East Asian locales of Windows, which likely
results in broken builds of GLib, Pango, GTK+, and possibly other GNOME
projects such as Cogl and Clutter (and is also an issue when building other
projects like QT and Firefox).

Treat this warning as an error as a result when building GLib-based items
on Visual Studio, and tell people how to remedy this issue correctly.

10 years agoReorganize the "don't dump core from test subprocesses" code.
Dan Winship [Sat, 23 Nov 2013 17:06:05 +0000 (12:06 -0500)]
Reorganize the "don't dump core from test subprocesses" code.

g_test_init() was calling _g_messages_set_exit_on_fatal() from
subprocesses, to make fatal log messages call _exit() rather than
abort(), but the function name is sort of confusing, and we don't
really need it anyway, since g_log() can just call g_test_subprocess()
instead and decide for itself.

Likewise, update g_assertion_message() to do the check itself, rather
than calling into gmessages to do it, and fix
g_assertion_message_expr() to also check whether it should exit or
abort. (Previously it always called abort(), although this didn't
actually matter since that was dead code until
test_nonfatal_assertions was added.)

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

10 years agogtestutils: add g_assert_nonnull() to go with g_assert_null()
Dan Winship [Sun, 10 Nov 2013 20:27:26 +0000 (15:27 -0500)]
gtestutils: add g_assert_nonnull() to go with g_assert_null()

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

10 years agogtestutils: fix g_test_set_nonfatal_assertions()
Dan Winship [Sun, 10 Nov 2013 20:44:06 +0000 (15:44 -0500)]
gtestutils: fix g_test_set_nonfatal_assertions()

g_test_set_nonfatal_assertions() was a no-op, because
g_assertion_message() wasn't actually checking the
test_nonfatal_assertions flag. Fix that and add a test.

Also, g_test_set_nonfatal_assertions() has to set test_mode_fatal to
FALSE as well, or else a failed assertion will cause the test program
to abort at the end of the failed test.

Also, belatedly add this and the new g_assert_* methods to the docs.

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

10 years agoAdd boolean returns to some hash functions
Matthias Clasen [Sun, 24 Nov 2013 06:22:44 +0000 (01:22 -0500)]
Add boolean returns to some hash functions

The functions g_hash_table_insert, g_hash_table_replace
and g_hash_table_add now return TRUE if they inserted a
new key/value pair.

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

10 years agoAvoid a compiler warning
Matthias Clasen [Sun, 24 Nov 2013 05:56:26 +0000 (00:56 -0500)]
Avoid a compiler warning

10 years agoFix G_OS #ifdefs in gbusserver.c
Manuel Bachmann [Sun, 24 Nov 2013 03:51:21 +0000 (04:51 +0100)]
Fix G_OS #ifdefs in gbusserver.c

G_OS #ifdefs are only available once glibconfig.h has been
evaluated ; that is, after including glib headers.
Move this block down so it gets correctly evaluated.

10 years agoFix up appinfo test
Matthias Clasen [Sun, 24 Nov 2013 03:24:00 +0000 (22:24 -0500)]
Fix up appinfo test

Make it possible to skip the terminal-launching test simply
by setting DISPLAY= . Previously, you had to unset DISPLAY,
which is a little more cumbersome.

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

10 years agoFix up the appinfo test
Matthias Clasen [Sun, 24 Nov 2013 03:21:29 +0000 (22:21 -0500)]
Fix up the appinfo test

One testcase was launching appinfo-test from a GAppInfo that
does not have a filename. In this case, the G_LAUNCHED_DESKTOP_FILE
envvar is not exported. Make appinfo-test deal with that, without
spewing warnings.

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

10 years agoFix warnings in a the actions test
Matthias Clasen [Sun, 24 Nov 2013 02:28:40 +0000 (21:28 -0500)]
Fix warnings in a the actions test

The actions test tests the GSimpleActionGroup API. Maybe this
should be moved to use GActionMap, but for now, just disable
the deprecations.

There was also one test that wasn't actually hooked up, so
do that as well.

10 years agoFix array API inconsistency
Matthias Clasen [Sun, 24 Nov 2013 02:10:06 +0000 (21:10 -0500)]
Fix array API inconsistency

g_array_remove_range and g_byte_array_remove_range return
a pointer to the array, g_ptr_array_remove_range returns
void. Since it is pretty harmless, make it return the array
too.

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

10 years agoFix the stack direction check again
Matthias Clasen [Sun, 24 Nov 2013 02:09:32 +0000 (21:09 -0500)]
Fix the stack direction check again

Turns out I got it wrong.

10 years agoImprove stack direction detection
Matthias Clasen [Sun, 24 Nov 2013 01:24:49 +0000 (20:24 -0500)]
Improve stack direction detection

When the function in the test program is inlined, all bets are
off whether the detection will work correctly or not. Make it
harder for the compiler to play games on us by making the
function recursive.

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

10 years agoFix the configure check for growing stack
Matthias Clasen [Sun, 24 Nov 2013 01:12:13 +0000 (20:12 -0500)]
Fix the configure check for growing stack

The check was getting the direction wrong, as proven by the
just committed signal invocation hint test.

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

10 years agoAdd a test for g_signal_get_invocation_hint
Matthias Clasen [Sun, 24 Nov 2013 01:06:07 +0000 (20:06 -0500)]
Add a test for g_signal_get_invocation_hint

This is the sole piece of code in GLib where we make use of the
stack growing direction. And this test proves that we have been
getting the direction wrong all these years...

10 years agoapplication: Use printerr for runtime errors
Christian Persch [Thu, 24 May 2012 17:18:44 +0000 (19:18 +0200)]
application: Use printerr for runtime errors

g_critical can be fatal (with --g-fatal-warnings, or some env var set),
so don't use it to print out runtime errors.

Bug #676761.

10 years agoFix desktop-app-info test
Matthias Clasen [Sat, 23 Nov 2013 23:15:04 +0000 (18:15 -0500)]
Fix desktop-app-info test

The recent change to the search scoring algorithm made
nautilus and konqueror switch places in the search results.
Update the test to reflect that.

10 years agogtestdbus: Properly close server connections
Stef Walter [Sat, 9 Nov 2013 19:18:34 +0000 (20:18 +0100)]
gtestdbus: Properly close server connections

Otherwise g_test_dbus_down() following a g_test_dbus_stop()
will hang until it times out.

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

10 years agoAdd a test for notify emission ordering
Matthias Clasen [Sat, 23 Nov 2013 21:58:51 +0000 (16:58 -0500)]
Add a test for notify emission ordering

This tests the ordering that was just documented.
See

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

10 years agoDocument details of GObject::notify
Matthias Clasen [Sat, 23 Nov 2013 21:44:31 +0000 (16:44 -0500)]
Document details of GObject::notify

The signals queued while notify is frozen are emitted in
reverse order, while omitting duplicates. The lack of documentation
for this was pointed out in

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

10 years agogdbus-connection: Fix race condition in test
Stef Walter [Sat, 9 Nov 2013 08:25:02 +0000 (09:25 +0100)]
gdbus-connection: Fix race condition in test

The test was expecting that the spawned process wouldn't start
up before the NameOwnerChanged signal was subscribed.

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

10 years agoAdd basic test for the GNotification gtk backend
Lars Uebernickel [Tue, 29 Oct 2013 07:01:38 +0000 (00:01 -0700)]
Add basic test for the GNotification gtk backend

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

10 years agogtestdbus: Don't destroy GSource twice
Stef Walter [Sat, 9 Nov 2013 19:17:49 +0000 (20:17 +0100)]
gtestdbus: Don't destroy GSource twice

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

10 years agoGObject: Introspection annotations for enums
Gergely POLONKAI [Wed, 18 Sep 2013 11:01:00 +0000 (11:01 +0000)]
GObject: Introspection annotations for enums

This commit adds a few missing annotations to g_enum and
g_flags functions.

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

10 years agoGSettings: More docs for deprecated _list_schemas()
Bastien Nocera [Thu, 14 Nov 2013 16:39:06 +0000 (17:39 +0100)]
GSettings: More docs for deprecated _list_schemas()

Most _list_schemas() uses were to check for the availability
of a particular schema. g_settings_schema_source_lookup() is
a better way to do this.

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

10 years agoGVariantBuilder: small documentation fixes
Matthias Clasen [Sat, 23 Nov 2013 18:16:06 +0000 (13:16 -0500)]
GVariantBuilder: small documentation fixes

The examples for g_variant_builder_add and
g_variant_builder_add_parsed were leaking a heap-allocated
builder. Fix that by converting the examples to stack
allocation.

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

10 years agoCLOEXEC fix for older FreeBSDs and OS X.
Andrew Walton [Tue, 12 Nov 2013 21:04:49 +0000 (13:04 -0800)]
CLOEXEC fix for older FreeBSDs and OS X.

Some older POSIX-flavored operating systems may not have adopted
O_CLOEXEC yet.

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

10 years agoSmall documentation clarification
Matthias Clasen [Sat, 23 Nov 2013 15:49:00 +0000 (10:49 -0500)]
Small documentation clarification

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

10 years agogiomodule: Allow overriding source directory gio modules are loaded from
Stef Walter [Fri, 8 Nov 2013 13:26:33 +0000 (14:26 +0100)]
giomodule: Allow overriding source directory gio modules are loaded from

When testing (and valgrinding) we need to have a known set of modules
loaded.

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

10 years agoglib-tap.mk: fix to actually use the TAP driver
Dan Winship [Sun, 10 Nov 2013 18:27:15 +0000 (13:27 -0500)]
glib-tap.mk: fix to actually use the TAP driver

The Makefile rules in glib-tap.mk were copied from an example that
assumed that all the test programs had names ending in ".test", so
they didn't actually have any effect for us and resulted in us still
using the standard automake test driver. Fix this so we actually do
use TAP now.

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

10 years agogio/tests: fix output of gdbus-proxy-threads and gdbus-threading
Dan Winship [Sun, 10 Nov 2013 18:26:01 +0000 (13:26 -0500)]
gio/tests: fix output of gdbus-proxy-threads and gdbus-threading

Make gdbus-proxy-threads and gdbus-threading print a newline at the
end of their progress strings, to avoid messing up their TAP-format
output.

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

10 years agogio/tests: basic-application is a helper program, not a test
Dan Winship [Sun, 10 Nov 2013 18:25:45 +0000 (13:25 -0500)]
gio/tests: basic-application is a helper program, not a test

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

10 years agogtestutils: add "options" to g_test_init(), make option-argv0 use gtester
Dan Winship [Sun, 10 Nov 2013 18:23:15 +0000 (13:23 -0500)]
gtestutils: add "options" to g_test_init(), make option-argv0 use gtester

Declare that the previously-unused "..." argument to g_test_init() is
actually a NULL-terminated list of strings indicating testing options,
and add an option "no_g_set_prgname", which keeps g_test_init() from
calling g_set_prgname(). Then we can port glib/tests/option-argv0 to
use gtester, by passing that option.

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

10 years agoglib/tests/include: port to gtester
Dan Winship [Sun, 10 Nov 2013 18:22:46 +0000 (13:22 -0500)]
glib/tests/include: port to gtester

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

10 years agoAdd some mainloop instrumentation
Matthias Clasen [Sat, 23 Nov 2013 05:22:09 +0000 (00:22 -0500)]
Add some mainloop instrumentation

Add trace points around adding, removing and dispatching of
sources.

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

10 years agobuilding: Document C90 and POSIX requirements
Dan Winship [Wed, 20 Nov 2013 14:41:13 +0000 (09:41 -0500)]
building: Document C90 and POSIX requirements

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

10 years agobuilding: belated docs update: GNU make is required, not recommended
Dan Winship [Wed, 20 Nov 2013 14:31:20 +0000 (09:31 -0500)]
building: belated docs update: GNU make is required, not recommended

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

10 years agoReplace #ifdef HAVE_UNISTD_H checks with #ifdef G_OS_UNIX
Dan Winship [Sat, 19 Oct 2013 17:04:00 +0000 (13:04 -0400)]
Replace #ifdef HAVE_UNISTD_H checks with #ifdef G_OS_UNIX

In Windows development environments that have it, <unistd.h> is mostly
just a wrapper around several other native headers (in particular,
<io.h>, which contains read(), close(), etc, and <process.h>, which
contains getpid()). But given that some Windows dev environments don't
have <unistd.h>, everything that uses those functions on Windows
already needed to include the correct Windows header as well, and so
there is never any point to including <unistd.h> on Windows.

Also, remove some <unistd.h> includes (and a few others) that were
unnecessary even on unix.

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

10 years agoRequire POSIX.1 (1990) compliance on unix
Dan Winship [Sat, 19 Oct 2013 17:03:59 +0000 (13:03 -0400)]
Require POSIX.1 (1990) compliance on unix

Assume unix platforms support the original POSIX.1 standard.
Specifically, assume that if G_OS_UNIX, then we have chown(),
getcwd(), getgrgid(), getpwuid(), link(), <grp.h>, <pwd.h>,
<sys/types.h>, <sys/uio.h>, <sys/wait.h>, and <unistd.h>.

Additionally, since all versions of Windows that we care about also
have <sys/types.h>, we can remove HAVE_SYS_TYPES_H checks everywhere.

Also remove one include of <sys/times.h>, and the corresponding
configure check, since the include is not currently needed (and may
always have just been a typo for <sys/time.h>).

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

10 years agoRequire C90 compliance
Dan Winship [Sat, 19 Oct 2013 17:03:58 +0000 (13:03 -0400)]
Require C90 compliance

Assume all supported platforms implement C90, and therefore they
(correctly) implement atexit(), memmove(), setlocale(), strerror(),
and vprintf(), and have <float.h> and <limits.h>.

(Also remove the configure check testing that "do ... while (0)" works
correctly; the non-do/while-based version of G_STMT_START and
G_STMT_END was removed years ago, but the check remained. Also, remove
some checks that configure.ac claimed were needed for libcharset, but
aren't actually used.)

Note that removing the g_memmove() function is not an ABI break even
on systems where g_memmove() was previously not a macro, because it
was never marked GLIB_AVAILABLE_IN_ALL or listed in glib.symbols, so
it would have been glib-internal since 2004.

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

10 years agoRemove alleged support for last-millennium Unixes
Dan Winship [Sat, 19 Oct 2013 17:03:56 +0000 (13:03 -0400)]
Remove alleged support for last-millennium Unixes

Remove workarounds for NeXTStep (last released in 1995), SunOS (1994),
HP-UX 9.x (1992) and 10.x (1995), OSF/1 / Digital UNIX / Tru64 UNIX
4.x (1999), and AIX 4.x (1999).

HP-UX 11 implements dlopen(), so dropping support for earlier versions
also lets us remove the HP-UX-specific gmodule-dld.

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

10 years agoRemove alleged support for BeOS
Dan Winship [Sat, 19 Oct 2013 17:03:55 +0000 (13:03 -0400)]
Remove alleged support for BeOS

Since the initial addition of BeOS support in 1999, there has only
been one update to it (in 2005, and it wasn't even very big). GLib is
known to not currently build on Haiku (or presumably actual BeOS)
without additional patching, and the fact that there isn't a single
G_OS_BEOS check in gio/ is suspicious.

Additionally, other than the GModule implementation, all of the
existing G_OS_BEOS checks are either (a) "G_OS_UNIX || G_OS_BEOS", or
(b) random minor POSIXy tweaks (include this header file rather than
that one, etc), suggesting that if we were going to support Haiku, it
would probably be simpler to treat it as a special kind of G_OS_UNIX
(as we do with Mac OS X) rather than as its own completely different
thing.

So, kill G_OS_BEOS.

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

10 years agoRemove alleged support for OS/2
Dan Winship [Sat, 19 Oct 2013 17:03:46 +0000 (13:03 -0400)]
Remove alleged support for OS/2

In particular, remove the OS/2 GModule implementation (which AFAICT
was never actually built even on OS/2).

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

10 years agogbacktrace: Print out gdb exec errors correctly
Stef Walter [Tue, 29 Oct 2013 17:03:29 +0000 (18:03 +0100)]
gbacktrace: Print out gdb exec errors correctly

We want to see error messages related to starting and running
gdb (such as if it's not installed).

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

10 years agobuild: Give internal libraries higher precedence
Michael Haubenwallner [Thu, 14 Nov 2013 15:22:10 +0000 (16:22 +0100)]
build: Give internal libraries higher precedence

Linking local libraries too late may cause preinstalled libraries to
get found earlier, due to external library paths in .la files.

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

10 years agogmessages: Add g_info macro for G_LOG_LEVEL_INFO
Stef Walter [Tue, 29 Oct 2013 20:30:06 +0000 (21:30 +0100)]
gmessages: Add g_info macro for G_LOG_LEVEL_INFO

For completeness. Although less used than others, projects want
to use this, and end up having to define it awkwardly themselves.

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

10 years agoGSocketClient: For _CONNECTING event, make remote address accessible
Colin Walters [Mon, 18 Nov 2013 21:15:34 +0000 (16:15 -0500)]
GSocketClient: For _CONNECTING event, make remote address accessible

My application (hotssh) would like to get the resolved address from DNS,
before we start the connect().

We could add a new event, but it's easy enough to just cache it on the
GSocketConnection; this avoids any new API.

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

10 years agoAIX splice() is something different
Michael Haubenwallner [Thu, 14 Nov 2013 15:16:59 +0000 (16:16 +0100)]
AIX splice() is something different

AIX does provide the splice() symbol, but this does have different
signature and usecase than what Linux may provide.

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

10 years agoUse AC_HEADER_MAJOR
Michael Haubenwallner [Thu, 14 Nov 2013 15:12:02 +0000 (16:12 +0100)]
Use AC_HEADER_MAJOR

Instead of checking for sys/mkdev.h headerfile, there is the
AC_HEADER_MAJOR helper for how to get major(), minor(), makedev().

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

10 years agogsettings.m4: @GSETTINGS_RULES@: Support srcdir != builddir with nonrecursive make
Colin Walters [Tue, 12 Nov 2013 18:41:47 +0000 (13:41 -0500)]
gsettings.m4: @GSETTINGS_RULES@: Support srcdir != builddir with nonrecursive make

In hotssh I use nonrecursive make.  gnome-continuous uses srcdir !=
builddir by default.  @GSETTINGS_RULES@ will then attempt to touch a
nonexistent path.

This patch fixes that.

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

10 years agoGDummyTlsBackend: cache the GDummyTlsDatabase
Dan Winship [Sun, 17 Nov 2013 14:45:20 +0000 (09:45 -0500)]
GDummyTlsBackend: cache the GDummyTlsDatabase

The default GTlsDatabase is supposed to be a singleton (and libsoup
has tests that will fail if it's not).

10 years agogobject: Box GMappedFile
Ray Strode [Fri, 15 Nov 2013 19:47:09 +0000 (14:47 -0500)]
gobject: Box GMappedFile

GMappedFile is current unintrospectable, because it's not a registered
box type.  It already has reference counting functions, so there's
little reason not to box it.

This commit adds GMappedFile to the hoard of other boxes types handled
by gboxed.c

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

10 years agoFix GSettings testcase again
Ryan Lortie [Fri, 15 Nov 2013 20:23:43 +0000 (15:23 -0500)]
Fix GSettings testcase again

Hopefully this one will work for both srcdir == builddir and not.

10 years agogstrfuncs: Mention nullability in g_ascii_strcasecmp() documentation
Philip Withnall [Thu, 14 Nov 2013 18:06:32 +0000 (18:06 +0000)]
gstrfuncs: Mention nullability in g_ascii_strcasecmp() documentation

Like strcmp(), g_ascii_strcasecmp() requires that both of its parameters
be non-%NULL.