Commit Graph

25412 Commits

Author SHA1 Message Date
Marc-André Lureau
bd45147077 tests/io-channel: skip a "unimplemented" error on win32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-23 16:08:42 +00:00
Marc-André Lureau
0ca9edd15f glib/tests: fix foo=bar=baz environment test
The handling of that case isn't well specified, and system dependent.

However if the system decided that "foo=bar" was the key, then don't
expect "foo" is set.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-23 16:08:42 +00:00
Marc-André Lureau
4403704826 glib/tests: fix test_turkish_strupdown
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-23 16:08:40 +00:00
Marc-André Lureau
44adc6ca8e glib/tests: fix casemap_and_casefold test on win32
Both environment variables and GetThreadLocale() may interefere with the
glib case conversion logic.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-23 16:08:05 +00:00
Philip Withnall
6aa210e6af gio: Remove fam file monitor support
libgamin was last released in 2007 and is dead
[upstream](https://gitlab.gnome.org/Archive/gamin). Distributions may
still ship it (although Fedora no longer does), but we want people to
use inotify on Linux since it’s actively supported.

BSDs use kqueue. Windows uses win32filemonitor.

FAM might still be used on some commercial Unix distributions, but there
are no contributors from those distributions, and certainly no CI for
them to prevent regressions.

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

Fixes: #2614
2022-03-23 15:41:54 +00:00
Philip Withnall
2759dd71be gio: Remove remaining references to fen file monitor
It used to exist on Solaris, but GLib’s support for it was mostly
removed in 2015 in commit 21ab660cf8.

Remove the final few references.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-23 15:40:41 +00:00
Marc-André Lureau
517bd62840 gio/win32: TIME_CREATED_USEC is u32
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-23 19:34:32 +04:00
Philip Withnall
e951bf1ae3 docs: Improve formatting for some file monitor documentation
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-23 15:34:19 +00:00
Philip Withnall
bbf1dca06a docs: Drop reference to G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME
Support for separate directory monitors was dropped in commit
b995c08bf3, in 2015.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-23 15:32:37 +00:00
Emin Tufan Çetin
cffbd11437 Update Turkish translation 2022-03-23 08:08:22 +00:00
Jordi Mas
f0f3a489d5 Update Catalan translation 2022-03-23 07:41:35 +01:00
Hugo Carvalho
fe95865267 Update Portuguese translation 2022-03-22 22:19:28 +00:00
Aurimas Černius
1b0841a591 Updated Lithuanian translation 2022-03-22 21:16:29 +02:00
Matej Urbančič
8dcb0409ca Update Slovenian translation 2022-03-22 18:32:32 +00:00
Piotr Drąg
9000a26a06 Update Polish translation 2022-03-22 16:25:37 +00:00
Anders Jonsson
39b5925391 Update Swedish translation 2022-03-22 16:21:16 +00:00
Milo Casagrande
60ee6302e4 Update Italian translation 2022-03-22 16:14:04 +00:00
Yuri Chornoivan
2afdaf82ad Update Ukrainian translation 2022-03-22 15:46:15 +00:00
Philip Withnall
61e2a9afe2 Merge branch 'resolver-tests' into 'main'
tests: Add more tests for GResolver response parsing

See merge request GNOME/glib!2566
2022-03-22 15:18:49 +00:00
Philip Withnall
f9ef3bec68 gthreadedresolver: Only declare private test APIs on Unix
They’re only defined on Unix anyway. `GThreadedResolver` has an entirely
different code path for handling DNS replies on Windows.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:41:08 +00:00
Philip Withnall
e8e8aebcbe resolver: Add SRV support to manual resolver test
This allows for tests like:
```
resolver -t SRV _http._tcp.mxtoolbox.com
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
33204fe127 tests: Add tests for parsing specific DNS record types
Success and failure tests. This massively increases test coverage for
parsing DNS records, although it doesn’t get it to 100%.

It should now be useful enough to do more fuzzing on, without
immediately getting trivial failures from the fuzzer.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
0d42af06e0 gthreadedresolver: Treat query and answer counts as unsigned
They can’t be negative.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
08dee06b59 gthreadedresolver: Limit length of each record to its stated rdlength
Rather than limiting them to the full length of the answer, which may
include subsequent records.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
023fab80f9 gthreadedresolver: Add error checking to all record parsing
This should catch all kinds of invalid records, and correctly report
them as errors.

Heavily based on work by Patrick Griffis in !2134.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
81193c5aac gthreadedresolver: Don’t warn on unrecognised record types
Otherwise the code isn’t forwards-compatible, and may be DOSed by
servers returning unknown records, if `G_DEBUG=fatal-warnings` is
enabled for some reason.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
51f70fe62e tests: Add tests for invalid DNS response header parsing
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
2a7b4db243 gthreadedresolver: Expose g_resolver_record_type_to_rrtype()
So that it can be used in the tests.

It’s not part of the public, documented, supported API.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
8b73d7bbf9 gthreadedresolver: Handle error returns from dn_expand() in headers
It is possible for `dn_expand()` to fail; if so, it’ll return `-1`,
which will mess up subsequent parsing.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Philip Withnall
263ca69da8 gthreadedresolver: Check header length when parsing response
Otherwise we could read off the end of an invalid response.

oss-fuzz#42538
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 12:40:12 +00:00
Patrick Griffis
5cdacced3f tests: Add basic test framework for GResolver DNS parsing
Split out from https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2134
by Philip Withnall so it can be used in advance of HTTPS DNS record
support landing.

Reworked to no longer use test fixtures, as it’s simple enough to build
the response header in each test.

The tests are built on Unix only, as they test the parsing code in
`g_resolver_records_from_res_query()`, which is Unix-specific. The
Windows DNS APIs provide much more structured results which don’t need
parsing.
2022-03-22 12:40:12 +00:00
Philip Withnall
94179de2d9 Merge branch 'slice_tests' into 'main'
Move test files on slices from tests/ to glib/tests/

See merge request GNOME/glib!2564
2022-03-22 12:22:57 +00:00
Emmanuel Fleury
5931ed8c2b Move test files on slices from tests/ to glib/tests/
slice-color.c and slice-concurrent.c are moved from tests/ to glib/tests/

Related to issue #1434
2022-03-22 11:42:33 +00:00
Emmanuel Fleury
1f2f3d7f37 Convert tests/slice-concurrent.c to glib test framework 2022-03-22 11:42:33 +00:00
Emmanuel Fleury
6211971c41 Convert tests/slice-color.c to glib test framework 2022-03-22 11:42:33 +00:00
Emmanuel Fleury
495508cf84 Enabling disabled slice-color test case 2022-03-22 11:42:33 +00:00
Alexander Shopov
32b5f405bc Update Bulgarian translation 2022-03-22 10:30:56 +00:00
Philip Withnall
84940a56fd tests: Fix compilation when GLIB_DISABLE_DEPRECATION_WARNINGS is defined
This should fix the Coverity build, which runs with
`-DGLIB_DISABLE_DEPRECATION_WARNINGS` defined in the environment (see
`.gitlab-ci.yml`).

See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1907625
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-03-22 10:15:40 +00:00
Philip Withnall
56a3747038 Merge branch 'wip/carlosg/gdatetime-before-y1000' into 'main'
glib: Format GDateTime ISO8601 years as %C%y

See merge request GNOME/glib!2563
2022-03-21 13:47:48 +00:00
Philip Withnall
9e38cffdfc Revert "meson: simplify lookup of python command"
This reverts commit 4a4d9eb662.

It seems to cause build failures with `VsDevCmd.bat` 2022:
```
..\meson.build:2274:0: ERROR: Command "C:\Program Files\Meson\meson.exe runpython --version" failed with status 2.
```

Revert it for now until this can be fixed in Meson.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2541#note_1410521
2022-03-21 13:17:32 +00:00
Carlos Garnacho
16fcd0814e glib: Add tests for far away GDateTimes
Poke near the limits (years 9 and 9990) to ensure these also
result in a correct ISO8601 format.
2022-03-21 12:56:42 +00:00
Carlos Garnacho
c3cc6bf5eb glib: Format GDateTime ISO8601 years as %C%y
The current use of %Y does not take into account that %Y will
not pad the year with 0's, meanwhile ISO8601 does expect a full
YYYY format for all dates. This breaks the formatting with dates
prior to the year 1000.

Split this into %C%y so 2-digit, 0-padded century and year are
printed separately, this gives the expected YYYY format.
2022-03-21 12:56:42 +00:00
Alexander Shopov
96efd662c9 Update Bulgarian translation 2022-03-21 12:43:03 +00:00
Philip Withnall
2e940e125f Merge branch 'w32-skips' into 'main'
Various win32 tests skip & fixes

See merge request GNOME/glib!2540
2022-03-21 12:19:24 +00:00
Philip Withnall
48a3e8f7f2 Merge branch 'move_g_basename_test' into 'main'
Move unit test on g_basename() function to glib/tests/fileutils.c

See merge request GNOME/glib!2558
2022-03-21 12:14:59 +00:00
Philip Withnall
47f905d2f6 Merge branch 'move_relation_tests' into 'main'
Move tests/relation-test.c to glib/tests/relation.c

See merge request GNOME/glib!2559
2022-03-21 12:12:38 +00:00
Andre Klapper
513afbb09f Fix invalid markup in Bulgarian translation 2022-03-19 20:32:49 +01:00
Alexander Shopov
596fa06aaf Update Bulgarian translation 2022-03-19 16:46:07 +00:00
Simon McVittie
1726e150f4 tests: Call openpty (if available) without using dlsym
The SONAME of libutil varies between architectures, so the logic to find
the SONAME of libutil was only correct for native builds (Linux on
Linux), not for cross-builds. The regular expression was also not
sufficiently broad to match the SONAME used on the alpha architecture,
which is apparently libutil.so.1.1.

Instead of screen-scraping the output of ldconfig and using that to
dlopen the library that contains openpty, it seems more reliable to
emit a link-time reference to openpty and let the linker do its job.
It's also less code.

Bug-Debian: https://bugs.debian.org/1007946
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-19 14:10:51 +00:00
Sebastian Dröge
c5e12d9577 Merge branch 'wip/pwithnall/update-other-cis' into 'main'
ci: Update Coverity, mingw and Android CI images to Fedora 34

See merge request GNOME/glib!2560
2022-03-18 11:45:34 +00:00