Commit Graph

25990 Commits

Author SHA1 Message Date
Philip Withnall
5e00b30a29 ci: Add gdb to some CI images
This will be useful in general, for manually debugging failures if we
need (without having to rebuild the CI images to do so).

It will also be useful for the `assert-msg-test` test, which is being
reworked in !2767.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1434
2022-06-27 15:53:55 +01:00
Philip Withnall
087272777b tests: Fix incorrect basename comparison in gsubprocess test
This was causing intermittent failures on macOS, depending on whether
the tmpdir ended with a `/` or `/some-dir`. `g_strrstr()` is not the
right function to use to extract a basename from a path, for this
reason.

When it failed, the macOS test was failing with:
```
ok 16 /gsubprocess/env
Bail out! GLib-GIO:ERROR:../gio/tests/gsubprocess.c:1507:test_cwd: assertion failed (basename == tmp_lineend_basename): ("/T\n" == "/\n")
```

The test now passes reliably, which means that it can be removed from
the list of expected failures on macOS.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1392
2022-06-27 15:02:55 +01:00
Philip Withnall
6d381c9668 Merge branch 'getfsent_lock' into 'main'
Add lock in _g_get_unix_mount_points() around *fsent() functions

See merge request GNOME/glib!1717
2022-06-27 11:20:49 +00:00
Philip Withnall
3c47fa6e20 Merge branch 'getfsent_lock2' into 'main'
_g_get_unix_mount_points(): reduce syscalls inside loop

See merge request GNOME/glib!2783
2022-06-27 11:14:01 +00:00
Philip Withnall
eec8171dab Merge branch 'wip/smcv/more-figure-spaces' into 'main'
gdatetime test: Consistently expect %k to generate a figure space

See merge request GNOME/glib!2773
2022-06-27 11:09:26 +00:00
Simon McVittie
6a599e0349 gdatetime test: Consistently expect %k to generate a figure space
This part of test_non_utf8_printf() was missed while converting other
test expectations to look for a figure space, probably because it is
only run if a legacy ja_JP.eucjp locale exists. Debian generates a fairly
comprehensive set of locales (including some that are non-UTF-8) while
running GLib's installed-tests, so this was caught by CI.

Fixes: 7074122 "gdatetime: Pad numbers with numeric space"
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-06-27 09:29:35 +01:00
Michael Catanzaro
6e81c21a8b Merge branch 'wip/smcv/revert-fa8c7c0d' into 'main'
Revert "gobject: Use g_datalist_id_remove_multiple"

