Commit Graph

30150 Commits

Author SHA1 Message Date
velsinki
dc7331f4fb gstrfuncs: Add missing (optional) annotation to g_str_tokenize_and_fold() 2024-01-25 11:33:09 +00:00
velsinki
2d5955c4f3 gstrfuncs: Add missing (array) annotation to g_strv_length() 2024-01-25 11:32:56 +00:00
velsinki
b869908f16 gstrfuncs: Add missing (array) annotations to g_strdupv() and g_strjoinv() 2024-01-25 11:29:52 +00:00
velsinki
8689a1f8b7 gstrfuncs: Add missing (nullable) annotations to g_strndup() 2024-01-25 11:25:09 +00:00
velsinki
2d5f608454 gstrfuncs: Add missing (transfer) and (nullable) annotations to g_memdup() 2024-01-25 11:22:54 +00:00
velsinki
16ea531ecb gstrfuncs: Add missing (array) annotation to g_strfreev() 2024-01-25 11:20:00 +00:00
velsinki
8d2d12bd52 gprintf: Port doc comments to gi-docgen
Fixes broken links, and removes `%` and `#` notation in favor of inline
code, and limits indentation to two to prevent accidental formatting.

Fixes some style issues too, mainly removing periods at the end of
parameter and return descriptions.

Also removes trailing whitespace from the doc comments.

Helps: #3037
2024-01-25 11:19:23 +00:00
velsinki
2b22befc4f gprintf: Add missing (out) annotation to g_vasprintf() 2024-01-25 11:19:23 +00:00
Philip Withnall
c92c1502d2 Merge branch 'remove-deprecated-girepository-flags' into 'main'
girepository: Remove GI_FUNCTION_THROWS and GI_VFUNC_THROWS flags

See merge request GNOME/glib!3849
2024-01-25 11:02:28 +00:00
Philip Chimento
ad9cd1762a girepository: Remove GI_FUNCTION_THROWS and GI_VFUNC_THROWS flags
These flags were replaced by gi_callable_info_can_throw_error() in
girepository 1.x, but the flags were maintained for backwards
compatibility. No need to hold on to them in the 2.x API.

Note that these flags are also still maintained as separate bits in the
binary format, which is not changing. So, they still need to be read
from FunctionBlob and VFuncBlob if the bit is not set in SignatureBlob.

This is an API break for girepository 2.x, which is OK because the API
has never been released yet.
2024-01-24 20:45:28 -08:00
Marco Trevisan
856850ab15 Merge branch 'fix-introspection-build-windows' into 'main'
Fix build with introspection on Windows

See merge request GNOME/glib!3848
2024-01-24 18:20:04 +00:00
Luca Bacci
f7c4825d91 Fix build with introspection on Windows 2024-01-24 18:16:58 +01:00
Philip Withnall
b3abf56ced Merge branch 'girepository-tests' into 'main'
Add more test coverage for girepository

See merge request GNOME/glib!3843
2024-01-24 08:41:23 +00:00
Philip Chimento
cda9ebeb03 tests: Port over some GIRepository tests from g-i 1.x
These tests come from gobject-introspection/tests/repository/. They
include whatever wasn't already covered by the existing tests.

The original files didn't have copyright information. That's been
reconstructed from commit messages of commits that added a test or a
substantial part of one.
2024-01-23 22:04:52 -08:00
Philip Chimento
3c984faf23 tests: Use runtime casts
Using casts like GI_OBJECT_INFO() that log a critical when the
introspection info is of the wrong type, will help to locate bugs.
2024-01-23 22:04:52 -08:00
Philip Chimento
b8a65edb01 tests: Use fixture in GIRepository tests
This deduplicates some code and will allow writing further tests more
easily.
2024-01-23 22:04:52 -08:00
Philip Chimento
d41f05e9cf build: Add libffi dependency to girepository/function-info test
I found that this dependency is needed for girffi.h to find ffi.h.
2024-01-23 21:59:38 -08:00
Philip Chimento
28835733a2 tests: Fix defaultvalue test on macOS
Without these includes, the g_osx_app_info_get_type() in
giotypefuncs.inc is missing a declaration.
2024-01-23 21:35:54 -08:00
Philip Withnall
01e197868d Merge branch '3218-girepository-stack-allocations' into 'main'
gibaseinfo: Fix use of stack-allocated GIBaseInfos

Closes #3218

