Commit Graph

27048 Commits

Author SHA1 Message Date
Philip Withnall
045bc7adde gtestutils: Clarify docs about calling g_test_init() before anything
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2943
2023-03-17 11:03:09 +00:00
Marco Trevisan
7fec23ed5e Merge branch 'desktop-app-info-startup-id' into 'main'
gdesktopappinfo: Add a missing NULL check

See merge request GNOME/glib!3325
2023-03-15 14:03:58 +00:00
Philip Withnall
1a9be3a1c8 tests: Add a test for D-Bus activating an unknown app with a context
This should catch regressions in the critical warning fixed in the
previous commit.

The launch has to have several conditions:
 - Session bus is running (to avoid the launch happening via the spawn
   codepath)
 - Use a non-existent D-Bus name (to trigger a launch error)
 - Use a launch context (to hit the critical warning code path)
 - Not have a startup ID specified in the platform data — this implies
   having an empty launch context
 - Use an async launch, as that provides an error handling path

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-15 13:50:51 +00:00
Philip Withnall
7cd57b3e85 gdesktopappinfo: Add a missing NULL check
It’s possible for the startup ID to be `NULL` if one wasn’t provided in
the platform data passed to `launch_uris_with_dbus()`.

Passing `NULL` to `g_app_launch_context_launch_failed()` causes a
critical warning.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-14 14:37:14 +00:00
Philip Withnall
8fbb8dc442 Merge branch 'test-failures' into 'main'
tests: Fix timeout sources in gdbus-auth and gapplication tests

See merge request GNOME/glib!3323
2023-03-14 10:26:27 +00:00
Philip Withnall
764f8426d4 tests: Remove explicit timeout handler from gdbus-auth tests
The timeout runs for the entire duration of the test, which is a
function that Meson’s test harness already provides for us.

Meson’s timeout can be easily adjusted by a factor to allow for running
tests more slowly under valgrind. The timeout in the code cannot, which
leads to spurious failures like
https://gitlab.gnome.org/GNOME/glib/-/jobs/2645271.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-13 11:21:17 +00:00
Philip Withnall
642ee744b8 tests: Fix g_source_remove() of non-existent source in gapplication test
If the timeout callback was executed, it would remove the timeout
source, leaving the `g_source_remove()` call in the main function with a
dangling source ID.

Fixes commit 73205b8bbd.

Spotted in https://gitlab.gnome.org/GNOME/glib/-/jobs/2645271.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-13 11:19:56 +00:00
Marco Trevisan
dc59380561 Merge branch 'bookmarkfile-timings' into 'main'
tests: Change the time function used in the bookmark tests

See merge request GNOME/glib!3315
2023-03-13 11:00:13 +00:00
Philip Withnall
b65b9255bb Merge branch 'rtld-next-cygwin' into 'main'
tests: only build messages-low-memory if RTLD_NEXT is available

See merge request GNOME/glib!3321
2023-03-13 10:48:13 +00:00
Christoph Reiter
94fd305dbd tests: only build messages-low-memory if RTLD_NEXT is available
This fixes the build under cygwin which doesn't have RTLD_NEXT.
Use the existing have_rtld_next to skip the test program in that case.
2023-03-12 12:29:03 +01:00
Sabri Ünal
ed256d6447 Update Turkish translation 2023-03-10 18:39:48 +00:00
Guillaume Bernard
d05417e3f1 Update French translation 2023-03-10 17:17:40 +00:00
Philip Withnall
618c340726 Merge branch 'fix-issue-2922' into 'main'
GWin32AppInfo: Add NULL string checks

Closes #2922

See merge request GNOME/glib!3317
2023-03-10 16:05:03 +00:00
Philip Withnall
cb7089d461 Merge branch 'wip/abono/always-inline-fallback' into 'main'
gmacros: Add GCC < 5 fallback for __always_inline__

See merge request GNOME/glib!3318
2023-03-10 15:33:11 +00:00
Philip Withnall
66492ec02e Merge branch 'dab_disable_fuzzing_tests' into 'main'
fuzzing: do not build tests if build_tests is false

