Commit Graph

19787 Commits

Author SHA1 Message Date
Philip Withnall
b72b4e2d24 Merge branch 'w32-testsuite-fixes-socket' into 'master'
Socket fixes to W32 test suite

See merge request GNOME/glib!666
2019-02-18 12:54:45 +00:00
Emmanuele Bassi
9530883430 Merge branch 'unused-warning' into 'master'
Initialize a variable

See merge request GNOME/glib!676
2019-02-18 10:15:30 +00:00
Emmanuele Bassi
f011be9c4b Initialize a variable
Compilers get confused when variables are initialized by a function by
taking them as reference in an out argument; this, coupled with the fact
that C does not initialize variables by default, most commonly results
in a "maybe uninitialized" compiler warning.
2019-02-18 09:50:26 +00:00
Philip Withnall
8423e59e95 2.59.3
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-18 08:55:54 +00:00
Alan Mortensen
f4effa3871 Updated Danish translation 2019-02-16 20:55:31 +01:00
Baurzhan Muftakhidinov
055526b2ba Update Kazakh translation 2019-02-16 12:16:13 +00:00
Michael Catanzaro
eac2b1a1c3 Merge branch 'wip/tingping/socket-cancellation' into 'master'
gsocketclient: Ensure task is always returned on cancel

Closes libsoup#132

See merge request GNOME/glib!647
2019-02-14 18:26:17 +00:00
Matej Urbančič
0a2d4f6e24 Updated Slovenian translation 2019-02-14 18:39:17 +01:00
Kukuh Syafaat
032c76eb7c Update Indonesian translation 2019-02-14 15:07:12 +00:00
Christoph Reiter
37f9b613d9 Merge branch 'gdbus-fix-use-after-free' into 'master'
gdbus: Fix a potential use-after-free on connection close. Fixes #1686

Closes #1686

See merge request GNOME/glib!671
2019-02-14 13:36:15 +00:00
Christoph Reiter
11309b7940 Revert "tests: Mark gdbus-peer test as flaky". See #1686
This reverts commit 983a40bf34.
2019-02-14 14:20:32 +01:00
Christoph Reiter
067992f8de gdbus: Fix a potential use-after-free on connection close. Fixes #1686
512e9b3b34 added a call to schedule_pending_close() in the read
callback after the reference to the worker is already gone. In case this was
the last reference to the worker this resulted in a use-after-free.

6f3d57d2ee made this more likely to happen because on connection close
the worker cancel action is now async while the reference to the worker
gets dropped right away.

Move the call to schedule_pending_close() before the unref.

Fixes #1686
2019-02-14 14:19:55 +01:00
Philip Withnall
4cf8fd0bc8 Merge branch 'tests-as-root' into 'master'
Fix some tests when running as root

See merge request GNOME/glib!672
2019-02-14 13:17:45 +00:00
Dan Nicholson
786753ac21 tests: keyfile writability not affected by file mode for root
When testing as root, changing the permissions of the keyfile will have
no effect on the writability since root bypasses these permissions. See
path_resolution(7). Skip the test in this case.
2019-02-14 11:35:26 +00:00
Philip Withnall
888aa4c5ff tests: Use g_assert_*() rather than g_assert() in GSettings tests
g_assert_*() give more informative error messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-14 11:35:26 +00:00
Руслан Ижбулатов
c00724d5c9 socket test: Use loopback for connecting, not 0.0.0.0
getsockname() returns the address that the socket was bound to.
If it was bound to INADDR_ANY, getsockname() will stubbornly return INADDR_ANY
(and someport - that one is valid).
Subsequent connection attempts to INADDR_ANY:someport will fail with winsock.
Actually, it doesn't make even sense to connect to INADDR_ANY at all
(where is the socket connecting to? To a random interface of the host?),
so this is just a straight-up change, without platform-specific ifdefing.

Use loopback instead of INADDR_ANY. To ensure that binding and creation
of INADDR_ANY is still tested, use two addresses: bind to INADDR_ANY,
but connect to loopback, with the port number that we got from the bound
address.
2019-02-13 18:22:10 +00:00
Philip Withnall
fbb97b46d8 Merge branch 'gdbus-peer-flaky' into 'master'
tests: Mark gdbus-peer test as flaky

See merge request GNOME/glib!668
2019-02-13 16:53:32 +00:00
Philip Withnall
843a0422ab Merge branch 'w32-mount-sort' into 'master'
GWin32VolumeMonitor: Sort the volumes correctly

See merge request GNOME/glib!669
2019-02-13 16:41:14 +00:00
Philip Withnall
29bde32b98 Merge branch 'ossfuzz-12686-variant-parse-negative-ints' into 'master'
gvariant-parser: Fix parsing of G_MININT* values in GVariant text format

See merge request GNOME/glib!638
2019-02-13 16:39:52 +00:00
Sebastian Dröge
7c7bd56ee3 Merge branch 'alatiera/pollable-typo' into 'master'
gpollableoutputstream: Fix the description of the interface

