Internal checking is now enabled by the macro CHECK_INTERNAL

This commit is contained in:
PKEuS 2014-05-18 19:48:43 +02:00
parent e713ad45cb
commit 9cb544241d
4 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef NDEBUG #ifdef CHECK_INTERNAL
#include "checkinternal.h" #include "checkinternal.h"
#include "symboldatabase.h" #include "symboldatabase.h"
@ -315,4 +315,4 @@ void CheckInternal::redundantNextPreviousError(const Token* tok, const std::stri
"Call to 'Token::" + func1 + "()' followed by 'Token::" + func2 + "()' can be simplified."); "Call to 'Token::" + func1 + "()' followed by 'Token::" + func2 + "()' can be simplified.");
} }
#endif // #ifndef NDEBUG #endif // #ifdef CHECK_INTERNAL

View File

@ -84,7 +84,7 @@ std::string Settings::addEnabled(const std::string &str)
id.insert("information"); id.insert("information");
id.insert("missingInclude"); id.insert("missingInclude");
id.insert("unusedFunction"); id.insert("unusedFunction");
#ifndef NDEBUG #ifdef CHECK_INTERNAL
id.insert("internal"); id.insert("internal");
#endif #endif
} }

View File

@ -71,7 +71,7 @@ private:
TEST_CASE(enabledPortability); TEST_CASE(enabledPortability);
TEST_CASE(enabledUnusedFunction); TEST_CASE(enabledUnusedFunction);
TEST_CASE(enabledMissingInclude); TEST_CASE(enabledMissingInclude);
#ifndef NDEBUG #ifdef CHECK_INTERNAL
TEST_CASE(enabledInternal); TEST_CASE(enabledInternal);
#endif #endif
TEST_CASE(enabledMultiple); TEST_CASE(enabledMultiple);
@ -516,7 +516,7 @@ private:
ASSERT(settings.isEnabled("missingInclude")); ASSERT(settings.isEnabled("missingInclude"));
} }
#ifndef NDEBUG #ifdef CHECK_INTERNAL
void enabledInternal() { void enabledInternal() {
REDIRECT; REDIRECT;
const char *argv[] = {"cppcheck", "--enable=internal", "file.cpp"}; const char *argv[] = {"cppcheck", "--enable=internal", "file.cpp"};

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef NDEBUG #ifdef CHECK_INTERNAL
#include "tokenize.h" #include "tokenize.h"
#include "checkinternal.h" #include "checkinternal.h"
@ -340,4 +340,4 @@ private:
REGISTER_TEST(TestInternal) REGISTER_TEST(TestInternal)
#endif // #ifndef NDEBUG #endif // #ifdef CHECK_INTERNAL