diff --git a/lib/checkinternal.cpp b/lib/checkinternal.cpp index 587591104..5945f86f0 100644 --- a/lib/checkinternal.cpp +++ b/lib/checkinternal.cpp @@ -105,7 +105,7 @@ void CheckInternal::checkRedundantTokCheck() void CheckInternal::checkRedundantTokCheckError(const Token* tok) { reportError(tok, Severity::style, "redundantTokCheck", - "Unneccessary check of \"" + (tok? tok->expressionString(): emptyString) + "\", match-function already checks if it is null."); + "Unnecessary check of \"" + (tok? tok->expressionString(): emptyString) + "\", match-function already checks if it is null."); } void CheckInternal::checkTokenSimpleMatchPatterns() diff --git a/test/testinternal.cpp b/test/testinternal.cpp index 2d7b52638..3f8e4fd93 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -416,35 +416,35 @@ private: " const Token *tok;\n" " if(tok && Token::findsimplematch(tok, \"foobar\")) {};\n" "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Unneccessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (style) Unnecessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); // findmatch check("void f() {\n" " const Token *tok;\n" " if(tok && Token::findmatch(tok, \"%str% foobar\")) {};\n" "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Unneccessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (style) Unnecessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); // Match check("void f() {\n" " const Token *tok;\n" " if(tok && Token::Match(tok, \"5str% foobar\")) {};\n" "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Unneccessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (style) Unnecessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); // simpleMatch check("void f() {\n" " const Token *tok;\n" " if(tok && Token::simpleMatch(tok, \"foobar\")) {};\n" "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Unneccessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (style) Unnecessary check of \"tok\", match-function already checks if it is null.\n", errout.str()); // Match check("void f() {\n" " const Token *tok;\n" " if(tok->previous() && Token::Match(tok->previous(), \"5str% foobar\")) {};\n" "}"); - ASSERT_EQUALS("[test.cpp:3]: (style) Unneccessary check of \"tok->previous()\", match-function already checks if it is null.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (style) Unnecessary check of \"tok->previous()\", match-function already checks if it is null.\n", errout.str()); // don't report: // tok->previous() vs tok