Skip to content

Commit e63b3cc

Browse files
committed
testcppcheck.cpp: fixed unusedPrivateFunction selfcheck warning (it shadowed a base member variable)
1 parent 7a98a7f commit e63b3cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/testcppcheck.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class TestCppcheck : public TestFixture {
122122
ASSERT(foundMissingIncludeSystem);
123123
}
124124

125-
static std::string exename(const std::string& exe)
125+
static std::string exename_(const std::string& exe)
126126
{
127127
#ifdef _WIN32
128128
return exe + ".exe";
@@ -137,7 +137,7 @@ class TestCppcheck : public TestFixture {
137137
// NOLINTNEXTLINE(performance-unnecessary-value-param) - used as callback so we need to preserve the signature
138138
return [&](std::string exe, std::vector<std::string> args, std::string redirect, std::string& /*output*/) -> int {
139139
++called;
140-
if (exe == exename("clang-tidy"))
140+
if (exe == exename_("clang-tidy"))
141141
{
142142
ASSERT_EQUALS(4, args.size());
143143
ASSERT_EQUALS("-quiet", args[0]);
@@ -147,14 +147,14 @@ class TestCppcheck : public TestFixture {
147147
ASSERT_EQUALS("2>&1", redirect);
148148
return EXIT_SUCCESS;
149149
}
150-
if (exe == exename("python3"))
150+
if (exe == exename_("python3"))
151151
{
152152
ASSERT_EQUALS(1, args.size());
153153
ASSERT_EQUALS("--version", args[0]);
154154
ASSERT_EQUALS("2>&1", redirect);
155155
return EXIT_SUCCESS;
156156
}
157-
if (exe == exename("python"))
157+
if (exe == exename_("python"))
158158
{
159159
ASSERT_EQUALS(1, args.size());
160160
ASSERT_EQUALS("--version", args[0]);
@@ -218,7 +218,7 @@ class TestCppcheck : public TestFixture {
218218

219219
// TODO: clang-tidy is currently not invoked for file inputs - see #12053
220220
// TODO: needs to become a proper error
221-
TODO_ASSERT_EQUALS("Failed to execute '" + exename("clang-tidy") + "' (no command callback provided)\n", "", GET_REDIRECT_ERROUT);
221+
TODO_ASSERT_EQUALS("Failed to execute '" + exename_("clang-tidy") + "' (no command callback provided)\n", "", GET_REDIRECT_ERROUT);
222222

223223
ASSERT_EQUALS(0, called); // not called because we check if the callback exists
224224
}
@@ -303,7 +303,7 @@ class TestCppcheck : public TestFixture {
303303
ASSERT_EQUALS("Bailing out from analysis: Checking file failed: Failed to execute addon - no command callback provided", it->shortMessage()); // TODO: add addon name
304304

305305
// TODO: needs to become a proper error
306-
ASSERT_EQUALS("Failed to execute '" + exename("clang-tidy") + "' (no command callback provided)\n", GET_REDIRECT_ERROUT);
306+
ASSERT_EQUALS("Failed to execute '" + exename_("clang-tidy") + "' (no command callback provided)\n", GET_REDIRECT_ERROUT);
307307

308308
ASSERT_EQUALS(0, called); // not called because we check if the callback exists
309309
}

0 commit comments

Comments
 (0)