See merge request GNOME/glib!670
2019-02-13 16:15:19 +00:00
Jordan Petridis
3e77699c28
gpollableoutputstream: Fix the description of the interface
Looks like this was a copy-paste typo from the Input interface.
2019-02-13 17:52:21 +02:00
Руслан Ижбулатов
0c16230b28 GWin32VolumeMonitor: Sort the volumes correctly
Use a static GQueue to form the GList of mounts by appending (which
is fast, because GQueue tracks the tail pointer of its internal GList),
then return that GList. This way we don't need to form the list
by prepending, which would have made it necessary to reverse it before
returning.

If the list is not ordered correctly, local drives in GTK places sidebar
are shown in reverse order.
2019-02-13 15:27:29 +00:00
Rafael Fontenelle
ea1235ca69 Update Brazilian Portuguese translation 2019-02-13 13:21:05 +00:00
Philip Withnall
983a40bf34 tests: Mark gdbus-peer test as flaky
It is occasionally deadlocking. See #1686.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-13 12:04:26 +00:00
Philip Withnall
c5c9b29b9d Merge branch 'w32-testsuite-fixes-general' into 'master'
General fixes to W32 test suite

Closes #875

See merge request GNOME/glib!665
2019-02-13 10:40:11 +00:00
Philip Withnall
0f26836d73 Merge branch 'w32-testsuite-fixes-gsubprocess' into 'master'
GSubprocess fixes for W32 test suite

See merge request GNOME/glib!667
2019-02-13 10:37:22 +00:00
Iain Lane
95899c11d9 Merge branch 'socketclient-slow-install-preload-library' into 'master'
tests: Install the slow-connect-preload.so library and use it

See merge request GNOME/glib!651
2019-02-13 10:00:13 +00:00
Iain Lane
1ecaae6454
installed-tests: Install the slow-connect-preload.so library and use it
The gsocketclient-slow test needs this, otherwise connect() succeeds
immeidately and the test fails, because it is checking that cancellation
works. We weren't installing it for installed tests.
2019-02-13 09:45:08 +00:00
Iain Lane
07a1a8031d
installed tests: Allow tests to set environment variables
It's necessary sometimes for installed tests to be able to run with a
custom environment. For example, the gsocketclient-slow test requires an
LD_PRELOADed library to provide a slow connect() (this is to be added in
a followup commit).

Introduce a variable `@env@` into the installed test template, which we
can override as necessary when generating `.test` files, to run tests
prefixed with `/usr/bin/env <LIST OF VARIABLES>`.

As the only test that requires this currently lives in `gio/tests/`, we
are only hooking this up for that directory right now. If other tests in
future require this treatment, then the support can be extended at that
point.
2019-02-13 09:43:49 +00:00
Руслан Ижбулатов
1cc78bf082 GSubprocess test: Adjust the cwd test to pass on Windows
There's no /tmp directory on Windows.
Use g_get_tmp_dir(), and adjust the test to work with that.
The test *still* checks the basename of the new CWD, it just
doesn't need to be "tmp" anymore.
2019-02-13 08:52:59 +00:00
Руслан Ижбулатов
4bc1aa23a9 GSubprocess test: Add PATH to the envtable that is passed to child
envp in spawn() functions is the *whole* environment table
for the child process. Including PATH. Thus, unless PATH is explicitly
put into that table, the process will be spawned without PATH.
Since on Windows binaries are found via PATH instead of LD_LIBRARY_PATH
or whatever, almost no program (unless installed in WINDIR, maybe)
can run without a PATH. Certainly not test programs - meson
adds bld subdirs to the PATH to make sure that test programs
use uninstalled glib at runtime.
So make sure that PATH is passed along.
2019-02-13 08:52:58 +00:00
Руслан Ижбулатов
01642d6db5 GSubprocess test: Use LINEEND more
Windows \r\n EOLs strike again. The test already knows about LINEEND,
so make it use LINEEND more (instead of swithcing pipes
to binary mode). This also applies to counting the bytes
read.
2019-02-13 08:52:58 +00:00
Руслан Ижбулатов
f150de2139 socket test: Bind Windows UDP sockets before calling recv()
Winsock can't recv() on unbound UDP sockets. Bind the socket
to loopback before trying to receive data on it.
2019-02-13 08:51:31 +00:00
Руслан Ижбулатов
1f5d7eeaa7 socket test: Adjust for Windows-specific sendto() error
With winsock sending messages to NULL results in G_IO_ERROR_NOT_CONNECTED
instead of G_IO_ERROR_FAILED.
MSDN says:
  WSAENOTCONN
  10057
  Socket is not connected.
  A request to send or receive data was disallowed because the socket is not connected
  and (when sending on a datagram socket using sendto) no address was supplied.