See merge request GNOME/glib!3319
2023-03-10 15:32:45 +00:00
Philip Withnall
8a9ada6639
2.76.0
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-10 14:33:15 +00:00
Stéphane Cerveau
52b9af5fd9 fuzzing: do not build tests if build_tests is false 2023-03-10 12:11:11 +01:00
Alessandro Bono
13b564d027 gmacros: Add GCC < 5 fallback for __always_inline__
Commit 15cd0f0461 introduced a check
for the __always_inline__ attribute. However, we don't define a
fallback for GCC < 5.
2023-03-09 14:33:43 +01:00
Alessandro Bono
3bbd728868 gmacros: Sort alphabetically 2023-03-09 14:30:38 +01:00
Luca Bacci
061da06118 GWin32AppInfo: Add NULL string checks
Fixes #2922
2023-03-09 14:29:38 +01:00
Jordi Mas i Hernandez
d9a01931c3 Update Catalan translation 2023-03-07 20:57:29 +00:00
Ondrej Holy
1e4a8d3271 Merge branch '2934-false-null-file-attributes' into 'main'
glocalfile: Set various file attributes if their value is FALSE

Closes #2934

See merge request GNOME/glib!3313
2023-03-07 15:33:59 +00:00
Philip Withnall
e35f4a04cc tests: Change the time function used in the bookmark tests
The current comparison has been seen to fail on vs2017-x86
(https://gitlab.gnome.org/pwithnall/glib/-/jobs/2643197):
```
not ok /bookmarks/deprecated - GLib:ERROR:../glib/tests/bookmarkfile.c:921:test_deprecated: assertion failed (t >= now): (1678122080 >= 1678122081)
```

I guess this is caused by a mismatch between the system clock as used by
`time (NULL)` and `g_get_real_time ()` (which is ultimately what
`g_bookmark_file_set_added()` uses) on Windows.

Attempt to fix that by using `g_get_real_time()` in the test harness
too, so the clock being used is consistent.

If that doesn’t work, my next guess is that some of the code in
`test_deprecated()` is being reordered by the compiler. But that
shouldn’t happen, because the `time()` call has side-effects, and
`g_bookmark_file_set_added()` has side-effects, so they shouldn’t be
reordered with respect to each other. And certainly not so that the
latter one (in code order) ends up being called 1s after the other.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-06 18:25:42 +00:00
Philip Withnall
ff2fad77ef Merge branch 'wip/oholy/lost-and-found-is-hidden' into 'main'
glocalfileinfo: Mark the lost+found dir as hidden again

See merge request GNOME/glib!3310
2023-03-06 17:47:46 +00:00
Philip Withnall
ab3076a242 Merge branch '2932-check-etag-attributes' into 'main'
gfile: Check ETag attribute is present before trying to get it

Closes #2932

See merge request GNOME/glib!3312
2023-03-06 17:42:01 +00:00
Philip Withnall
335d3a4c04 Merge branch 'wip/oholy/is-backup-false' into 'main'
glocalfileinfo: Ensure that is-backup is always set

See merge request GNOME/glib!3311
2023-03-06 17:41:35 +00:00
Philip Withnall
7187243b8e Merge branch 'wip/oholy/btrfs-copy-fix' into 'main'
gfile: Fix file size detection when copying on btrfs

See merge request GNOME/glib!3309
2023-03-06 17:40:45 +00:00
Sabri Ünal
48a68890e0 Update Turkish translation 2023-03-06 16:37:24 +00:00
Philip Withnall
303d79989c gresourcefile: Fix a missing newline in GResourceFile
This introduces no functional changes.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-06 16:10:50 +00:00
Philip Withnall
a4e597520a glocalfileinfo: Set is-backup attribute on Windows
Previously it was only being set on non-Windows platforms. For
consistency, always set it on Windows too.

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

Helps: #2934
2023-03-06 16:10:50 +00:00
Philip Withnall
8c473c5353 glocalfile: Set various file attributes if their value is FALSE
Following on from #2907, set various boolean attributes if they have
been requested, or are known for sure, and their value is `FALSE`.

Previously the `FALSE` value would have been implicitly returned by the
getter function, but now doing that without the attribute being
explicitly set will trigger a critical warning.

*Don’t* set these attributes if their value is unknown or there was an
error querying it.

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

Fixes: #2934
2023-03-06 16:10:50 +00:00
Ondrej Holy
c965bf23a8 glocalfileinfo: Set is-backup attribute also on Windows
The `is-backup` attribute isn't currently set on Windows. It would
be nice to set such basic attributes on all platforms. Let's set
the attribute to `FALSE` there.
2023-03-06 14:33:39 +01:00
Ondrej Holy
448a163bee glocalfileinfo: Ensure that is-backup is always set
Currently, the `G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP` attribute is set
only when its value is `TRUE`. This is wrong with the latest changes as
the `GLib-GIO-CRITICAL **: 00:54:07.260: GFileInfo created without
standard::is-backup` errors are printed now from the
`g_file_info_get_is_backup` function among others. Let's set this
aattribute also when it is `FALSE`.

Related: https://gitlab.gnome.org/GNOME/glib/-/issues/2934
2023-03-06 14:33:39 +01:00
Ondrej Holy
43066d6960 glocalfileinfo: Mark the lost+found dir as hidden again
The lost+found dir isn't detected as hidden currently. This is regression
caused by the commit 728ad64b. Let's change the code a bit to be sure that
the lost+found dir is marked as hidden again.
2023-03-06 14:10:13 +01:00
Philip Withnall
4e62e55d6d gfile: Check ETag attribute is present before trying to get it
A regression from issue #2907.

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

Fixes: #2932
2023-03-06 13:02:41 +00:00
Ondrej Holy
406143b072 gfile: Fix file size detection when copying on btrfs
When the `g_file_copy` function is used with files on BTRFS, the
`GLib-GIO-FATAL-CRITICAL: GFileInfo created without standard::size`
error is printed. This is because the `g_file_get_size` function
is used to obtain the file size for the progress callback, but it uses
the wrong `GFileInfo` object that is meant for attributes to be copied
with the file. The file size attribute is missing there obviously. Let's
obtain the file size over the `fstat` call the same way as it is done in
the `splice_stream_with_progress` function to get rid of those errors
and to fix the progress reporting.
2023-03-06 10:30:20 +01:00
Marek Černocký
e75ba524fd Update Czech translation 2023-03-05 22:10:44 +00:00
Piotr Drąg
2dad35ff83 Update Polish translation 2023-03-05 16:52:04 +00:00
Alexander Shopov
58a3243f03 Update Bulgarian translation 2023-03-04 17:40:33 +00:00
Aleksandr Melman
73438a5dc5 Update Russian translation 2023-03-04 14:46:22 +00:00
Tim Sabsch
e1c364ca28 Update German translation 2023-03-03 18:39:42 +00:00
Changwoo Ryu
d2c1b03309 Update Korean translation 2023-03-03 15:39:53 +00:00
Philip Withnall
084a35620c
2.75.4
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-03-03 11:15:47 +00:00
Anders Jonsson
57b0cc1fd7 Update Swedish translation 2023-03-02 22:02:16 +00:00
Philip Withnall
0df2c607a6 Merge branch 'skip-test-under-sandbox' into 'main'
tests: Skip assert-msg-test.py if gdb fails

See merge request GNOME/glib!3304
2023-03-02 17:52:33 +00:00
Emmanuele Bassi
48e62795f6 Merge branch 'g_strerror_error_leak' into 'main'
Fix a memory leak in g_strerror

See merge request GNOME/glib!3305
2023-03-02 16:37:37 +00:00
Dan Carpenter
774d8bd914 Fix a memory leak in g_strerror
If g_locale_to_utf8 sets a GError, it must be freed.
2023-03-02 15:46:00 +01:00
Matt Turner
19a8df9d8b tests: Skip assert-msg-test.py if gdb fails
Similar to commit 6e44151bf7, skip the test if gdb is unable to read
/proc/PID/mem, which gdb does as a fallback if ptrace is unavailable.

This allows the test to skip when run under Gentoo's sandbox.
2023-03-02 09:36:10 -05:00
Simon McVittie
6c22a5ee2b Merge branch '2925-gdbus-threading-test' into 'main'
gdbusconnection: Explicitly destroy an idle source on cleanup

See merge request GNOME/glib!3296
2023-03-02 12:35:21 +00:00
Balázs Úr
e429113878 Update Hungarian translation 2023-03-02 01:39:18 +00:00