Commit Graph

24914 Commits

Author SHA1 Message Date
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
Sebastian Dröge
b1f57806a7 Merge branch 'task-set-name-docs' into 'main'
gtask: Document that task name is set by g_task_set_source_tag()

See merge request GNOME/glib!2531
2022-03-03 14:01:12 +00:00
Philip Withnall
c1293acb27 gtask: Document that task name is set by g_task_set_source_tag()
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-03 12:42:28 +00:00
Philip Withnall
16057f78e8 Merge branch 'mwleeds/log-set-enabled-docs-2' into 'main'
gmessages: Clarify g_log_set_debug_enabled() behavior

Closes #2609

See merge request GNOME/glib!2530
2022-03-03 09:31:42 +00:00
Phaedrus Leeds
3a22c26e5c gmessages: Clarify g_log_set_debug_enabled() behavior
Fixes #2609
2022-03-02 18:58:13 -08:00
Goran Vidović
4d66b93310 Update Croatian translation 2022-03-02 12:41:33 +00:00
Goran Vidović
a9e97cc14b Update Croatian translation 2022-03-02 11:30:59 +00:00
Goran Vidović
223b1f31c8 Update Croatian translation 2022-03-02 11:30:02 +00:00
Changwoo Ryu
f87c915eb1 Update Korean translation 2022-03-02 10:41:11 +00:00
Philip Withnall
46d1329f06 Merge branch 'meson-devenv-gdb' into 'main'
meson: Add PYTHONPATH to load GDB helper module

See merge request GNOME/glib!2528
2022-03-01 11:24:21 +00:00
Alan Mortensen
df7f9a9f85 Updated Danish translation 2022-02-28 18:46:30 +01:00
Asier Sarasua Garmendia
888ca6e36f Update Basque translation 2022-02-27 08:04:14 +00:00
Xavier Claessens
2bd152bfeb meson: Add PYTHONPATH to load GDB helper module
Meson generates a gdbinit file that will automatically load glib and
gobject scripts. However that script uses a helper python module that
needs PYTHONPATH to be pointing into the right location in the source
tree to be able to find glib_gdb.py and gobject_gdb.py
2022-02-25 16:50:18 -05:00
Daniel Mustieles
b3311e82ee Updated Spanish translation 2022-02-24 12:52:04 +01:00
Philip Withnall
54849f2622 Merge branch 'remove_testgdateparser' into 'main'
Remove unused test tests/testgdateparser.c

See merge request GNOME/glib!2526
2022-02-24 11:05:38 +00:00
Emmanuel Fleury
78f6507196 Remove unused test tests/testgdateparser.c
Helps issue #1434
2022-02-23 18:34:44 +01:00
Philip Withnall
8b14c1559d Merge branch 'meson-gio-var-take2' into 'main'
meson: Add schemasdir and giomoduledir to gio dependency

See merge request GNOME/glib!2525
2022-02-23 16:12:29 +00:00
Xavier Claessens
218ac195df meson: Add schemasdir and giomoduledir to gio dependency
This allows applications to get their value regardless whether glib is a
subproject or pkgconfig:

  gio_dep = dependency('gio-2.0')
  giomoduledir = gio_dep.get_variable('giomoduledir')
  schemasdir = gio_dep.get_variable('schemasdir')
2022-02-23 08:24:00 -05:00
Philip Withnall
dbd11f3d3b Merge branch 'wip/pwithnall/revert-2517' into 'main'
Revert "meson: Add schemasdir and giomoduledir to gio dependency"

See merge request GNOME/glib!2524
2022-02-23 12:17:29 +00:00
Philip Withnall
7f8c09cd07 Merge branch 'wip/pwithnall/network-address-test-fixes' into 'main'
tests: Remove threads from mock-resolver/network-address test

See merge request GNOME/glib!2520
2022-02-23 12:03:28 +00:00
Philip Withnall
590a2c9af8 Revert "meson: Add schemasdir and giomoduledir to gio dependency"
This reverts commit 5aa03882ca.

It fails to compile on newer Meson versions with
`--fatal-meson-warnings` due to:
```
WARNING: Project targeting '>= 0.52.0' but tried to use feature introduced in '0.54.0': variables arg in declare_dependency.
gio/meson.build:833:0: ERROR: Fatal warnings enabled, aborting
```

That happens regardless of the fact that we’ve correctly limited the use
of the `variables` argument to only when building with Meson ≥ 0.56.
Unfortunately Meson can’t statically detect that the argument is
conditional.

Bumping GLib’s Meson dependency is too much work right now, so this MR
unfortunately has to be reverted.
2022-02-23 11:51:13 +00:00
Sebastian Dröge
b615afc0fa Merge branch 'null_arg_handling' into 'main'
Add handling of NULL time_t* pointer as argument