So this is a direct mapping of the implementation error.
Covering it up in the wrapper (by converting it to G_IO_ERROR_FAILED)
doesn't seem feasible or needed (no one, except for the testsuite,
really cares which unrecoverable error is returned by sendto()).
2019-02-13 08:51:31 +00:00
Руслан Ижбулатов
1e74b5872e GLib test: Adjust to follow the implementation
Canonicalization converts slashes to backslashes on Windows (most
of the time). This is a horrible design decision, but that's what
it does, and it's too late to change that. The test shouldn't expect
anything else.
2019-02-13 08:49:42 +00:00
Руслан Ижбулатов
3ffa7ed0b6 GDate test: Disable Julian epoch test on Windows
Windows uses FILETIME, which starts counting from 1st Jan of year 1601 and,
unlike time_t, can't be negative, so Windows simply has no way
to do timestamp-math for dates before then. SYSTEMTIME (an equivalent
of struct tm) can, obviously, represent almost arbitrary date starting
from 1st Jan of year 0 (it's unsigned...), but GetDateFormatW() converts it
to FILETIME at some point in its implementation, and fails.
Unless the whole strftime() implementation of GDate is replaced by
something that doesn't rely on WinAPI, this part of the test will
never pass.
2019-02-13 08:49:42 +00:00
Руслан Ижбулатов
00908bc446 network-address test: Disable scope ID tests on Windows
getaddrinfo() in winsock can't understand scope IDs.
There's no obvious way to fix that, short of re-implementing
that function, so disable that part of the test on Windows.
2019-02-13 08:49:42 +00:00
Руслан Ижбулатов
14aae264d4 autoptr test: Use OS-dependent path separator
Since GFile canonicalizes the path it is given, expect the '\\' separator
on Windows.
2019-02-13 08:49:42 +00:00
Руслан Ижбулатов
294d818336 Use OS-dependent separator for G_RESOURCE_OVERLAYS
G_RESOURCE_OVERLAYS is a list of resource-path and filesystem-path pairs.
Since on Windows filesystem paths use ':', this list can't be ':'-separated
there. Fix that by making it ';'-separated on Windows. Make the parser
error clearer (we're not looking for a slash, we're looking for an absolute
path).
2019-02-13 08:49:42 +00:00
Руслан Ижбулатов
ccbadcfb04 GWinHTTPVfs: use URI parser for parsing URIs
If a URI can't be handled by by WinHTTPVfs, it should pass that URI
along to the URI parser of the wrapped Vfs, not to its generic parser.
Theoretically, generic parser should also be able to handle URIs,
but this is subject to Vfs semantics.

In case of Windows, the wrapped Vfs is GLocalVfs, which is *local* and
treats any generic names as either file:// URIs or as filesystem
paths. It only ever treats URIs as URIs when they are passed
to its URI parser. This breaks the testsuite when g-icon GIO test passes
unhandleable sftp:// URI, and expects it to come through unmolested,
yet GLocalVfs, getting that URI as a generic parse name, treats it as
a filesystem path, and then "canonicalizes" it by prepending CWD.

Fix this by making WinHTTPVfs pass any URIs it gets to the URI parser
of the wrapped Vfs. This way unknown URIs remain URI-ish. This seems
like a reasonable things to do, since the URI parser should not be
given anything other than URIs, so there's no reason to try generic
parsing with these strings.

Closes: #875
2019-02-13 08:49:42 +00:00
Руслан Ижбулатов
fb37239b20 testsuite: use binary mode for stdout on Windows
It's much easier than adjusting the test logic to account for the extra \r.
2019-02-13 08:49:42 +00:00
Emin Tufan Çetin
16dc979d0e Update Turkish translation 2019-02-12 14:26:16 +00:00
Serdar Sağlam
8a5228b7ae Update Turkish translation 2019-02-12 14:20:41 +00:00
Philip Withnall
b841c9a7a7 Merge branch 'gstring-docs' into 'master'
gstring: fully document semantics of @len for g_string_insert_len

See merge request GNOME/glib!650
2019-02-12 12:01:46 +00:00
Michael Catanzaro
df5592f28d Merge branch 'wip/tingping/network-address-fixes' into 'master'
gnetworkaddress: Never end enumeration before resolving completes

Closes #1680

See merge request GNOME/glib!646
2019-02-11 14:22:05 +00:00
Daniel P. Berrangé
9a6ec14b3b gstring: fully document semantics of @len for g_string_insert_len
The g_string_insert_len method accepts '-1' for its len parameter,
as a shorthand for strlen(val). Likewise the various convenience
wrappers around it also accept -1. This was not documented, leaving
developers to wonder why len is a gssize, instead of gsize.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-11 14:08:40 +00:00
Patrick Griffis
085081ea2c gnetworkaddress: Never end enumeration before resolving completes
Previously once the end of addresses was reached it would return
NULL even if it was waiting on a dns response. Now it will keep
waiting so all addresses are received.

Fixes #1680
2019-02-11 08:59:33 -05:00
Patrick Griffis
c83291049e gnetworkaddress: Factor out initializing address list into function 2019-02-11 08:59:31 -05:00
Philip Withnall
6199d8ba9f Merge branch 'wip/rishi/gtask-return-cancellation-test' into 'master'
gio/tests/task: Run the worker indefinitely until it's cancelled

See merge request GNOME/glib!648
2019-02-11 12:42:38 +00:00
Debarshi Ray
e13b3a9ee5 gio/tests/task: Add comments documenting how the test works
https://gitlab.gnome.org/GNOME/glib/issues/1608
2019-02-11 12:30:23 +01:00