Commit Graph

19567 Commits

Author SHA1 Message Date
Philip Withnall
d289ef449b tests: Port various tests to use g_assert_cmpvariant()
This should improve test error reporting a little.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-14 15:04:11 +00:00
Silvio Lazzeretti
ac0706aad0 added stream writability checks in pollable unit test
This checks if the stream is writable before writing
to it. If the write succeeded with no error, then the
stream has to be also writable after the write
2018-12-13 11:10:06 +01:00
Philip Withnall
27369def50 Merge branch 'mkenums' into 'master'
tests: Minor improvements to mkenums.py and taptestrunner.py used by it

See merge request GNOME/glib!530
2018-12-13 09:13:08 +00:00
Ondrej Holy
0f508c7b89 Merge branch '1599-follow-up-from-gunixmounts-stop-considering-cifs-nfs-as-system-file-systems'
Merging this manually because the CI is still broken.

https://gitlab.gnome.org/GNOME/glib/merge_requests/494
2018-12-13 09:36:11 +01:00
Michael Catanzaro
99d7894d48 Merge branch 'wip/tingping/happy-eyeballs'
Merging this manually because the CI is broken.

Fixes https://gitlab.gnome.org/GNOME/glib/merge_requests/421
2018-12-12 17:09:16 -06:00
Tomasz Miąsko
6b0ad94fb4 tests: s/assertEquals/assertEqual/
Assert assertEquals is deprecated alias of assertEqual.
2018-12-12 12:57:51 +01:00
Tomasz Miąsko
c69a98057f tests: Avoid writing ever increasing sequence of null bytes to test logs 2018-12-12 12:57:51 +01:00
Tomasz Miąsko
3b7f7a4ed9 tests: Drop compatibility with python 2 from TAP test runner 2018-12-12 12:57:51 +01:00
Philip Withnall
8a2fa212e7 docs: Format operators nicely in gtestutils documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-12 11:27:32 +00:00
Philip Withnall
ee364db967 gtestutils: Add g_assert_cmpvariant()
This is along the same lines as g_assert_cmpstr(), but for variants.

Based on a patch by Guillaume Desmottes.

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

https://gitlab.gnome.org/GNOME/glib/issues/1191
2018-12-12 11:27:25 +00:00
Patrick Griffis
4c472f8e3f gsocketaddressenumerator: Make it an error to call next_async before finish
It logically doesn't make sense to repeatedly call next_async()
before the previous one has finished.
2018-12-11 16:12:51 -05:00
Patrick Griffis
8b9e88937b tests: Add gsocketclient test for slow connections 2018-12-11 16:12:48 -05:00
Patrick Griffis
4b29e55097 gnetworkaddress: Interleave ipv4 and ipv6 addresses 2018-12-11 16:12:34 -05:00
Patrick Griffis
c1e32b9057 gsocketclient: Improve handling of slow initial connections
Currently a new connection will not be attempted until the previous
one has timed out and as the current API only exposes a single
timeout value in practice it often means that it will wait 30 seconds
(or forever with 0 (the default)) on each connection.

This is unacceptable so we are now trying to follow the behavior
RFC 8305 recommends by making multiple connection attempts if
the connection takes longer than 250ms. The first connection
to make it to completion then wins.
2018-12-11 16:09:29 -05:00
Patrick Griffis
35e41862c2 gnetworkaddress: Implement parallel ipv4 and ipv6 dns lookups
As RFC 8305 recommends we can start multiple DNS queries in parallel
to more quickly make an initial response, especially when one is
particularly slow/broken.
2018-12-11 16:09:29 -05:00
Patrick Griffis
d6afa6c988 gresolver: Add g_resolver_lookup_by_name_with_flags{_async,_finish,}
This allows higher levels to have more control over resolving
(ipv4 or ipv6 for now) which allows for optimizations such
as requesting both in parallel as RFC 8305 recommends.
2018-12-11 16:09:29 -05:00
Philip Withnall
af39a37312 Merge branch 'fix-gdbus-codegen--interface-info' into 'master'
fix gdbus-codegen --interface-info-{header,body}

See merge request GNOME/glib!514
2018-12-11 12:25:31 +00:00
Will Thompson
335a01ebe4
gdbus-codegen: test --interface-info-{header,body}
This test is rudimentary but better than nothing.
2018-12-11 09:49:22 +00:00
Will Thompson
d946bff480
gdbus-codegen: sort input files
This means the output (including lists of filenames) does not depend on
the order of the input files, which may matter if this tool is invoked
with a glob or some other mechanism that doesn't guarantee an order.
2018-12-11 09:49:22 +00:00
Xavier Claessens
bdc9328bdf Merge branch 'meson-dep' into 'master'
Meson: Fix declare_dependency() calls