See merge request GNOME/glib!2523
2022-02-23 07:49:08 +00:00
Emmanuel Fleury
0a6d815f95 Add handling of NULL time_t* pointer as argument 2022-02-22 23:34:09 +01:00
Marc-André Lureau
0f85eefb8b gio: fix OOB string access if filename is empty
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-22 23:55:57 +04:00
Marc-André Lureau
2583a66ee7 tests: skip spawn-path-search tests on win32
Manipulating PATH the way the test does, it breaks DLL lookups and fails
to run helper programs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-22 23:55:57 +04:00
Marc-André Lureau
68aff6dd07 glib/spawn-win32: workaround SEGV on spawnvpe
I haven't been able to write a reproducer yet and report the bug to
Microsoft, but this is 100% crashing when running "meson test
gsubprocess"

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-22 23:55:57 +04:00
Marc-André Lureau
2ebe30e170 tests: fix spawn-multithreaded on win32
Add test-spawn-sleep helper program to sleep on Windows (child-test
removed in commit 241b9f41b, probably breaking the test)

(fwiw, Windows has a timeout command nowadays, but it conflicts with
msys2 timeout which has different usage)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-22 23:55:55 +04:00
Marc-André Lureau
8bb73c2a74 tests: replace ipconfig call in spawn-multithread on win32
Use a silent command instead (tbh, I don't understand the need for this)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-22 23:54:55 +04:00
Marc-André Lureau
6e6d8000a4 tests: remove old libtool workarounds
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-22 23:54:55 +04:00
Philip Withnall
199261a419 Merge branch 'remove_testglib.c' into 'main'
Remove old test file tests/testglib.c

See merge request GNOME/glib!2424
2022-02-22 18:48:02 +00:00
Emmanuel Fleury
16f0438bc6 Remove old test file tests/testglib.c 2022-02-22 18:48:01 +00:00
Philip Withnall
68dc5d5fbc Merge branch 'meson-gio-var' into 'main'
meson: Add schemasdir and giomoduledir to gio dependency

See merge request GNOME/glib!2517
2022-02-22 18:22:52 +00:00
Philip Withnall
b400943767 Merge branch 'mwleeds/log-set-enabled-docs' into 'main'
gmessages: Fix typo in docs

See merge request GNOME/glib!2515
2022-02-22 14:32:47 +00:00
Xavier Claessens
5aa03882ca meson: Add schemasdir and giomoduledir to gio dependency
This allows applications to get their value regardless whether glib is a
subproject or pkgconfig:

  gio_dep = dependency('gio-2.0')
  giomoduledir = gio_dep.get_variable('giomoduledir')
  schemasdir = gio_dep.get_variable('schemasdir')
2022-02-22 08:54:07 -05:00
Philip Withnall
00faa84f77 Merge branch 'giomodule' into 'main'
meson: Set GIO_EXTRA_MODULES in devenv

See merge request GNOME/glib!2518
2022-02-22 13:38:58 +00:00
Philip Withnall
13c4b9579b tests: Remove threads from mock-resolver/network-address test
`mock-resolver.c` is a mock implementation of `GResolver` used in the
`network-address` tests. It returns resolver results, and implements
timeouts, as directed by the test calling it.

In particular, it allows the IPv4 and IPv6 resolver results to be
returned using independent delays. This allows code paths which deal
with IPv4 and IPv6 results being returned at different times to be
tested, as the ‘Happy Eyeballs’ spec mandates various hard-coded
timeouts for returning the best results it can in a reasonable
timeframe.

Previously, `mock-resolver.c` implemented the timeouts by handling
`lookup_by_name()` in a `GTask` worker thread, and calling `g_usleep()`
for the timeout. This seemed to cause occasional CI failures, such as
https://gitlab.gnome.org/GNOME/glib/-/jobs/1843454, where a resolver
error would be returned rather than the expected results:
```
ok 52 /network-address/happy-eyeballs/ipv4-error-ipv6-first
\# GLib-GIO-DEBUG: IPv4 DNS error: IPv4 Broken
(/var/tmp/gitlab_runner/builds/Ff4WDDRj/0/GNOME/glib/_build/gio/tests/network-address:18428): GLib-GIO-DEBUG: 09:03:08.587: IPv4 DNS error: IPv4 Broken
Bail out! GLib-GIO:ERROR:../gio/tests/network-address.c:586:got_addr: assertion failed (error == NULL): IPv4 Broken (g-io-error-quark, 24)
stderr:
**
GLib-GIO:ERROR:../gio/tests/network-address.c:586:got_addr: assertion failed (error == NULL): IPv4 Broken (g-io-error-quark, 24)
```

While I’ve been unable to reproduce these failures locally, I suspect
they might be down to thread spawning occasionally taking long enough on
a CI runner to change the ordering of the timeouts, such that the ‘Happy
Eyeballs’ algorithm returns a different set of results from what the
test expects.

So, this commit rewrites part of `mock-resolver.c` to implement timeouts
in the main thread, rather than in a worker thread. That should
eliminate the delays in spawning threads, and should mean that the
timeout sources in `mock-resolver.c` are attached to the same
`GMainContext` as those from the ‘Happy Eyeballs’ algorithm which are
monitoring them, so a total order over the timeouts can be guaranteed.

Of course, I might be completely wrong since this is just a guess and I
can’t properly test it since I can’t reproduce the failure. Worth a try.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 11:25:21 +00:00
Philip Withnall
bb2d79e6a8 tests: Use g_assert_*() rather than g_assert() in network-address.c
`g_assert()` is compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 11:25:21 +00:00
Philip Withnall
a57706887e tests: Fix memory leaks in network-address test
The test results weren’t being freed.

This makes the `network-address` test clean under memcheck for me.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-02-22 11:25:21 +00:00