| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Adds a GString constructor that takes over ownership of an existing,
dynamically allocated, string.
|
| |
|
|
|
|
|
| |
This introduces no functional changes but allows `CAP_DAC_OVERRIDE` to
be used in a subsequent commit.
|
|\
| |
| |
| |
| |
| |
| | |
gkeyfile: Fix group comment management
Closes #104 and #2927
See merge request GNOME/glib!3380
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the `comment` member of the GKeyFileGroup structure, which
seemed intended to distinguish comments just above a group from comments
above them, separated by one or more blank lines. Indeed:
* This does not seem to match any specification in the documentation,
where blank lines and lines starting with `#` are indiscriminately
considered comments. In particular, no distinction is made between the
comment above the first group and the comment at the beginning of the
file.
* This distinction was only half implemented, resulting in confusion
between comment above a group and comment at the end of the preceding
group.
Instead, the same logic is used for groups as for keys: the comment
above a group is simply the sequence of key-value pairs of the preceding
group where the key is null, starting from the bottom.
The addition of a blank line above groups when writing, involved in
bugs #104 and #2927, is kept, but:
* It is now added as a comment as soon as the group is added (since a
blank line is considered a comment), so that
`g_key_file_get_comment()` returns the correct result right away.
* It is always added if comments are not kept.
* Otherwise it is only added if the group is newly created (not present
in the original data), in order to really keep comments (existing and
not existing).
Closes: #104, #2927
|
|\ \
| | |
| | |
| | |
| | | |
add g_timeout_add_seconds_once
See merge request GNOME/glib!3383
|
| | |
| | |
| | |
| | |
| | | |
Add a new call combing behaviors of g_timeout_add_seconds and
g_timeout_add_once.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This should hopefully stop the kernel spending a lot of memory and disk
bandwidth creating coredumps for them unnecessarily, which slows down
the rest of the tests and generally wastes resources.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2939
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is put together through git archaeology:
```
git log -- glib/tests/assert-msg-test.c tests/assert-msg-test.c
```
The following commits were too trivial to have meaningful copyright:
- 8e59d8602ca5921d78245f5d2b405b517a5e7cf9
- 44c004c84e9080040ff4e0e90b322dda0561cf85
- 207b8cb8a50d68e207d28b59e588311a5cbd9772
- a1bee97d4f093db01dee834bf3292eabd5b13d17
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #1415
|
|/ /
| |
| |
| | |
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|\ \
| | |
| | |
| | |
| | | |
gmain: Avoid some lock/unlock dance during g_main_context_iterate
See merge request GNOME/glib!3235
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This should fail and warn but not leaving the context acquired and
locked.
Add tests.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In non-perf mode, we were making only one thread to win the race to increase
the value, but since we're launching more threads anyways let's allow
more of them to have a chance to do something, to make the test more
valuable, even if it's still quick enough.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
meson: Add glib_valgrind_suppressions variable to glib pkg-config file
See merge request GNOME/glib!3361
|
| | | |
| | | |
| | | |
| | | | |
Ensure things are generated as we expect and avoid we regress on that.
|
|\ \ \ \
| |_|_|/
|/| | |
| | | |
| | | | |
gtimer: Avoid doing anything on g_usleep (0)
See merge request GNOME/glib!3381
|
| |/ /
| | |
| | |
| | |
| | | |
It's unlikely to happen, but still could be the case, so avoid do
anything.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
Work around an UCRT issue with _wspawn() functions taking an envp block
See merge request GNOME/glib!3289
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
g_utf8_normalize: don't read past the end of the buffer
See merge request GNOME/glib!3341
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add three classes of test case for which g_utf8_normalize() should
safely return NULL:
- Strings ending with a truncated multibyte character which would
extend past the NUL terminator
- Strings ending with a multibyte character which extends past the
length limit provided by the max_len argument
- Strings containing an invalid multibyte character in any position
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
tests: Re-enable mainloop test under AddressSanitizer
Closes #2307
See merge request GNOME/glib!3329
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is a partial revert of commit f378352051.
The leak of a `GMainLoop` which prompted it has been fixed by commit
4f5da8338127e25e5ebb54f5a4a95ffc2e40adcc in merge request !2535.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
See: #2598
Fixes: #2307
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
docs: Add simple GMarkup parser example
Closes #95
See merge request GNOME/glib!3364
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Based on an initial parser by Luc Pionchon. Tweaked to update to the
latest coding standards by Philip Withnall.
Fixes: #95
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
unicode: add tests for g_utf8_normalize() and empty strings
See merge request GNOME/glib!3326
|
| | | | | | |
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | | |
Test corner cases and some examples from Unicode Standard Annex #15
http://unicode.org/reports/tr15/
|
|\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | |
| | | | | |
tests: Update Unicode normalisation tests from Unicode 15
See merge request GNOME/glib!3351
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The file comes from
https://www.unicode.org/Public/UCD/latest/ucd/NormalizationTest.txt.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
build: Drop old .gitignore files from test directories
See merge request GNOME/glib!3333
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
They just listed built files. Since the move to Meson, these are all
kept in a separate build directory, not the source tree, so don’t need
to be ignored.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
This fixes some written-but-never-read warnings from `scan-build`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
tests: Reduce number of iterations in queue test
See merge request GNOME/glib!3324
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Remove an unnecessary intermediate variable.
This introduces no functional changes.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This introduces no functional changes.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Unless `-m thorough` is passed to the tests, reduce the number of
iterations in the random test.
This one test case takes the bulk of the time to run the `queue` test
suite, and is sometimes causing timeouts when running on CI
(particularly under valgrind). Reduce it to a fifth.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is put together through git archaeology:
```
git log glib/tests/queue.c
git log -- tests/queue-test.c
```
The following commits were too trivial to have meaningful copyright:
- 8f02fac4ad1e846f3075ae8b057b387e6365c0ca
- d81ac5339fcf9537a3731ebb5770238f4fa69d59
- 29f2ced8eb32d9001da8082c4530f017decb8267
- 1a2c5e155deacb7ebeb8d0ca2c800a97a90a7ab9
- 8a90f5e9f6da778743aaec365ee4ceb62b717130
- 45dae4b5063f9af7de8211ced95dd73cc770a86e
- 2aa71ab63b4457324c53700ab38ed83c3ccf7d5e
- 3a74ad128eb9a3431c54a88fa36269cb41e11c3e
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #1415
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
It won’t get compiled out with `G_DISABLE_ASSERT`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | | |
gstrfuncs: Improve inline version of g_strdup() to avoid breaking C++ code
Closes #2936
See merge request GNOME/glib!3322
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Wrap the logic into a G_ALWAYS_INLINE function, instead of using a
complex statement-expression which is not allowed in braced initializer
lists and expanded into some bad thing when it's used as
`::g_strdup(...)`.
We cannot use `__builtin_constant_p (str)` because GCC documentation
clearly states that it always produces 0 when str is a const char *
argument of an inline function. But `__builtin_constant_p (!str)`,
`__builtin_constant_p (!!str)`, and
`__builtin_constant_p (strlen (str))` functions properly with `-O1` or
above enabled.
Fixes #2936.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
tests: Change the time function used in the bookmark tests
See merge request GNOME/glib!3315
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The current comparison has been seen to fail on vs2017-x86
(https://gitlab.gnome.org/pwithnall/glib/-/jobs/2643197):
```
not ok /bookmarks/deprecated - GLib:ERROR:../glib/tests/bookmarkfile.c:921:test_deprecated: assertion failed (t >= now): (1678122080 >= 1678122081)
```
I guess this is caused by a mismatch between the system clock as used by
`time (NULL)` and `g_get_real_time ()` (which is ultimately what
`g_bookmark_file_set_added()` uses) on Windows.
Attempt to fix that by using `g_get_real_time()` in the test harness
too, so the clock being used is consistent.
If that doesn’t work, my next guess is that some of the code in
`test_deprecated()` is being reordered by the compiler. But that
shouldn’t happen, because the `time()` call has side-effects, and
`g_bookmark_file_set_added()` has side-effects, so they shouldn’t be
reordered with respect to each other. And certainly not so that the
latter one (in code order) ends up being called 1s after the other.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|/ /
| |
| |
| |
| | |
This fixes the build under cygwin which doesn't have RTLD_NEXT.
Use the existing have_rtld_next to skip the test program in that case.
|
| |
| |
| |
| |
| |
| |
| | |
Similar to commit 6e44151bf74d, skip the test if gdb is unable to read
/proc/PID/mem, which gdb does as a fallback if ptrace is unavailable.
This allows the test to skip when run under Gentoo's sandbox.
|
| |
| |
| |
| |
| |
| |
| | |
Running the test under asan was failing as the threads were being
leaked.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|\ \
| | |
| | |
| | |
| | | |
tests: Add a -Wsign-conversion test for gstring.h
See merge request GNOME/glib!3275
|
| | |
| | |
| | |
| | |
| | |
| | | |
It won’t get compiled out with `G_DISABLE_ASSERT`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
While it’s not possible to build GLib with `-Wsign-conversion` enabled
(there are too many warnings), it would be useful to check that GLib’s
public headers can be used with `-Wsign-conversion` enabled, as some
projects want to do that. For example, dnf5 is built that way (see
issue #2919).
Add a simple regression test for this, by re-building the `gstring`
tests with `-Wsign-conversion` enabled. Since they include `glib.h`,
this will test all the public libglib headers by proxy.
Since this is a compile-only test, it doesn’t need to be installed.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2919
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This will be useful for the next commit.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2919
|