Commit Graph

25001 Commits

Author SHA1 Message Date
Philip Withnall
9499aeb8bf tests: Wait for signal unsubscriptions in gdbus-test-codegen
When destroying `GDBusProxy`s in a custom `GMainContext`, the context
must be iterated enough after finalisation of the proxies that any
pending D-Bus traffic, and the signal subscription data, can be freed.

See the documentation for `g_dbus_connection_signal_unsubscribe()`.

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

Fixes: #2312
2022-03-09 14:21:20 +00:00
Philip Withnall
d6ad10404f tests: Add some tests for g_string_append_vprintf()
This adds coverage of one previously uncovered branch in `gstring.c`.
Real progress!

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-09 14:09:57 +00:00
Philip Withnall
27e1509cd6 tests: Add some tests for g_vasprintf() invalid format strings
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-09 14:08:49 +00:00
Philip Withnall
7329c6e09b gprintf: Fix a memory leak with an invalid format in g_vasprintf()
If using the fallback implementation of `g_vasprintf()`.

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

Coverity CID: #1474726
2022-03-09 14:07:34 +00:00
Fabio Tomat
09a5ce5776 Update Friulian translation 2022-03-09 09:47:28 +00:00
Marc-André Lureau
b0c53559c0 tests: skip check anything is octet-stream
Like on Mac, the contenttype database can't say that much yet.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
7fa4999457 tests: skip test_tree on win32
Currently it simply crashes, because types == NULL.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
5f1bae1594 gio/tests: fix test_icon on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
452d64a03b tests: use Windows mime type for executable
According to https://stackoverflow.com/a/43916291/1277510

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
b60b0ec72d gio: relax g_content_type_is_a on win32
This is quite gross, but it looks like the whole content-type code on
Windows is similar. Pass test_subtype.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
ab0c00bd7e gio/tests: fix various content type guesses on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
529e091bb5 gio/tests: fix content type guess for directory on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
9d852bc6f3 gio: implement simple directory type detection
Use a logic similar to what is done for Unix, based on trailing path
separator.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
b3379557af gio: return '*' content type on win32 from unknown mime
This fixes test_unknown.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:20 +04:00
Philip Withnall
0239ae7122 tests: Fix a leak in gdbus-test-codegen test
The `ay` property has type `string` (see the generated code) since it’s
not been annotated to force accepting a `GVariant`.

This means the GObject property machinery expects a string, and calls
`g_strdup()` on the passed-in pointer, rather than sinking the
`GVariant`.

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

Helps: #2312
2022-03-08 20:08:43 +00:00
Philip Withnall
20b6bda9a2 ci: Update the Fedora CI image to Fedora 34
This is the oldest still-supported version of Fedora.

It no longer ships gamin.

