Skip to content
  • Michael Forney's avatar
    litest: Fix warnings about discarded qualifiers with check-0.13.0 · 25a940a5
    Michael Forney authored
    
    
    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: default avatarMichael Forney <mforney@mforney.org>
    25a940a5