From 9e1fa959201611b764ac90ce59485d33b8ea975b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Mon, 5 Jun 2017 15:54:21 +0000 Subject: [PATCH] Add Coccinelle patch for replacing NULL/non-NULL tt_assert(). This patch replaces tt_assert() checks for NULL/non-NULL values with tt_ptr_op(). --- scripts/coccinelle/test_assert_null.cocci | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/coccinelle/test_assert_null.cocci diff --git a/scripts/coccinelle/test_assert_null.cocci b/scripts/coccinelle/test_assert_null.cocci new file mode 100644 index 000000000..3d66e1ee0 --- /dev/null +++ b/scripts/coccinelle/test_assert_null.cocci @@ -0,0 +1,11 @@ +@@ +expression * e; +@@ + +( +- tt_assert(e != NULL) ++ tt_ptr_op(e, OP_NE, NULL) +| +- tt_assert(e == NULL) ++ tt_ptr_op(e, OP_EQ, NULL) +)