See merge request GNOME/glib!518
2018-12-10 22:39:32 +00:00
Xavier Claessens
3fadcf9ffa Merge branch 'meson-pkgconfig' into 'master'
Meson: Fix deprecation warning with upcoming 0.49.0 release

See merge request GNOME/glib!517
2018-12-10 20:19:38 +00:00
Philip Withnall
1c8bbab127 Merge branch 'gdatetime-typo' into 'master'
gdatetime: Fix typo in the comment

See merge request GNOME/glib!524
2018-12-10 17:55:35 +00:00
Tomasz Miąsko
db47ab8402 gdatetime: Fix typo in the comment
Follow up on https://gitlab.gnome.org/GNOME/glib/merge_requests/506#note_382186.
2018-12-10 17:54:27 +01:00
Xavier Claessens
475f0a9b67 Meson: Fix deprecation warning with 0.49.0 release
http://mesonbuild.com/Release-notes-for-0-49-0.html#deprecation-warning-in-pkgconfig-generator
2018-12-10 09:08:28 -05:00
Xavier Claessens
afd3f3beda Meson: Fix declare_dependency() calls
Turns out the fix in commit 93555577c wasn't enough, when using glib as
subproject and the parent project uses only libgio_dep, and include
<gi18n.h>, it won't find libintl.h because it's in the
include_directories of libglib_dep. Fix that by declaring dependencies
explicitly, which is the right thing to do since glib and gobject are
public dependencies of gio. That reflects what we do for the pkg-config
file as well.
2018-12-10 09:06:17 -05:00
Philip Withnall
fa80a2d133 Merge branch 'resources.msvc' into 'master'
glib-compile-resources: Fix code generation for MSVC builds (issue #1580)

Closes #1580

See merge request GNOME/glib!503
2018-12-10 12:06:41 +00:00
Philip Withnall
b1f16259fc Merge branch 'issue-1605' into 'master'
gdatetime: Store intermediate result of g_date_time_format in UTF-8

Closes #1605

See merge request GNOME/glib!506
2018-12-10 12:03:17 +00:00
Philip Withnall
af77e47e93 Merge branch 'encoding-prefix' into 'master'
tests: Rename macro to avoid conflict with encoding prefix

See merge request GNOME/glib!521
2018-12-10 11:43:37 +00:00
Tomasz Miąsko
e32342897a tests: Rename macro to avoid conflict with encoding prefix
Use macro name that doesn't conflict with string literal encoding prefix `U`.

```
../glib/tests/fileutils.c(282): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(284): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(285): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(286): warning C4133: 'function': incompatible types - from 'unsigned int [2]' to 'const gchar *'
../glib/tests/fileutils.c(287): warning C4133: 'function': incompatible types - from 'unsigned int [3]' to 'const gchar *'
...
```
2018-12-09 15:10:43 +01:00
Matej Urbančič
e8fb8322ce Updated Slovenian translation 2018-12-08 21:59:20 +01:00
Will Thompson
deafd7256e
gdbus-codegen: don't sort args in --interface-info-body
Previously, method and signal arguments were sorted by name, which
(assuming you don't happen to give your arguments
lexicographically-ordered names) means the generated signatures were
incorrect when there is more than 1 argument.

While sorting the methods and signals themselves (and properties, and
annotations on all these) is fine, it's easiest to not sort anything.
2018-12-06 21:39:27 +00:00
Will Thompson
faa3c319ba
gdbus-codegen: make --interface-info-{header,body} not crash
Since 1217b1bc4f, LICENSE_STR has taken two
parameters, not one. Without this change, running either mode fails
with a traceback like:

    Traceback (most recent call last):
      File "../gdbus-codegen", line 55, in <module>
        sys.exit(codegen_main.codegen_main())
      File ".../codegen_main.py", line 294, in codegen_main
        gen.generate()
      File ".../codegen.py", line 896, in generate
        self.generate_body_preamble()
      File ".../codegen.py", line 682, in generate_body_preamble
        self.outfile.write(LICENSE_STR.format(config.VERSION))
    IndexError: tuple index out of range

8916874ee6, which introduced these flags,
was actually merged after that commit, but I assume it was written
beforehand.
2018-12-06 21:39:17 +00:00
Philip Withnall
3469faf15c Merge branch 'ossfuzz-11576-variant-text-unicode-unescape' into 'master'
gvariant: Fix error handling for parsing Unicode escapes

See merge request GNOME/glib!511
2018-12-06 11:15:24 +00:00
Philip Withnall
21adb30a83 gtype: Clarify type of GInterfaceInitFunc
When passing a function to G_IMPLEMENT_INTERFACE, it actually has to
take two arguments. Who knew?

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-05 14:09:35 +00:00
Chun-wei Fan
cd30faae1f gresources: Add a test with resources > 64kb
This is to ensure that the generated code is still compilable by the
running compiler, and see whether we can read the things in there
properly.

See issue #1580.
2018-12-05 18:27:16 +08:00
Chun-wei Fan
6528887534 README.win32: Update workarounds for VS 2008 x64 builds
We need to also update build.ninja after configuration so that builds
don't get stuck on gio/tests/gsubprocess-testprog.c.
2018-12-05 18:10:40 +08:00
Chun-wei Fan
4501807d73 glib-compile-resources: Fix code generation for MSVC builds
glib-compile-resources was updated to generate octal byte
representation in a string, but unfortunately this breaks the build
on Visual Studio when the generated string sequence exceeds 65535
characters, which is the imposed limit on Visual Studio compilers.

To make things work on Visual Studio builds and to not slow down things
on other compilers, generate a code path for Visual Studio an array of
octal byte representations, as well as a code path for other compilers
that use the new string representation of octal values, and let the
compiler take the appropriate code path when compiling the
generated code.

Fixes issue #1580.
2018-12-05 16:17:24 +08:00
Philip Withnall
1ba843b8a0 Merge branch 'master' into 'master'
Add new Linux Testing project version number to configure script

See merge request GNOME/glib!510
2018-12-04 18:15:12 +00:00
Daniel Mustieles
fe13a528d5 Updated Spanish translation 2018-12-04 16:49:15 +01:00
Philip Withnall
d2224b475d gvariant: Fix error handling for parsing Unicode escapes
When parsing an escaped Unicode character in a text format GVariant
string, such as '\U0001F415', the code uses g_ascii_strtoull(). This,
unexpectedly, accepts minus signs, which can cause an assertion failure
when input like '\u-FF4' is presented for parsing.

Validate that there are no leading sign characters when parsing.

This shouldn’t be considered a security bug, because the GVariant text
format parser should not be used on untrusted input.

oss-fuzz#11576

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-04 12:55:21 +00:00
Philip Withnall
ca328615c8 gvariant: Use gsize rather than gint for array lengths
This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-04 12:54:39 +00:00
Philip Withnall
96acb49eb1 gstrfuncs: Clarify that g_ascii_string_to_unsigned() rejects signs
Unlike g_ascii_strtoull(), g_ascii_string_to_unsigned() does not permit
leading signs (`+` or `-`). Document that.

It’s already in the unit tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-04 12:53:52 +00:00
Philip Withnall
8d0a163000 gstrfuncs: Clarify that g_ascii_strtoull() accepts signed numbers
It’s perverse, but explicitly documented that strtoull() accepts numbers
with a leading minus sign (`-`) and explicitly casts them to signed
output.

g_ascii_strtoull() is documented to do what strtoull() does (but locale
independently), and its behaviour is correct. However, the documentation
could be a lot clearer about this unexpected behaviour.

Add a unit test for it too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-12-04 12:51:09 +00:00
Tomasz Miąsko
8bfa45817e gdatetime: Avoid unnecessary conversions from ASCII to UTF-8 2018-12-04 13:34:33 +01:00
Tomasz Miąsko
bc59892b1a gdatetime: Store intermediate result of g_date_time_format in UTF-8
In date time formatting routine, instead of converting from UTF-8 to
locale charset and then from locale charset to UTF-8, store all
intermediate result in UTF-8.

This solves the issue where user provided UTF-8 format string might be
unrepresentable in the current locale charset.

Fixes issue #1605.
2018-12-04 13:34:18 +01:00
Nirbheek Chauhan
23ed6f4a50 Merge branch 'glib-mkenums-rspfile-support' into 'master'
glib-mkenums: Support reading @rspfiles for arguments

See merge request GNOME/glib!489
2018-12-04 10:58:23 +00:00
Nirbheek Chauhan
17316b2c16 glib-mkenums: Support reading @rspfiles for arguments
This is needed on Windows where the argument list can exceed the
maximum command-line length when lots of sources are passed to
glib-mkenums.
2018-12-04 16:16:00 +05:30
Emmanuel Fleury
ea3d9fbc69 Add new Linux Testing project version number to configure script 2018-12-04 10:48:24 +01:00
Philip Withnall
d4cc0b32fd Merge branch 'ci-locales' into 'master'
ci: Install additional locales used during tests

See merge request GNOME/glib!508
2018-12-03 13:50:05 +00:00
Tomasz Miąsko
ee9f5c5717 ci: Update docker image to master:v11 2018-12-03 14:11:30 +01:00