platform/upstream/glib.git
10 years agog_get_current_dir(): consult PWD first
Ryan Lortie [Sun, 8 Dec 2013 23:18:16 +0000 (18:18 -0500)]
g_get_current_dir(): consult PWD first

Check if the current directory is the same as $PWD.  This matches the
behaviour of the get_current_dir_name() function in glibc.

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

10 years agog_settings_get: only check for non-copying format string
Lars Uebernickel [Sun, 8 Dec 2013 16:30:33 +0000 (17:30 +0100)]
g_settings_get: only check for non-copying format string

396d40af introduced a redundant call to g_variant_check_format_string().
Checking whether the format string copies all values is enough.

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

10 years agoclang fixes: tweak last commit
Ryan Lortie [Sun, 8 Dec 2013 21:38:47 +0000 (16:38 -0500)]
clang fixes: tweak last commit

We need to actually ignore "-Wformat-nonliteral" to make clang happy

10 years ago[PATCH] Fix trivial non literal format uses
Ryan Lortie [Sun, 8 Dec 2013 19:22:51 +0000 (14:22 -0500)]
[PATCH] Fix trivial non literal format uses

Based on a patch from Henrique Dante de Almeida <hdante@gmail.com>.

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

10 years agoUpdate Chinese simplified translation
keyring [Sat, 7 Dec 2013 07:05:26 +0000 (15:05 +0800)]
Update Chinese simplified translation

10 years agog_settings_get: check validity of format string
Lars Uebernickel [Fri, 6 Dec 2013 15:01:48 +0000 (16:01 +0100)]
g_settings_get: check validity of format string

