Commit Graph

24091 Commits

Author SHA1 Message Date
Simon McVittie
a076dbcb68 gtestutils: Allow failing a test with a printf-style message
This allows a pattern like

    g_test_message ("cannot reticulate splines: %s", error->message);
    g_test_fail ();

to be replaced by the simpler

    g_test_fail_printf ("cannot reticulate splines: %s", error->message);

with the secondary benefit of making the message available to TAP
consumers as part of the "not ok" message.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-19 09:49:11 +01:00
Simon McVittie
26fbd14954 tests: Use g_test_skip_printf()
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-19 09:41:08 +01:00
Simon McVittie
182d9995ca gtestutils: Allow skipping tests with a printf-style message
Forming the g_test_skip() message from printf-style arguments seems
common enough to deserve a convenience function.

g_test_incomplete() is mechanically almost equivalent to g_test_skip()
(the semantics are different but the implementation is very similar),
so give it a similar mechanism for symmetry.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-19 09:41:08 +01:00
Philip Withnall
ae486f6dc6 Merge branch 'wip/pwithnall/gdbus-names-livelock' into 'main'
tests: Add missing wakeup calls to gdbus-names test

See merge request GNOME/glib!2157
2021-08-17 13:25:55 +00:00
Daniel Mustieles
592d114c50 Updated Spanish translation 2021-08-17 13:31:19 +02:00
Sebastian Dröge
336c747e59 Merge branch 'string-ctors' into 'main'
Annotate the GString constructors

See merge request GNOME/glib!2226
2021-08-17 07:10:54 +00:00
Philip Withnall
96763eca3f Merge branch 'va_copy-docs' into 'main'
Docs: Mention that G_VA_COPY() must be followed by `va_end()`

See merge request GNOME/glib!2224
2021-08-16 20:05:59 +00:00
Avinash Sonawane
31f793b71a Docs: Mention that G_VA_COPY() must be followed by va_end() 2021-08-16 20:05:59 +00:00
Emmanuele Bassi
d5b6c55cfe Annotate the GString constructors
Otherwise the introspection scanner won't recognise them as
constructors, because the GString get_type function has a different
symbol prefix.

See: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/399
2021-08-16 20:58:53 +01:00
Philip Withnall
27daa925b6 Merge branch 'implicit' into 'main'
build: Fix implicit declaration of function errors

See merge request GNOME/glib!2225
2021-08-16 17:19:09 +00:00
Anders Jonsson
88cc3202a5 Update Swedish translation 2021-08-14 11:18:34 +00:00
Ryan Schmidt
971310a92c build: Fix implicit declaration of function errors
Include the correct system headers for each test that meson performs.
This allows system capabilities to be detected correctly even if
implicit declaration of functions is considered an error.
2021-08-14 05:20:11 -05:00
Philip Withnall
d6a0e706f0 Merge branch 'wip/hadess/power-profile-monitor-portal' into 'main'
gio: Add portal version of GPowerProfileMonitor

See merge request GNOME/glib!2222
2021-08-13 08:31:14 +00:00
Bastien Nocera
2e9842cafc gio: Simplify memory monitor tests by using assertEventually() helper
assertEventually is a helper used in a number of projects that use
dbusmock.

See https://github.com/martinpitt/python-dbusmock/issues/82
2021-08-13 01:32:31 +02:00
Bastien Nocera
66acea8418 gio: Remove left-over debug statement from memory monitor portal test 2021-08-13 01:32:31 +02:00
Bastien Nocera
18eb29897d gio: Add GPowerProfileMonitor tests
Tests both the portal and direct D-Bus variants.
2021-08-13 01:32:31 +02:00
Bastien Nocera
9645cbffa8 gio: Add portal version of GPowerProfileMonitor 2021-08-13 01:32:31 +02:00
Matej Urbančič
a380bfdf93 Update Slovenian translation 2021-08-09 19:12:29 +00:00
Marek Černocký
a04e4f775e Updated Czech translation 2021-08-09 11:05:01 +02:00
Yaron Shahrabani
2700a22f02 Update Hebrew translation 2021-08-07 16:08:43 +00:00
LRN
14f583bc23 Merge branch 'filename-length' into 'main'
gwin32packageparser: Fix read past end of buffer

