From b0f686a00edd90341619ebcb758938b57bde67f0 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 15 Feb 2022 10:56:59 +0000 Subject: [PATCH] tests: Don't test invalid aligned allocations if avoiding UB We can't exercise precondition check failures if GLib was (inadvisably) compiled with -Dglib_checks=false, and we shouldn't necessarily exercise precondition check failures when using QA tools like valgrind, so skip these tests if run with -m no-undefined. Signed-off-by: Simon McVittie --- glib/tests/utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/glib/tests/utils.c b/glib/tests/utils.c index e712062f4..0b4782fcf 100644 --- a/glib/tests/utils.c +++ b/glib/tests/utils.c @@ -965,6 +965,7 @@ test_aligned_mem (void) g_assert_null (a); #define CHECK_SUBPROCESS_FAIL(name,msg) do { \ + if (g_test_undefined ()) \ { \ g_test_message (msg); \ g_test_trap_subprocess ("/utils/aligned-mem/subprocess/" #name, 0, 0); \