Commit Graph

18932 Commits

Author SHA1 Message Date
Emmanuele Bassi
9ce18521aa Merge branch '1475-atomic-casts' into 'master'
tests: Fix a -Wbad-function-cast warning in the atomic tests

Closes #1475

See merge request GNOME/glib!223
2018-08-07 10:06:04 +00:00
Philip Withnall
ab09a5f5a9 gdbusmessage: Fix a typo in the documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-07 11:04:00 +01:00
Philip Withnall
6104e63ec4 tests: Improve branch coverage when testing g_time_val_add()
While I’m here…

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-07 11:03:39 +01:00
Philip Withnall
725eb1c86b tests: Add test for overflow handling in g_time_val_to_iso8601()
While I’m here…

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-07 11:03:39 +01:00
Emmanuele Bassi
7458defa9a Merge branch 'ossfuzz-9673-bookmark-date-overflow' into 'master'
gtimer: Add overflow checks to g_time_val_from_iso8601()

See merge request GNOME/glib!225
2018-08-07 09:57:21 +00:00
Philip Withnall
a5f824451f Merge branch 'mcatanzaro/tls-docs' into 'master'
Update TLS documentation

See merge request GNOME/glib!199
2018-08-07 09:46:30 +00:00
Philip Withnall
e5d9eca334 Merge branch 'gbytes-compare-docs' into 'master'
Fix up g_bytes_compare() documentation

See merge request GNOME/glib!229
2018-08-06 18:00:45 +00:00
Philip Withnall
2ab7fd2951 tests: Add more ISO 8601 parser tests
These come from looking at the code coverage data. We should now have
full branch coverage of the ISO 8601 parser.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-06 14:07:29 +01:00
Philip Withnall
fdccf5ff34 gtimer: Drop support for negative years from g_time_val_from_iso8601()
It never worked; we’ve always parsed the year with strtoul() (unsigned).
While negative years are supported by the ISO 8601 standard, they can
only be used by mutual agreement of the two parties interchanging data.
Moreover, they are not supported by GTimeVal, which is what we’re
filling with the results.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-06 14:07:29 +01:00
Philip Withnall
cefa66eb76 gtimer: Add overflow checks to g_time_val_from_iso8601()
The code was previously doing a few bits of arithmetic without checking
whether they would overflow, and hence not validating the date/time it
was parsing very strictly.

The parser is now not 100% strict, but should avoid any arithmetic
overflows which would cause an invalid result to be returned even though
g_time_val_from_iso8601() had returned TRUE.

oss-fuzz#9673

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-06 14:07:29 +01:00
Philip Withnall
b1fffbffbf gtimer: Document that g_time_val_from_iso8601() drops whitespace
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-06 14:07:29 +01:00
Philip Withnall
4eca2ac0ee tests: Add an overflow test for bookmark file dates
oss-fuzz#9673

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-06 14:07:27 +01:00
Emmanuele Bassi
eb65054aba Merge branch 'ossfuzz-9723-bookmark-leak' into 'master'
gbookmarkfile: Fix some more minor leaks when metadata elements are repeated

See merge request GNOME/glib!230
2018-08-06 12:54:04 +00:00
Philip Withnall
2860d4b50e gbookmarkfile: Fix some more minor leaks when metadata elements are repeated
oss-fuzz#9723

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-06 13:36:21 +01:00
Sebastian Dröge
a81b925d98 Fix up g_bytes_compare() documentation
It was declaring the opposite of what the function was actually doing,
and what every other comparison function is doing.
2018-08-06 15:20:02 +03:00
Aurimas Černius
0fba231a6b Updated Lithuanian translation 2018-08-05 23:25:59 +03:00
Christoph Reiter
7e6fb333f7 meson: define _FILE_OFFSET_BITS=64 for MinGW. See #1476
The autotools build set it by default and we use off_t in various places,
even on Windows. Also set it with the meson build to avoid any regressions.

Ideally we shouldn't use off_t and use 64bit capable API on Windows instead, so
we get large file support with MSVC as well.
2018-08-05 22:04:17 +02:00
Michael Catanzaro
08fe93589e Update documentation of g_tls_client_connection_set_use_ssl3()
We now send the fallback SCSV, meaning use of this function will cause
modern servers to immediately terminate the connection, so let's warn
API users to expect that behavior and be crystal clear that this
function should only be used as a fallback when a normal connection
attempt has already failed.