Closes #2454

See merge request GNOME/glib!2213
2021-08-07 05:36:40 +00:00
Simon McVittie
e74782719b Merge branch 'supported-versions' into 'main'
docs: Mention the stable/unstable support version in README.md

See merge request GNOME/glib!2165
2021-08-05 15:06:11 +00:00
Philip Withnall
5a9e3df11d Merge branch 'wip/who-tests-the-tests-themselves' into 'main'
tests: Fix error handling when testing gtestutils

See merge request GNOME/glib!2216
2021-08-05 14:13:20 +00:00
Philip Withnall
7451140688 Merge branch 'mcatanzaro/issuer-docs' into 'main'
Improve documentation of various TLS stuff

See merge request GNOME/glib!2211
2021-08-05 12:14:57 +00:00
Simon McVittie
b006403c4e tests: Fix error handling when testing gtestutils
We had two compensating bugs here. We didn't correctly clear the
error indicator after testing a test-case that calls g_test_fail(),
which meant we were leaving the error set to exit status 1 when
falling through to the next test; and then we didn't check the exit
status of the next test, but instead assumed that g_spawn_sync()
would fail (it does not).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-05 12:09:53 +01:00
Michael Catanzaro
b11d3fc2f4 gtlscertificate: improve documentation
Let's explain the advantages of relying on GTlsConnection to perform
certificate verification.

Also, document that the issuer property is a little tricky, because the
issuer certificate might not be the certificate that actually gets used
in final certification path building. This is very unexpected to anybody
who is not an expert.
2021-08-04 14:39:11 -05:00
Michael Catanzaro
235401b056 gtlsdatabase: improve documentation
Because TLS certificate verification is extremely complex, the lookup
issuer function may be tempting to misuse even by experienced
developers. There is a notion that the issuer certificate will always be
used in the final certification path, but it's just not always true.
Trying to make security decisions based on the results of this function is
a trap, so let's document that.

It turns out that old versions of glib-networking actually reordered the
certificate chain to match the final verification path. This no longer
happens since a long time ago, because it was a buggy mess. Instead, we
rely on the TLS library to build the final verification path. Their path
building is not very good, but at least it's consistent. The point of
these doc updates is to clarify that only the TLS library can make
security decisions.

Document that HTTP requests may be performed to look up missing
certificates.

Finally, let's document that certificate verification using GTlsDatabase
cannot be as smart as certificate verification performed directly by
GTlsConnection.
2021-08-04 14:39:11 -05:00
Jonathan Boeing
032eceb9a1 gwin32packageparser: Fix read past end of buffer
g_win32_package_parser_enum_packages() reads beyond the end of a buffer
when doing a memcpy.  With app verifier enabled on Windows, it causes
the application to crash on startup.

This change limits the memcpy to the size of the source string.

Fixes: #2454
2021-08-04 09:19:30 -07:00
Philip Withnall
be4b8cbe96 2.69.1
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-08-04 16:32:18 +01:00
Philip Withnall
0f9c7ed021 Revert "gdbus: Use DBUS_SESSION_BUS_ADDRESS if AT_SECURE but not setuid"
This reverts commit 7aa0580cc5.

As stated in #2316, that commit was a workaround to allow gnome-keyring
and msmtp to continue to get their session bus address from
`DBUS_SESSION_BUS_ADDRESS`, even though they’re `AT_SECURE`. The timeout
on that workaround has expired so that commit is now being reverted.

Fixes: #2316
2021-08-04 16:16:16 +01:00
Philip Withnall
709df8eeb4 Merge branch 'docgen-fixes' into 'main'
Adapt documentation to gi-docgen

See merge request GNOME/glib!2206
2021-08-03 13:53:38 +00:00
Philip Withnall
30b9aacff1 Merge branch 'notify-hint' into 'main'
GNotification: Allow to set a category

Closes #2446

See merge request GNOME/glib!2207
2021-08-03 13:44:16 +00:00
Guido Günther
8704c521fd gfdonotificationbackend: Pass on category 2021-08-02 19:26:38 +02:00
Guido Günther
791218a5f5 GNotification: Allow to set a category
Some backends like the FDO one allow to set a category. This helps the
notification daemon to select a proper feedback type.
2021-08-02 19:26:38 +02:00
Emmanuele Bassi
d6f7f8e961 docs: Use the proper Markdown syntax for lists
You need to separate the first entry in the list from the preceding
paragraph, and you should add a space before the enumerating symbol.

