kunit: Introduce _NULL and _NOT_NULL macros
authorRicardo Ribalda <ribalda@chromium.org>
Fri, 11 Feb 2022 16:42:41 +0000 (17:42 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 4 Apr 2022 20:29:02 +0000 (14:29 -0600)
commitcaae9458db3aef14b96921cf02c6093340350c4a
tree94afb63d6b917218c3059b84f3f01bf376b72888
parentaa1c05558e71422564a664fc4cafbf5999f1de0f
kunit: Introduce _NULL and _NOT_NULL macros

Today, when we want to check if a pointer is NULL and not ERR we have
two options:

KUNIT_EXPECT_TRUE(test, ptr == NULL);

or

KUNIT_EXPECT_PTR_NE(test, ptr, (struct mystruct *)NULL);

Create a new set of macros that take care of NULL checks.

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Reviewed-by: Daniel Latypov <dlatypov@google.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
include/kunit/test.h