Show line number when suggesting std::transform (#1385)
This commit is contained in:
parent
eee6cf20ff
commit
d43cd56afd
|
@ -1998,7 +1998,7 @@ void CheckStl::useStlAlgorithm()
|
|||
algo = "std::copy";
|
||||
else
|
||||
algo = "std::transform";
|
||||
useStlAlgorithmError(assignTok, algo);
|
||||
useStlAlgorithmError(memberCallTok, algo);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -3321,7 +3321,7 @@ private:
|
|||
" c.push_back(x);\n"
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("(style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" std::vector<int> c;\n"
|
||||
|
@ -3329,7 +3329,7 @@ private:
|
|||
" c.push_back(f(x));\n"
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" std::vector<int> c;\n"
|
||||
|
@ -3337,7 +3337,7 @@ private:
|
|||
" c.push_back(x + 1);\n"
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" std::vector<int> c;\n"
|
||||
|
@ -3345,7 +3345,7 @@ private:
|
|||
" c.push_front(x);\n"
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("(style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" std::vector<int> c;\n"
|
||||
|
@ -3353,7 +3353,7 @@ private:
|
|||
" c.push_front(f(x));\n"
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" std::vector<int> c;\n"
|
||||
|
@ -3361,7 +3361,7 @@ private:
|
|||
" c.push_front(x + 1);\n"
|
||||
"}\n",
|
||||
true);
|
||||
ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" std::vector<int> c;\n"
|
||||
|
|
Loading…
Reference in New Issue