This should fix the installed-tests, which rely on version 0.19 of
python-dbusmock. Fedora 33 only had 0.18.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-08 13:07:57 +00:00
Philip Withnall
b1315988fc fuzzing: Fix test failure with G_DISABLE_ASSERT
https://gitlab.gnome.org/GNOME/glib/-/jobs/1875915
```
../fuzzing/fuzz_paths.c: In function ‘LLVMFuzzerTestOneInput’:
../fuzzing/fuzz_paths.c:7:16: error: variable ‘skipped_root’ set but not used [-Werror=unused-but-set-variable]
    7 |   const gchar *skipped_root;
      |                ^~~~~~~~~~~~
cc1: all warnings being treated as errors
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-08 11:52:30 +00:00
Eli Schwartz
4a4d9eb662
meson: simplify lookup of python command
It can be treated like any other command, we don't need a full blown
module capable of building extensions just to get an ExternalProgram
executable that can be used to run scripts.

Since find_program has a builtin kwarg for requiring a given version, we
can avoid manually coding some checks and emitting a custom error.
2022-03-07 22:05:51 -05:00
Yosef Or Boczko
b3a568d19e Update Hebrew translation 2022-03-07 18:48:25 +00:00
Emmanuele Bassi
618d6873fd Merge branch 'wip/pwithnall/ci-fixes' into 'main'
Various unit test fixes

See merge request GNOME/glib!2538
2022-03-07 09:24:10 +00:00
Piotr Drąg
4ebf316835 Update Polish translation 2022-03-06 14:44:54 +00:00
Luna Jernberg
791c0be71a Update Swedish translation 2022-03-06 12:47:06 +00:00
Daniel Șerbănescu
ffb33887b5 Update Romanian translation 2022-03-06 11:47:59 +00:00
Philip Withnall
918fcd7928 2.71.3
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-04 21:03:41 +00:00
Philip Withnall
f0baa136f9 Merge branch 'canon-fix' into 'main'
glib: fix buffer overflow in g_canonicalize_filename()

See merge request GNOME/glib!2451
2022-03-04 20:16:29 +00:00
Marc-André Lureau
56e87ae1b5 glib: fix buffer overflow in g_canonicalize_filename()
The output pointer must not go past the ending \0.

warning: HEAP[testglib.exe]:
warning: Heap block at 0000011EA35745A0 modified at 0000011EA35745BF past requested size of f

Fixes commit 9a30a495ec "gfileutils: Improve performance of g_canonicalize_filename()"

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-04 20:16:29 +00:00
Philip Withnall
4d237daf32 tests: Add more debug output to gdbus-threading test
It periodically hangs due to the `GDBusConnection` having more than 1
ref (and never losing them), so there’s potentially a leaking ref
somewhere:
```
(/builds/alexander.klauer/glib/_build/gio/tests/gdbus-threading:17767): GLib-GIO-DEBUG: 13:18:12.268: refcount of 0x55fe85b1a260 is not right, sleeping
\# GLib-GIO-DEBUG: refcount of 0x55fe85b1a260 is not right, sleeping
```

Add some more debug output to try and track the problem down.

See: https://gitlab.gnome.org/alexander.klauer/glib/-/jobs/1865968

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-04 19:53:04 +00:00
Philip Withnall
54ee8e5414 tests: Add more debug output to converter-stream test
It’s periodically failing on FreeBSD and I can’t reproduce the failure
locally nor work out what it is from the logs:
```
Bail out! GLib-GIO:ERROR:../gio/tests/converter-stream.c:1041:test_converter_pollable: assertion failed (res != -1): (-1 != -1)
stderr:
**
GLib-GIO:ERROR:../gio/tests/converter-stream.c:1041:test_converter_pollable: assertion failed (res != -1): (-1 != -1)
```

Add some more debug output to get the value of `error`, in the hope that
will provide some insight.

See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1866486

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-04 19:51:17 +00:00
Emmanuele Bassi
cbca44ca32 Merge branch '2598-main-loop-unref' into 'main'
gmain: Fix reference leak of GMainLoop in some situations

Closes #2598

See merge request GNOME/glib!2535
2022-03-04 19:22:22 +00:00
Philip Withnall
80d3018c1d tests: Make the 642026 test take 100× less time
It’s a tradeoff of time against reproducibility of the failure conditions
this test is testing for. If this test is run 100× on CI (which it will
be every few weeks), that should be often enough to catch a regression
here.

A regression in this code is unlikely, though.

This change is motivated by the fact that periodically this test times
out, and even when it doesn’t, it takes on average 240s of CI runner
time during each CI run. That’s a lot of resources.

See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1862013

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-04 19:21:40 +00:00
Emmanuele Bassi
0c4c8d1005 Merge branch '2611-revert-option-changes' into 'main'
Revert "gapplication: Expose zero-valued numbers in handle-local-options"

Closes #2611

See merge request GNOME/glib!2536
2022-03-04 19:21:21 +00:00
Philip Withnall
141d3f68d3 tests: Mark network-address test as expected to succeed on macOS
Commit 13c4b9579b seems to have fixed
`network-address` so that it’s reliable everywhere, including on macOS.

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

Helps: #1392
2022-03-04 19:07:02 +00:00
Philip Withnall
9469922d5c tests: Allow g_mkdir_with_parents() to fail with EPERM
As well as with `EACCES`. This can happen if the filesystem as a whole
is read-only, and has been spotted in the wild on macOS:
```
Bail out! GLib:ERROR:../glib/tests/fileutils.c:756:test_mkdir_with_parents: assertion failed (errno == EACCES): (1 == 13)
stderr:
**
GLib:ERROR:../glib/tests/fileutils.c:756:test_mkdir_with_parents: assertion failed (errno == EACCES): (1 == 13)
```

See: https://stackoverflow.com/q/68766316/2931197
See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1866500

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-04 18:59:22 +00:00
Philip Withnall
d497bdebc0 Merge branch 'remove_type-test' into 'main'
Move tests/type-test.c to glib/tests/types.c

See merge request GNOME/glib!2527
2022-03-04 18:39:40 +00:00
Philip Withnall
23e935a342 Revert "gapplication: Expose zero-valued numbers in handle-local-options"
This reverts commit 1ed67a9c44.

It turns out that including options, with their default values, in the
`handle-local-options` signal, which weren’t set on the command line,
breaks some applications.

In particular, it breaks Inkscape, which is the application this commit
was originally meant to fix (a different problem).

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

Fixes: #2611
Breaks: #2329
See: !1953
2022-03-04 18:16:12 +00:00
Philip Withnall
4f5da83381 gmain: Fix reference leak of GMainLoop in some situations
When calling `g_main_loop_run()` it’s possible for a reference to the
`GMainLoop` to leak if this thread had to wait to acquire ownership of
the `GMainContext`.

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

Fixes: #2598
2022-03-04 17:37:09 +00:00
Emmanuel Fleury
208dfe9ddc Move tests/type-test.c to glib/tests/types.c
Helps issue #1434
2022-03-04 16:24:20 +00:00
Emmanuel Fleury
9933e2b54c Convert tests/type-test.c to g_test framework 2022-03-04 16:24:20 +00:00
Philip Withnall
3bef2760e9 Merge branch 'docs' into 'main'
docs: mark macros, flags, enums with percent sign

Closes #2589

See merge request GNOME/glib!2470
2022-03-04 16:21:55 +00:00
Gabor Karsay
7e64004db0 docs: mark macros, flags, enums with percent sign 2022-03-04 16:21:55 +00:00
Philip Withnall
f08324e014 Merge branch 'w32-tests-spawn' into 'main'
Various spawn-related test fixes on win32

See merge request GNOME/glib!2485
2022-03-04 16:16:39 +00:00
Philip Withnall
887f73d34e Merge branch 'issue-2612' into 'main'
Do not use ensure_valid_* call in g_return_* macro

Closes #2612

See merge request GNOME/glib!2532
2022-03-04 14:04:02 +00:00
Alexander Klauer
340bc1ca79 Do not use ensure_valid_* call in g_return_* macro
Replace all instances of ensure_valid_builder or ensure_valid_dict
calls used as arguments to the g_return_if_fail or
g_return_value_if_fail macros with otherwise equivalent code that
always calls these functions, thus ensuring their side effects always
apply. This commit does not change any external or private interfaces.

Fixes #2612
2022-03-04 14:04:02 +00:00
Philip Withnall
674dc5171c gpowerprofilemonitor: Tweak wording of documentation to make more sense
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-04 12:18:34 +00:00
Philip Withnall
feb8ea45b9 Merge branch 'issue-2613' into 'main'
Explain magic literals in G_VARIANT_*_INIT

Closes #2613

See merge request GNOME/glib!2533
2022-03-04 11:29:58 +00:00
Alexander Klauer
bc2ca9df20 Explain magic literals in G_VARIANT_*_INIT 2022-03-04 11:29:58 +00:00
Tim Sabsch
b109c2a210 Update German translation 2022-03-03 15:14:53 +00:00
Sebastian Dröge
420238e0c4 Merge branch 'debug-controller-unused' into 'main'
gdebugcontrollerdbus: Mark a variable as G_GNUC_UNUSED

See merge request GNOME/glib!2519
2022-03-03 14:54:28 +00:00
Sebastian Dröge
c3735c1bc6 Merge branch '517-collation-docs' into 'main'
gunicollate: Document that g_utf8_collate() can’t compare everything

Closes #517

See merge request GNOME/glib!2443
2022-03-03 14:53:58 +00:00
Sebastian Dröge
8091727b27 Merge branch 'wip/pwithnall/macos-tests' into 'main'
tests: Stop ignoring test failures on macOS

See merge request GNOME/glib!2505
2022-03-03 14:53:38 +00:00