GTK-Doc accepts a very lax Markdown syntax, but any other tool parsing
our documentation will likely fail.
2021-08-02 16:29:16 +01:00
Emmanuele Bassi
24a0c3a940 docs: Break GFileAttribute descriptions into paragraph
Keep the first paragraph short, to act as a summary.
2021-08-02 16:21:37 +01:00
Emmanuele Bassi
bed2da6cc2 docs: Break gtk-doc stanzas into paragraphs
Keep the first paragraph short, to act as a summary.
2021-08-02 16:00:12 +01:00
Emmanuele Bassi
4bbe7912a1 docs: Use the correct sigils for pre-processor symbols
And reduce the excessive whitespace in argument and return value blocks.
2021-08-02 15:59:43 +01:00
Emmanuele Bassi
97a6111c83 docs: Enable syntax highlighting on code examples 2021-08-02 15:56:42 +01:00
Emmanuele Bassi
3b5d3ed2e3 docs: Fix KeyFile annotations
Use the right gtk-doc sigil for pre-processor symbols.

Reduce the indentation in argument annotations, to avoid them being
parsed as code blocks.
2021-08-02 15:55:08 +01:00
Simon McVittie
37e5dfd3a2 Merge branch 'close-range-cloexec' into 'main'
gspawn: Use CLOSE_RANGE_CLOEXEC if available

See merge request GNOME/glib!2184
2021-08-02 14:49:27 +00:00
Philip Withnall
921e1f2b8b Merge branch 'appinfo-pointer-init' into 'main'
GWin32AppInfo: Fix missing initialization

See merge request GNOME/glib!2210
2021-08-02 14:36:40 +00:00
Руслан Ижбулатов
ae5e016edc GWin32AppInfo: Fix missing initialization
The value should be initialized to NULL before calling
g_win32_registry_key_get_value_w(), to ensure that cleanup
can be done unconditionally afterward.
2021-08-02 14:19:35 +00:00
Emmanuele Bassi
1b666b7f12 docs: Clean up the GDate types description
Split the first paragraph.

Use the correct gtk-doc sigil for enumeration value.

Use the appropriate term for negative years in the Western calendar.
2021-08-02 14:54:34 +01:00
Emmanuele Bassi
2aedaf293b docs: Annotate glib_check_version()
Add introspection annotations.

Reduce the indentation for the return value documentation string.

Use the appropriate gtk-doc syntax for symbols.
2021-08-02 14:52:06 +01:00
Philip Withnall
92bdc92d6d Merge branch 'unicode-typo-fix' into 'main'
Fix a Unicode typo

See merge request GNOME/glib!2201
2021-08-02 13:44:20 +00:00
Philip Withnall
d6576e9781 Merge branch 'nfc-nfd-test' into 'main'
tests: Add a test for Unicode normalization

See merge request GNOME/glib!2204
2021-08-02 13:17:23 +00:00
Philip Withnall
fad0a6af87 Merge branch 'wip/smcv/2452-g-string-0-length-replace' into 'main'
g_string_replace: Don't replace empty string more than once per location

Closes #2452

See merge request GNOME/glib!2208
2021-08-02 12:47:03 +00:00
Emmanuele Bassi
6081e92daf docs: Match GZlib(De)Compressor section with the type name
Otherwise the introspection scanner won't be able to match the
documentation stanza to the corresponding type.
2021-08-02 13:27:55 +01:00
Emmanuele Bassi
f62622fc7b docs: Start stanzas with a single paragraph
When rendering the contents of the GLib documentation stored inside the
introspection data, a common behaviour is to take the first paragraph as
a summary of the symbol being documented.

The documentation is assumed to be in Markdown format, which means:

 - paragraphs must be separated by newlines
 - lines that have an indentation of four or more spaces are considered
   code blocks
 - lines that start with a `#` are considered titles

This means we need to slightly tweak the documentation in our sources to
ensure that it can be rendered appropriately by tools that are not
gtk-doc.

See issue: #2365
2021-08-02 13:22:23 +01:00