提交 de82c15d 编写于 作者: R Ricardo Ribalda 提交者: Shuah Khan

kunit: use NULL macros

Replace the NULL checks with the more specific and idiomatic NULL macros.
Reviewed-by: NBrendan Higgins <brendanhiggins@google.com>
Reviewed-by: NDaniel Latypov <dlatypov@google.com>
Signed-off-by: NRicardo Ribalda <ribalda@chromium.org>
Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
上级 caae9458
...@@ -91,6 +91,8 @@ static void example_all_expect_macros_test(struct kunit *test) ...@@ -91,6 +91,8 @@ static void example_all_expect_macros_test(struct kunit *test)
KUNIT_EXPECT_NOT_ERR_OR_NULL(test, test); KUNIT_EXPECT_NOT_ERR_OR_NULL(test, test);
KUNIT_EXPECT_PTR_EQ(test, NULL, NULL); KUNIT_EXPECT_PTR_EQ(test, NULL, NULL);
KUNIT_EXPECT_PTR_NE(test, test, NULL); KUNIT_EXPECT_PTR_NE(test, test, NULL);
KUNIT_EXPECT_NULL(test, NULL);
KUNIT_EXPECT_NOT_NULL(test, test);
/* String assertions */ /* String assertions */
KUNIT_EXPECT_STREQ(test, "hi", "hi"); KUNIT_EXPECT_STREQ(test, "hi", "hi");
......
...@@ -435,7 +435,7 @@ static void kunit_log_test(struct kunit *test) ...@@ -435,7 +435,7 @@ static void kunit_log_test(struct kunit *test)
KUNIT_EXPECT_NOT_ERR_OR_NULL(test, KUNIT_EXPECT_NOT_ERR_OR_NULL(test,
strstr(suite.log, "along with this.")); strstr(suite.log, "along with this."));
#else #else
KUNIT_EXPECT_PTR_EQ(test, test->log, (char *)NULL); KUNIT_EXPECT_NULL(test, test->log);
#endif #endif
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册