kunit: rename base KUNIT_ASSERTION macro to _KUNIT_FAILED
authorDaniel Latypov <dlatypov@google.com>
Sat, 1 Oct 2022 00:26:36 +0000 (17:26 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 7 Oct 2022 16:16:45 +0000 (10:16 -0600)
commit97d453bc4007d4ac148c2ba89904026612b91ec9
treed7a7588997ea4067d6fe13125637177493c7533f
parenta8495ad8e973cb6aabbe855d3dfb66ec4c9b281a
kunit: rename base KUNIT_ASSERTION macro to _KUNIT_FAILED

Context:
Currently this macro's name, KUNIT_ASSERTION conflicts with the name of
an enum whose values are {KUNIT_EXPECTATION, KUNIT_ASSERTION}.

It's hard to think of a better name for the enum, so rename this macro.
It's also a bit strange that the macro might do nothing depending on the
boolean argument `pass`. Why not have callers check themselves?

This patch:
Moves the pass/fail checking into the callers of KUNIT_ASSERTION, so now
we only call it when the check has failed.
Then we rename the macro the _KUNIT_FAILED() to reflect the new
semantics.

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/test.h