Allow only format strings that copy all values (i.e, don't contain '&'),
as the returned pointers might become invalid in some rare cases.

Since this is technically an API break, this patch only prints a
critical when a faulty format string is detected, but still fetches the
values.

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

10 years agogtestdbus: Add a note about thread safety to the documentation
Philip Withnall [Tue, 3 Dec 2013 08:27:05 +0000 (08:27 +0000)]
gtestdbus: Add a note about thread safety to the documentation

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

10 years agoFix documentation typos in GTask and GCancellable examples
Daiki Ueno [Thu, 5 Dec 2013 09:16:36 +0000 (18:16 +0900)]
Fix documentation typos in GTask and GCancellable examples

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

10 years agogsignal: Signal connection ids are always > 0 if successful
Colin Walters [Tue, 3 Dec 2013 22:15:14 +0000 (17:15 -0500)]
gsignal: Signal connection ids are always > 0 if successful

Note this explicitly so that people can rely on doing:

if (mystruct->sigid > 0)
  g_signal_disconnect (mystruct->object, mystruct->sigid);

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

10 years agogutf8: use g_try_malloc_n
Marc-André Lureau [Tue, 26 Nov 2013 16:45:37 +0000 (17:45 +0100)]
gutf8: use g_try_malloc_n

As recommended by Christian Persch.

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

10 years agogmessages: make _g_log_abort() do only breakpoints again
Marc-André Lureau [Tue, 3 Dec 2013 14:35:50 +0000 (15:35 +0100)]
gmessages: make _g_log_abort() do only breakpoints again

Commit e53caad4 makes _g_log_abort() noreturn by calling abort()
unconditionally.

However, it is useful to be able to skip some log_abort() with a
debugger, to reach a point of interest. Revert back to previous
behaviour. Make g_assert_warning() noreturn by calling abort().

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

10 years agoRemove g_trap_instance_signals as well
Matthias Clasen [Tue, 3 Dec 2013 03:26:48 +0000 (22:26 -0500)]
Remove g_trap_instance_signals as well

This is another crude conditional breakpoint mechanism and can
be done better with actual conditional breakpoints or with systemtap
tracepoints.

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

10 years agoDrop g_trap_object_ref debugging mechanism
Matthias Clasen [Tue, 3 Dec 2013 02:48:03 +0000 (21:48 -0500)]
Drop g_trap_object_ref debugging mechanism

This is really just a very crude and limited conditional breakpoint.
Update the documentation to explain conditional breakpoints in
gdb instead. Also, remove the link to refdbg, which appears dead.

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

10 years agoDocument clearly async functions not copying its args
Xavier Claessens [Mon, 2 Dec 2013 19:37:23 +0000 (14:37 -0500)]
Document clearly async functions not copying its args

Usually async methods copy/ref its arguments so caller can
forget about them. g_file_replace_contents_async() and
g_output_stream_write_async() are exceptions.

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

10 years agoGFile: add GBytes version of _replace_contents_async()
Xavier Claessens [Mon, 2 Dec 2013 19:40:35 +0000 (14:40 -0500)]
GFile: add GBytes version of _replace_contents_async()

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

10 years agogsubprocess: Annotate g_subprocess_newv()
Colin Walters [Sun, 1 Dec 2013 23:52:37 +0000 (18:52 -0500)]
gsubprocess: Annotate g_subprocess_newv()

So that it can actually be invoked by bindings.

10 years agobuild/win32/vs9/gio.vcprojin: Use UNIX Line endings
Chun-wei Fan [Mon, 2 Dec 2013 01:51:18 +0000 (09:51 +0800)]
build/win32/vs9/gio.vcprojin: Use UNIX Line endings

Be more consistent with the other project file templates, which will
simplify future application of patches.

10 years agoInstall all test data
Matthias Clasen [Sun, 1 Dec 2013 16:45:41 +0000 (11:45 -0500)]
Install all test data

The desktop-files directory contains a mimeapps.cache file
that was not installed as data for installed tests, causing
the file measure test to fail only in when installed.

10 years agoUpdated Lithuanian translation
Aurimas Černius [Sun, 1 Dec 2013 16:30:19 +0000 (18:30 +0200)]
Updated Lithuanian translation

10 years agoImprove file measure testcase
Matthias Clasen [Sun, 1 Dec 2013 03:51:03 +0000 (22:51 -0500)]
Improve file measure testcase

Make the testcase compare the byte size to what is reported
by du. Also add a test for the async api, and mak eit test
the progress reporting callback.

10 years agogtestdbus: Minor documentation fixes
Philip Withnall [Tue, 12 Nov 2013 13:14:19 +0000 (13:14 +0000)]
gtestdbus: Minor documentation fixes

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

10 years agogtestdbus: Fix non-const use of const variables
Philip Withnall [Tue, 12 Nov 2013 13:10:33 +0000 (13:10 +0000)]
gtestdbus: Fix non-const use of const variables

The argv array should be declared as const.

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

10 years agogtestdbus: Fix variable shadowing
Philip Withnall [Tue, 12 Nov 2013 13:09:56 +0000 (13:09 +0000)]
gtestdbus: Fix variable shadowing

Shut up, GCC.

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

10 years agoAdd a test for g_file_measure_disk_usage
Matthias Clasen [Fri, 29 Nov 2013 05:11:47 +0000 (00:11 -0500)]
Add a test for g_file_measure_disk_usage

10 years agotests/gsubprocess: Only compare basename of /tmp
Colin Walters [Fri, 29 Nov 2013 04:12:26 +0000 (04:12 +0000)]
tests/gsubprocess: Only compare basename of /tmp

Otherwise, we break in Continuous where /tmp == /sysroot/tmp,
and something in the execve() or the kernel will do realpath()
for us.

10 years agoImprove GType test coverage
Matthias Clasen [Fri, 29 Nov 2013 02:58:48 +0000 (21:58 -0500)]
Improve GType test coverage

Add a test for g_type_class_get_instance_private_offset

10 years agoAdd a test for g_atexit
Matthias Clasen [Fri, 29 Nov 2013 02:58:25 +0000 (21:58 -0500)]
Add a test for g_atexit

10 years agoImprove GApplication test coverage
Matthias Clasen [Fri, 29 Nov 2013 02:57:47 +0000 (21:57 -0500)]
Improve GApplication test coverage

Exercise more of the GActionMap implementation.

10 years agoImprove GNotification test coverage
Matthias Clasen [Fri, 29 Nov 2013 02:56:48 +0000 (21:56 -0500)]
Improve GNotification test coverage

10 years agoImprove GSimpleActionGroup test coverage
Matthias Clasen [Fri, 29 Nov 2013 02:53:53 +0000 (21:53 -0500)]
Improve GSimpleActionGroup test coverage

Add a case that overwrites an existing action.

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