Fixed TestFileLister tests in windows

This commit is contained in:
Daniel Marjamaki 2011-04-07 17:49:18 +02:00
parent 6f7e9a67b0
commit 8601c64d99
1 changed files with 13 additions and 5 deletions

View File

@ -53,18 +53,26 @@ private:
// Recursively add add files..
std::vector<std::string> filenames;
FileLister::recursiveAddFiles(filenames, ".");
// In case there are leading "./"..
for (unsigned int i = 0; i < filenames.size(); ++i) {
if (filenames[i].compare(0,2,"./") == 0)
filenames[i].erase(0,2);
}
/*
for (unsigned int i = 0; i < filenames.size(); ++i)
std::cout << filenames[i] << std::endl;
*/
// Make sure source files are added..
ASSERT(std::find(filenames.begin(), filenames.end(), "./cli/main.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "./lib/token.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "./lib/tokenize.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "./test/testfilelister.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "cli/main.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "lib/token.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "lib/tokenize.cpp") != filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "test/testfilelister.cpp") != filenames.end());
// Make sure headers are not added..
ASSERT(std::find(filenames.begin(), filenames.end(), "./lib/tokenize.h") == filenames.end());
ASSERT(std::find(filenames.begin(), filenames.end(), "lib/tokenize.h") == filenames.end());
}
};