Add test case for proper file name handling in mountpoint reader.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3394 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2010-09-06 16:26:40 +00:00
parent 1bfa7d2480
commit b645fdb2d3
1 changed files with 11 additions and 1 deletions

View File

@ -67,6 +67,7 @@ bool testArchive(IFileSystem* fs, const io::path& archiveName)
}
}
#if 0
// log what we got
io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1);
const io::IFileList* fileList = archive->getFileList();
@ -74,8 +75,10 @@ bool testArchive(IFileSystem* fs, const io::path& archiveName)
{
logTestString("File name: %s\n", fileList->getFileName(f).c_str());
logTestString("Full path: %s\n", fileList->getFullFileName(f).c_str());
logTestString("ID: %d\n", fileList->getID(f));
}
#endif
io::path filename("mypath/mypath/myfile.txt");
if (!fs->existFile(filename))
{
@ -103,6 +106,13 @@ bool testArchive(IFileSystem* fs, const io::path& archiveName)
return false;
}
if (fs->getFileBasename(readFile->getFileName()) != "test.txt")
{
logTestString("Wrong filename, file list seems to be corrupt\n");
while (fs->getFileArchiveCount())
fs->removeFileArchive(fs->getFileArchiveCount()-1);
return false;
}
char tmp[13] = {'\0'};
readFile->read(tmp, 12);
if (strncmp(tmp, "Hello world!", 12))