See merge request GNOME/glib!2784
2022-06-26 17:16:51 +00:00
Simon McVittie
d4043eced5 Revert "gobject: Use g_datalist_id_remove_multiple"
This reverts commit fa8c7c0 "gobject: Use g_datalist_id_remove_multiple"
(or more specifically the parts of it that were not already reverted
in 01ac1d9 "gobject: Fix crash when disposing a GtkAccelGroup".

Workaround for https://gitlab.gnome.org/GNOME/glib/-/issues/2676

Bug: https://gitlab.gnome.org/GNOME/glib/-/issues/2676
2022-06-26 18:00:52 +01:00
Aleksandr Melman
f3838e517b Update Russian translation 2022-06-25 18:40:19 +00:00
Rozhuk Ivan
f43cf34151 [PATCH] Add lock in _g_get_unix_mount_points() around *fsent() functions 2022-06-25 19:22:06 +03:00
Rozhuk Ivan
02d0d6497b [PATCH] _g_get_unix_mount_points(): reduce syscalls inside loop 2022-06-25 19:01:30 +03:00
Simon McVittie
99a7c6351c Merge branch 'wip/pwithnall/more-macos-fixes' into 'main'
tests: Fix macOS failures in the file tests

See merge request GNOME/glib!2779
2022-06-25 10:23:49 +00:00
Philip Withnall
059a5fd4da tests: Skip various default handler tests on macOS
They are not currently supported by `gosxappinfo.m`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-06-24 12:43:18 +01:00
Philip Withnall
dbdc9ca995 gosxappinfo: Correctly return an error from create_from_commandline()
Creating a `GAppInfo` from a commandline isn’t currently supported on
macOS, but the implementation was incorrectly returning `NULL` without
setting the `GError`.

This was being caught by the new tests in `gio/tests/file.c`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-06-24 12:27:45 +01:00
Philip Withnall
a98bd895d5 tests: Fix a path comparison in the file tests
On macOS the comparison was failing as one of the paths had a trailing
slash while the other didn’t.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-06-24 12:27:45 +01:00
Yuri Chornoivan
468e096983 Update Ukrainian translation 2022-06-24 06:36:19 +00:00
Peter Bloomfield
e95a6bdd7d glib/tests/dataset: Use existing code
`destroy_index` duplicates `destroy_count`, and `foreach_func()`
essentially duplicates `notify()`.
2022-06-23 21:08:41 -04:00
Peter Bloomfield
a437a97ffd dataset: Rename i as destroy_index and move it out of destroy_func(), so that it can be checked to confirm that destroy_func() was called three times. 2022-06-23 22:17:13 +00:00
Peter Bloomfield
42826576a8 glib/tests/dataset: Test id_remove_multiple
Test that destroy-funcs are called in the order that the keys are
specified, not the order that they are found in the datalist.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2672
2022-06-23 17:41:55 -04:00
Peter Bloomfield
a4fa456e67 gdataset: Preserve destruction order
In `g_data_remove_internal()`, call the `GDataElt:destroy` functions in the
order that they appear in `keys`, instead of the order that they are found in
`datalist`.

Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2672
2022-06-23 17:41:55 -04:00
Peter Bloomfield
ac113c1ed2 In test_datalist_id_remove_multiple(), verify that the data list contains 3 items before calling g_datalist_id_remove_multiple(). 2022-06-23 17:41:55 -04:00
Peter Bloomfield
ad0f7199f1 glib/tests/dataset: Add a test
Test that `g_datalist_id_remove_multiple()` removes all the keys it is given.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2672
2022-06-23 17:41:55 -04:00
Peter Bloomfield
8c4598aab3 dataset: Do not increment
Do not increment the `data` pointer when it points to an item that has
not been inspected.

Helps https://gitlab.gnome.org/GNOME/glib/-/issues/2672
2022-06-23 17:41:55 -04:00
Hugo Carvalho
44bb5c26fc Update Portuguese translation 2022-06-23 21:39:02 +00:00
Philip Withnall
ac898b8e67 Merge branch 'fix-macos-again' into 'main'
tests: Fix type mismatches in new atomic tests when compiling with clang

See merge request GNOME/glib!2774
2022-06-23 18:44:13 +00:00
Marco Trevisan (Treviño)
00f3f0d407 gthread: Use atomic pointer exchange to check value set on g_init_leave 2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
2c322f2a65 gmain: Do atomic addition before checking the old value on ref
So we avoid working on a value that is not been updated yet.
2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
bfd77693ce gresource: Use atomic pointer exchange operations to nullify and check 2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
9c32cfbaaa gfileattribute: Do atomic addition before checking the old value on ref
So we avoid working on a value that is not been updated yet.
2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
576e5f2f87 cancellable: Use more atomic exchanges operations
We used to do get and set atomic operations pair, but these may be
unsafe in some cases as threads may rely on data that is changed in
in between them, however this is not a problem if we do exchange the
pointers.

So just use exchange ops, in this way we can avoid lock/unlock mutex
dances
2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
920f54e795 gatomicarray: Use atomic exchange for data value
We can use pointer exchange now to avoid doing two operations to switch
to the new data pointer.

Since we're asserting in case of invalid data, we can just do this check
at later point, without involving any different behavior.

This changes in the unlikely case that G_DISABLE_ASSERT is defined, as in such
case we should undo the operation.
2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
e7269a26e4 gio/tests: Ensure that a cancellable hangs if reset from cancellable callback 2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
e218371f19 gio/tests: Ensure that cancellable is cancelled when emitting the signal
Use a race between threads resetting and cancelling a cancellable and
ensure that when we call the callback the cancellable is cancelled
2022-06-23 20:01:12 +02:00
Marco Trevisan (Treviño)
62192925b6 gio/tests: Add tests for cancellable pollfd and cancellation callbacks 2022-06-23 20:01:12 +02:00
Philip Withnall
b5231ed003 Merge branch 'gthread-initial-cleanups' into 'main'
gthread: Some code cleanups and fixes

See merge request GNOME/glib!2775
2022-06-23 17:07:09 +00:00
Philip Withnall
191923ce61 Merge branch 'wip/smcv/none-flags' into 'main'
Add a NONE or DEFAULT member to most flags-sets

See merge request GNOME/glib!2576
2022-06-23 16:09:38 +00:00
Marco Trevisan (Treviño)
8d98617297 gthread-posix: Use named states to manage the mutex states
We used to use raw numbers to control the mutex state, we can use a
nicer enum to avoid dealing with pure numbers.
2022-06-23 17:50:12 +02:00
Marco Trevisan (Treviño)
15d2053122 glib/tests/autoptr: Also ensure that GRecMutexLocker can re-lock a mutex
It's native in the actual GRecMutex, but better to check that again.
2022-06-23 17:48:44 +02:00
Marco Trevisan (Treviño)
e2d2db6433 glib/tests/autoptr: Release the acquired locks on GRecMutex 2022-06-23 17:48:44 +02:00
Marco Trevisan (Treviño)
9dffecf5f5 gthread: Fix Since tag typo in documentation for some methods 2022-06-23 17:45:04 +02:00
Philip Withnall
35c4b640bb tests: Fix type mismatches in new atomic tests when compiling with clang
Clang seems to apply more rigorous type checks across the different
arguments to the atomic builtins. Fix various
`-Wincompatible-pointer-types`, `-Wpointer-sign` and `-Wint-conversion`
warnings.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-06-23 15:56:07 +01:00
Philip Withnall
d198edf9cd Merge branch 'leaks' into 'main'
gobject/tests/performance: fix leaks

See merge request GNOME/glib!2772
2022-06-23 13:47:33 +00:00
Philip Withnall
e5ccbe09da Merge branch 'atomic-exchange-pre-value' into 'main'
gatomic: Add Compare and Exchange functions that returns the previous value

See merge request GNOME/glib!2766
2022-06-23 13:19:05 +00:00
Marc-André Lureau
a5d551e2be gobject/tests/performance: fix leaks
Easily spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-06-23 17:18:21 +04:00
Philip Withnall
5655af6ada Merge branch 'more-async-gfile' into 'main'
gfile (and GAppInfo): Add some missing async APIs and ensure async calls always use them

See merge request GNOME/glib!2717
2022-06-23 11:49:55 +00:00
Philip Withnall
6529be2950 Merge branch 'ericLemanissier-main-patch-01384' into 'main'
use gvdb as a subproject

See merge request GNOME/glib!2771
2022-06-23 10:00:34 +00:00
Philip Withnall
ea7be5b249 Merge branch 'wip/smcv/atomic-pointer-exchange-docs' into 'main'
Correct documentation of g_atomic_pointer_exchange

See merge request GNOME/glib!2770
2022-06-23 09:58:23 +00:00
Simon McVittie
879b9cd669 gregex: Add G_REGEX_DEFAULT, G_REGEX_MATCH_DEFAULT
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-23 10:47:39 +01:00
Simon McVittie
0d4e401ede gmarkup: Add G_MARKUP_PARSE_FLAGS_NONE
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-23 10:47:27 +01:00
Simon McVittie
cef780e9ef giochannel: Add G_IO_FLAG_NONE
This makes the state where no flags are set a bit more self-documenting.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-23 10:47:22 +01:00