Skip to content

litest: Fix warnings about discarded qualifiers with check-0.13.0

Michael Forney requested to merge mforney/libinput:litest-warnings into master

check 0.13.0 introduced a new struct type TTest for test functions instead of just a function. However, now the tcase_add_* functions use const Ttest *, and since litest stores the test case in a void *, we get warnings like the following:

../test/test-touchpad.c:7079:30: warning: passing argument 3 of '_litest_add' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] litest_add("touchpad:fuzz", touchpad_fuzz, LITEST_TOUCHPAD, LITEST_ANY);

To fix this, use const void *, which is compatible with both APIs.

Signed-off-by: Michael Forney mforney@mforney.org

Merge request reports