Fix some problems with g_aligned_alloc() tests

Simon McVittie requested to merge wip/smcv/aligned-alloc-tests into main
  • tests: Don't assume that all platforms are 64-bit

    On ILP32 platforms, 4 is a valid alignment for g_aligned_alloc(), so use 2 as our invalid alignment instead.

  • tests: Make g_aligned_alloc tests fail if preconditions aren't checked

    Previously, these tests would always pass. If the precondition check failed (as we want it to), the subprocess would exit unsuccessfully; but if the precondition check wrongly passed, the subprocess would continue, allocate a nonzero amount of memory, and fail the g_assert_null(), resulting in the subprocess exiting unsuccessfully and the test still passing.

  • 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.

/cc @ebassi @pwithnall

Merge request reports