Fix test compilation. Add check for decryption support being enabled. Add meaningful message if trying to load an encrypted file without decryption support.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2987 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
def8fc60a0
commit
6ffcba6836
|
@ -655,6 +655,10 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
|
||||||
return 0; // zlib not compiled, we cannot decompress the data.
|
return 0; // zlib not compiled, we cannot decompress the data.
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
case 99:
|
||||||
|
// If we come here with an encrypted file, decryption support is missing
|
||||||
|
os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR);
|
||||||
|
return 0;
|
||||||
default:
|
default:
|
||||||
swprintf ( buf, 64, L"file has unsupported compression method. %s", Files[index].FullName.c_str() );
|
swprintf ( buf, 64, L"file has unsupported compression method. %s", Files[index].FullName.c_str() );
|
||||||
os::Printer::log( buf, ELL_ERROR);
|
os::Printer::log( buf, ELL_ERROR);
|
||||||
|
|
|
@ -152,6 +152,7 @@ bool testEncryptedZip(IFileSystem* fs)
|
||||||
|
|
||||||
archive->Password="33445";
|
archive->Password="33445";
|
||||||
readFile = fs->createAndOpenFile(filename);
|
readFile = fs->createAndOpenFile(filename);
|
||||||
|
#ifdef _IRR_COMPILE_WITH_ZIP_ENCRYPTION_
|
||||||
if ( !readFile )
|
if ( !readFile )
|
||||||
{
|
{
|
||||||
logTestString("createAndOpenFile failed\n");
|
logTestString("createAndOpenFile failed\n");
|
||||||
|
@ -165,6 +166,7 @@ bool testEncryptedZip(IFileSystem* fs)
|
||||||
logTestString("Read bad data from archive: %s\n", tmp);
|
logTestString("Read bad data from archive: %s\n", tmp);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!fs->removeFileArchive(fs->getFileArchiveCount()-1))
|
if (!fs->removeFileArchive(fs->getFileArchiveCount()-1))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
Test suite pass at GMT Fri Dec 4 18:41:12 2009
|
Test suite pass at GMT Sat Dec 05 11:03:29 2009
|
||||||
|
|
||||||
|
|
|
@ -286,6 +286,10 @@
|
||||||
RelativePath=".\terrainSceneNode.cpp"
|
RelativePath=".\terrainSceneNode.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\testArray.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\testDimension2d.cpp"
|
RelativePath=".\testDimension2d.cpp"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue