Skip to content

Commit 19f5fc9

Browse files
committed
Move FilesDeleter to testcppcheck.cpp
1 parent a14717c commit 19f5fc9

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

test/helpers.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,6 @@ class ScopedFile {
166166
const std::string mFullPath;
167167
};
168168

169-
namespace {
170-
class FilesDeleter {
171-
public:
172-
FilesDeleter() = default;
173-
~FilesDeleter() {
174-
for (const std::string& fileName: mFilenames)
175-
std::remove(fileName.c_str());
176-
}
177-
void addFile(const std::string& fileName) {
178-
mFilenames.push_back(fileName);
179-
}
180-
private:
181-
std::vector<std::string> mFilenames;
182-
};
183-
}
184-
185169
namespace cppcheck {
186170
template<typename T>
187171
std::size_t count_all_of(const std::string& str, T sub) {

test/testcppcheck.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@
4343

4444
#include <simplecpp.h>
4545

46+
namespace {
47+
class FilesDeleter {
48+
public:
49+
FilesDeleter() = default;
50+
~FilesDeleter() {
51+
for (const std::string& fileName: mFilenames)
52+
std::remove(fileName.c_str());
53+
}
54+
void addFile(const std::string& fileName) {
55+
mFilenames.push_back(fileName);
56+
}
57+
private:
58+
std::vector<std::string> mFilenames;
59+
};
60+
}
61+
4662
class TestCppcheck : public TestFixture {
4763
public:
4864
TestCppcheck() : TestFixture("TestCppcheck") {}

0 commit comments

Comments
 (0)