Also, the documentation is mostly duplicated between the property and
the function, so let's just reference the function documentation from
the property.
2018-08-04 16:33:28 -05:00
Simon McVittie
54a5f37f12 g_test_run: Document g_test_incomplete's similarity to g_test_skip
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 14:33:52 +01:00
Simon McVittie
0a180bb51b testing: Assert that test-case results are combined correctly
This repurposes the existing skip-all test as "combining", since it
is no longer entirely about runs where every test-case was skipped.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 14:30:10 +01:00
Simon McVittie
bbefa73997 testutils: Treat incomplete tests more like skipped tests
If a test is marked with g_test_incomplete(), then it is expected to
fail, so when it fails the test executable should still exit 0
(or possibly 77, if all tests are either skipped or incomplete).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 14:28:21 +01:00
Simon McVittie
ba3b442152 testing: Use g_assert_true(), which is preferred for unit tests
In the test for the unit testing framework, we might as well have
exemplary behaviour. Leave behind a single call to g_assert (TRUE)
just to prove that it still works.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 13:44:51 +01:00
Simon McVittie
ffe0402e02 testing: Assert that skipped tests cause g_test_failed()
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 13:42:57 +01:00
Simon McVittie
49a877764d testing: Clarify why incomplete tests cause g_test_failed()
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 13:42:38 +01:00
Simon McVittie
7cc5565e7c testutils: Correctly print incomplete tests as "not ok # TODO"
The TAP specification says that failing tests that are currently
expected to fail (like Automake's XFAIL) are to be reported as
"not ok", with that failure ignored as a result of the TODO
directive, with this example:

    not ok 3 - infinite loop # TODO halting problem unsolved

A test reported as "ok # TODO" indicates that something that is
expected to fail has unexpectedly succeeded, similar to Automake's
XPASS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-03 13:20:59 +01:00
Philip Withnall
21d1797a4f tests: Fix a -Wbad-function-cast warning in the atomic tests
Assigning the gpointer return value from g_atomic_pointer_get() to a
gsize variable was not making -Wbad-function-cast happy. Assign to an
intermediate gpointer variable and then cast that instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1475
2018-08-03 11:08:26 +01:00
Philip Withnall
516101c702 Merge branch 'test-ip_mreq_source-android-only' into 'master'
build: only test for broken ip_mreq_source on Android. Fixes #1472

Closes #1472

See merge request GNOME/glib!222
2018-08-03 09:33:35 +00:00
Christoph Reiter
99caee2819 build: only test for broken ip_mreq_source on Android. Fixes #1472
7efd76dd67 added these configure time tests to work around a bug
with older Android. Since the test didn't take Windows into account it
wrongfully applied the workaround on Windows too, breaking the build.
With meson this wasn't an issue since the check is skipped on Windows there
and our CI didn't catch this issue.

Change the test to run on Android only for meson and autotools.
This also makes it clear that the test+code can be dropped again if we stop
supporting older Android versions at some point.
2018-08-03 10:24:00 +02:00
Philip Withnall
a0289a56b7 Merge branch 'date-test-skip' into 'master'
date test: Use g_test_skip(), not g_test_incomplete()

See merge request GNOME/glib!220
2018-08-02 19:38:38 +00:00
Simon McVittie
cc9cfc75fc date test: Use g_test_skip(), not g_test_incomplete()
g_test_skip() is appropriate for tests that can't run due to missing
functionality on the host system, whereas g_test_incomplete() is
for expected-to-fail tests for unimplemented functionality in the
code under test.

See also https://bugzilla.gnome.org/show_bug.cgi?id=793635 and
commit 5459b345.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-08-02 17:57:46 +01:00
Philip Withnall
7f5296d055 Merge branch 'wip/oholy/update-mounts' into 'master'
Be sure that g_volume_get_mount succeed after g_volume_mount

See merge request GNOME/glib!217
2018-08-02 15:40:50 +00:00
Philip Withnall
71b0123845 Merge branch 'issue-1467' into 'master'
Drop a questionable test from the refstring suite

Closes #1467

See merge request GNOME/glib!218
2018-08-02 11:44:17 +00:00
Emmanuele Bassi
12adfcb602 Merge branch 'bookmark-file-leak' into 'master'
gbookmarkfile: Fix some minor leaks when metadata elements are repeated

See merge request GNOME/glib!216
2018-08-02 11:31:13 +00:00
Emmanuele Bassi
5e64ee3af7 Drop a questionable test from the refstring suite
Testing that an interned string is released once its last reference is
dropped is not possible without a hook into the interning machinery;
just checking that the returned pointer for the same string is going to
be different after the last release() is not guaranteed to work, as the
systema allocator is perfectly within its rights to recycle pointers, as
long as they are unique while valid.

Closes #1467
2018-08-02 12:21:38 +01:00
Ondrej Holy
3edc50498f glocalfilemonitor: Fallback to poll file monitor for NFS
GLib currently tries to use FAM volume monitor for monitoring files
within home on NFS. If FAM support is not available, it fallbacks by
default to GInotifyFileMonitor. I think we should fallback to
GPollFileMonitor instead, because inotify is not reliable on NFS,
which may cause issues for dconf. With this patch, it should be safe to
not build libgiofam and still be sure that dconf works properly if home
is mounted on NFS. I think this might be a first step to remove FAM
support from GLib completely, because gamin is buggy and dead for
several years already. Gamin just polls files on NFS anyway. This
change applies on files only, because GPollFileMonitor seems doesn't
support dirs, however it should be enough for dconf. The other
drawback is that one can't set poll timeout currently. Just a note
that this can still be overwritten by GIO_USE_FILE_MONITOR.
2018-08-02 13:14:10 +02:00
Philip Withnall
6c041ff283 gbookmarkfile: Fix some minor leaks when metadata elements are repeated
oss-fuzz#9674

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-08-02 11:20:15 +01:00
Ondrej Holy
88b8ebb5dd gio-tool: Hold GVolumeMonitor reference during operations
Releasing GVolumeMonitor before g_volume_mount finish cause that
g_volume_get_mount returns NULL, because the mount is not correctly
propagated to the volume.

https://gitlab.gnome.org/GNOME/glib/issues/1458
2018-08-02 11:35:48 +02:00
Philip Withnall
433770b681 Merge branch 'build-fix-mingw-libelf' into 'master'
gresource-tool: fix build in case libelf is available on Windows. Fixes #1466

Closes #1466

See merge request GNOME/glib!215
2018-08-01 23:18:53 +00:00
Christoph Reiter
70ad484508 gresource-tool: fix build in case libelf is available on Windows. Fixes #1466
The gresource code uses libelf if available but that also depends on mmap but isn't
guarded with HAVE_MMAP. This can make the build fail under MSYS2 where a mingw version
of libelf exists but there is no mmap.

Instead of guarting the libelf code with HAVE_LIBELF add a new macro named USE_LIBELF
which is only defined if libelf and mmap support are available.

Also install the mingw libelf version for CI so we catch similar errors in the future.
2018-08-01 19:08:39 +02:00
Philip Withnall
b2249bf33c tests: Don’t use a potentially-existent timezone in a test for failure
When checking that the timezone code falls back to UTC if a zone is
unknown, don’t use ‘PST’, because that can actually exist on some
systems.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1433
2018-07-31 19:54:56 +01:00
Philip Withnall
17df5c0b26 gtestutils: Mention G_DISABLE_ASSERT in documentation for g_test_init()
g_test_init() bails if G_DISABLE_ASSERT is defined. Mention that. This
is a follow-up to
https://gitlab.gnome.org/GNOME/glib/merge_requests/174.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1446
2018-07-31 19:49:37 +01:00
Philip Withnall
83a4cab12c 2.57.2 (actual release)
The previous 2.57.2 release failed. The tarball for this one will be
generated using `ninja dist`, but should still be good to be built using
autotools. `make distcheck` on it has been tested.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1436
2018-07-31 19:36:19 +01:00
Matthias Clasen
9460aeeed8 Merge branch '1436-please-for-the-love-of-things-just-build' into 'master'
Fix the stupid .Plo file errors

See merge request GNOME/glib!211
2018-07-31 18:13:43 +00:00
Philip Withnall
ca0110c34d build: Conditionally add spawn and IO channel without using EXTRA_ prefix
See previous commit; same reasoning behind the commit, except that these
sources weren’t (yet) causing `make distcheck` to fail.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-31 18:52:37 +01:00
Philip Withnall
862fe11f90 build: Conditionally add gwin32.c to sources without using EXTRA_ prefix
Instead of messing around with EXTRA_*_SOURCES and manually handling .lo
files, why not just add gwin32.c to the GLib sources conditionally?

This will hopefully fix `make distcheck` failing due to gwin32.Plo not
being generated in the sub-builddir≠srcdir stage, due to depcomp
inexplicably not generating it. (Note that it is correctly generated in
non-distcheck builds.)

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-07-31 18:52:37 +01:00
Daniel Mustieles
bcafcc5b54 Updated Spanish translation 2018-07-31 12:42:21 +02:00
Emmanuele Bassi
158f07c223 Merge branch 'gio-enum-install' into 'master'
Install gioenumtypes.h

See merge request GNOME/glib!210
2018-07-31 09:03:22 +00:00
Emmanuele Bassi
26c3f2f1b1 Install gioenumtypes.h
We're re-defining nodist_gioinclude_HEADERS and Automake will use the
last definition of the target.
2018-07-31 09:40:22 +01:00
Philip Withnall
83c69fa77d Merge branch '1035-bookmarks-state-machine' into 'master'
gbookmarkfile: Fix error reporting with unexpected nesting of elements

Closes #1035

See merge request GNOME/glib!207
2018-07-30 22:50:52 +00:00
Matthias Clasen
dbf9959d15 Merge branch '1436-docs-muckery' into 'master'
Fix various documentation issues and man page issues with autotools

See merge request GNOME/glib!209
2018-07-30 22:24:26 +00:00