Commit Graph

4 Commits

Author SHA1 Message Date
Simon McVittie
e701578c6f Merge branch 'wip/smcv/assert-true-false' into 'master'
backport-testutils: Add g_assert_true(), g_assert_false()

See merge request GNOME/libglnx!44
2022-10-10 18:29:50 +00:00
Simon McVittie
416744a265 tests: Ensure saveptr is NULL before first call to strtok_r()
The standards-conformant behaviour is that the contents of saveptr
are ignored when the first argument is non-NULL, but the man page notes
that some older implementations required saveptr to be NULL in that
situation, and the gcc 4.8 provided by the Steam Runtime warns about this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-10 15:35:11 +01:00
Simon McVittie
a91959e0d4 backport-testutils: Add g_assert_true(), g_assert_false()
These were only added in 2.38, and some projects with particularly
ancient dependencies (like the Steam Runtime, based on a 2012 version
of Ubuntu) still avoid depending on that version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-10 15:27:56 +01:00
Simon McVittie
c52b73d4ae Backport most of the test convenience helpers from GLib's GTest
This includes a test (who tests the tests themselves?). Run
as `${build}/tests/testing --tap` with semi-modern GLib, or
`${build}/tests/testing --verbose` with GLib < 2.38, to check that the
output is as reasonable as possible given the limitations of the GLib
version in use.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-19 10:59:24 +01:00