See merge request GNOME/glib!3846
2024-01-23 23:08:41 +00:00
Philip Withnall
9b5d008f60 girffi: Rename gi_function_invoker_destroy() to …_clear()
This brings its naming more in line with modern GLib conventions.

This is an API break, but libgirepository is not API frozen yet.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-23 22:55:35 +00:00
Philip Withnall
3e157c688e girffi: Add a test for gi_function_info_prep_invoker()
This test case was originally written by Philip Chimento as a reproducer
for #3218. Let’s add it to the test suite to catch regressions in
stack-allocated `GIBaseInfo` handling.

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

Helps: #3218
2024-01-23 18:10:03 +00:00
Philip Withnall
998baf9afb girffi: Expand docs for gi_function_info_prep_invoker()
Mention that the returned `GIFunctionInvoker` needs to be cleared.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-23 18:09:28 +00:00
Philip Withnall
bf4cf2d464 gibaseinfo: Fix use of stack-allocated GIBaseInfos
Most of the code for handling stack-allocated infos was correct, it was
just missing code to initialise the `GTypeInstance` member.

Since `GTypeInstance` isn’t really designed for stack allocation, this
is a little hacky — it requires setting up the member within
`GTypeInstance` manually. It works, though.

The externally visible consequence of this, though, is that
stack-allocated `GIBaseInfo`s now need to be cleared when they’re
finished being used. This allows the `GTypeClass` ref to be dropped.

All users of the stack-allocated APIs in libgirepository will need to
adapt to this change.

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

Fixes: #3218
2024-01-23 18:07:17 +00:00
Philip Withnall
eb94acce21 gibaseinfo: Make gi_info_init() take a GType rather than a GIInfoType
This is one more step towards removing `GIInfoType`, and will also help
in a following commit which will directly make use of the `GType`.

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

Helps: #3218
2024-01-23 18:06:08 +00:00
Philip Withnall
c8c1febc7d gibaseinfo: Fix a double-unref with stack-allocated GIBaseInfos
As documented in the commit, the internal members of `GIBaseInfo` are
not reffed if the `GIBaseInfo` is stack-allocated, as the caller can be
relied on to ensure their lifetime exceeds that of the `GIBaseInfo`.

Make sure that’s actually reflected in the code.

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

Helps: #3218
2024-01-23 17:55:26 +00:00
Philip Withnall
a3da3a032c gibaseinfo: Change argument type for gi_type_info_init()
Make it take a `GITypeInfo` rather than a `GIBaseInfo`, because that’s
what it actually operates on.

This is an internal API, so this isn’t an API break.

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

Helps: #3218
2024-01-23 17:53:15 +00:00
Philip Withnall
fee9223e74 Merge branch '2887-memory-monitor-tests' into 'main'
tests: Fix race condition in memory-monitor-dbus.test

Closes #2887

See merge request GNOME/glib!3844
2024-01-23 11:16:52 +00:00
Philip Withnall
67a9fbf1fa tests: Wait for memory monitor to be able to handle signals before testing
This fixes a race condition which frequently caused the
`memory-monitor-dbus.py` test to fail.

The registration of the `LowMemoryMonitor` object on the bus, and the
`GMemoryMonitorDBus`’s connection to the warning signal raced, such that
it was possible for the mock `LowMemoryMonitor` to emit a warning signal
before the `GMemoryMonitorDBus` proxy was listening, and hence the proxy
would never see the signal.

Fix this by explicitly synchronising the two before proceeding to the
tests.

Make the same changes in the `memory-monitor-portal.py` test too, even
though that one was not failing. This should remove the need for a 2s
wait on every test run.

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

Fixes: #2887
2024-01-23 11:02:48 +00:00
Philip Withnall
e0276a3a17 tests: Wait for LMM server to be available when starting test
Otherwise the test can go on to wait for a signal from the service
before it’s actually finished starting up.

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

Helps: #2887
2024-01-23 11:02:48 +00:00
Philip Withnall
1f2d9e69c9 tests: Assert correct monitor implementation is used in power-profile-monitor-dbus
This wasn’t failing, but it seems like a sensible thing to check.

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

Helps: #2887
2024-01-23 11:02:48 +00:00
Philip Withnall
6b22aaaa68 tests: Assert correct monitor implementation is used in memory-monitor-dbus
This wasn’t failing, but it seems like a sensible thing to check.

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

