MCPcopy Create free account
hub / github.com/cpputest/cpputest / FileSystemForJUnitTestOutputTests

Class FileSystemForJUnitTestOutputTests

tests/CppUTest/JUnitOutputTest.cpp:92–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90};
91
92class FileSystemForJUnitTestOutputTests
93{
94 FileForJUnitOutputTests* firstFile_;
95
96public:
97 FileSystemForJUnitTestOutputTests() : firstFile_(NULLPTR) {}
98 ~FileSystemForJUnitTestOutputTests() { clear(); }
99
100 void clear(void)
101 {
102 while (firstFile_) {
103 FileForJUnitOutputTests* fileToBeDeleted = firstFile_;
104 firstFile_ = firstFile_->nextFile();
105 delete fileToBeDeleted;
106 }
107 }
108
109 FileForJUnitOutputTests* openFile(const SimpleString& filename)
110 {
111 firstFile_ = new FileForJUnitOutputTests(filename, firstFile_);
112 return firstFile_;
113 }
114
115 int amountOfFiles() {
116 int totalAmountOfFiles = 0;
117 for (FileForJUnitOutputTests* current = firstFile_; current != NULLPTR; current = current->nextFile())
118 totalAmountOfFiles++;
119 return totalAmountOfFiles;
120 }
121
122 bool fileExists(const char* filename)
123 {
124 FileForJUnitOutputTests *searchedFile = file(filename);
125 return (searchedFile != NULLPTR);
126 }
127
128 FileForJUnitOutputTests* file(const char* filename)
129 {
130 for (FileForJUnitOutputTests* current = firstFile_; current != NULLPTR; current = current->nextFile())
131 if (current->name() == filename)
132 return current;
133 return NULLPTR;
134 }
135};
136
137extern "C" {
138 static long millisTime = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected