From 63523316a22404e9af360662d6b2086491d2c906 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Tue, 29 Sep 2009 16:38:05 +0300 Subject: [PATCH] Check nullpointer check is now executed without --style flag Added TODO test case for nullpointer check --- src/checkother.h | 2 +- test/testother.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/checkother.h b/src/checkother.h index b779fa38f..6f9cd9e9b 100644 --- a/src/checkother.h +++ b/src/checkother.h @@ -47,12 +47,12 @@ public: { CheckOther checkOther(tokenizer, settings, errorLogger); + checkOther.nullPointer(); if (settings->_checkCodingStyle) { checkOther.warningOldStylePointerCast(); checkOther.checkUnsignedDivision(); checkOther.checkCharVariable(); - checkOther.nullPointer(); } } diff --git a/test/testother.cpp b/test/testother.cpp index 82c0b1511..92023d475 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -774,6 +774,15 @@ private: "}\n"); ASSERT_EQUALS("", errout.str()); + checkNullPointer("void foo(P *p)\n" + "{\n" + " while (p)\n" + " if (p->check())\n" + " break;\n" + " else\n" + " p = p->next();\n" + "}\n"); + TODO_ASSERT_EQUALS("", errout.str()); }