Helps: #2887
2024-01-23 11:02:48 +00:00
Philip Withnall
e3b81b3f0d tests: Rework assertEventually() to use GLib main context
Rather than sleeping and blocking everything, use a timeout source on
the main context so that inputs can continue to be handled while waiting
for a timeout.

This introduces no functional changes to the test.

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

Helps: #2887
2024-01-23 11:02:48 +00:00
Philip Withnall
b8fba4ddb4 Merge branch 'freebsd-iconv' into 'main'
gconvert: match GNU iconv behaviour on FreeBSD

See merge request GNOME/glib!3824
2024-01-22 18:40:03 +00:00
Ting-Wei Lan
ec780d0d4a Use the FreeBSD cgit URL 2024-01-22 15:39:33 +00:00
Philip Withnall
143cb92c35
2.79.1
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-22 14:30:24 +00:00
Philip Withnall
8a4ad5f998 tests: Add some debug output to memory-monitor-dbus.py test
This will hopefully help diagnose #2887.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #2887
2024-01-22 11:22:45 +00:00
Philip Withnall
5278efbd63 tests: Ensure Python assertEventually() function uses correct main context
It should be doing already (or the tests would never work), but make it
clearer in the code that the same `GMainContext` is being iterated as is
being woken up in the rest of the test.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #2887
2024-01-22 11:22:01 +00:00
Emmanuele Bassi
74a584e25a Merge branch 'fix-dist-docs' into 'main'
ci: Fix tarballing the docs on dist

See merge request GNOME/glib!3803
2024-01-22 10:45:15 +00:00
Philip Withnall
aee343fe5c Merge branch 'auto-lock' into 'main'
Add G_*_AUTO_LOCK macros

Closes #3223

See merge request GNOME/glib!3822
2024-01-21 21:02:35 +00:00
Philip Withnall
ca0e7c376a Merge branch 'compile-windows-resources-only-shared' into 'main'
gio, gmodule, gthread: compile windows resources only in shared build

See merge request GNOME/glib!3842
2024-01-21 20:42:15 +00:00
Hailey Somerville
c65e163240 gio, gmodule, gthread: compile windows resources only in shared build
When linking static libraries, multiple resources is an error unless
handled in a special way. glib and gobject do not have this problem,
as they already only include resources when building a shared lib.
2024-01-21 18:51:52 +11:00
Michael Catanzaro
75310f658d Merge branch 'alatiera/gmessage-docs' into 'main'
docs: Fix member names of GLib.LogLevelFlags

See merge request GNOME/glib!3841
2024-01-19 17:33:56 +00:00
Jordan Petridis
a011dd0048 docs: Fix member names of GLib.LogLevelFlags 2024-01-19 19:04:04 +02:00
Simon McVittie
62ee8bf693 Merge branch 'wip/smcv/clean-girepository-abi' into 'main'
girepository: Exclude private symbols from the ABI

See merge request GNOME/glib!3840
2024-01-19 12:22:45 +00:00
Emmanuele Bassi
3706ad526e Merge branch 'wip/smcv/typo' into 'main'
gvarianttype: Fix typos

See merge request GNOME/glib!3839
2024-01-19 12:15:43 +00:00
Simon McVittie
25ec19723c girepository: Exclude private symbols from the ABI
This removes the gthash utility functions from the ABI, so link those
into their automated test statically.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-19 12:07:30 +00:00
Simon McVittie
6da5e6a327 gvarianttype: Fix typos
Saying that a GtkWidget is a GtkWidget is trivially true, but not the
point we were trying to make here.

Fixes: b5c07063 "docs: Use code for class names in links"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-19 11:53:00 +00:00
Emmanuele Bassi
4ff4f073a4 Merge branch 'altiera/docs' into 'main'
docs: Fix links to symbols outside the allowed namsepace

See merge request GNOME/glib!3809
2024-01-18 18:35:21 +00:00
Philip Withnall
16b93f92fa ci: Run the thorough test setup on a weekly schedule
Merge it with the `G_DISABLE_ASSERT` test run, to avoid tying up another
test runner for no particular benefit.

By running the thorough tests regularly, we’ll hopefully avoid them
atrophying again (see the previous few commits full of fixes to them).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-18 17:45:00 +00:00
Philip Withnall
eb19551ebe build: Add thorough test setup
This allows the tests to be run with `meson test --setup thorough` and
it will run all the GTest tests with `-m thorough`.

Since this argument isn’t supported by the Python tests, it’s not passed
to them.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-18 17:22:09 +00:00