diff options
author | Ladislav Zezula <ladislav.zezula@avg.com> | 2014-03-18 10:53:53 +0100 |
---|---|---|
committer | Ladislav Zezula <ladislav.zezula@avg.com> | 2014-03-18 10:53:53 +0100 |
commit | c8db90a9c4dcf30b626861bfe6efeec818a78719 (patch) | |
tree | 85a9c617fa153184a5a92da1a14aa475feced408 | |
parent | 568f189ea5a850a9259c8c89ba5f28a0630a2ce0 (diff) |
+ Size check for (attributes) is only performed in StormLib testprogram
-rw-r--r-- | src/SFileAttributes.cpp | 5 | ||||
-rw-r--r-- | test/Test.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/SFileAttributes.cpp b/src/SFileAttributes.cpp index 2589fc3..aafd4c3 100644 --- a/src/SFileAttributes.cpp +++ b/src/SFileAttributes.cpp @@ -125,8 +125,13 @@ static DWORD CheckSizeOfAttributesFile(DWORD cbAttrFile, DWORD dwAttrFlags, DWOR if(cbAttrFile == (cbHeaderSize + cbChecksumSize1 + cbFileTimeSize1 + cbFileHashSize1 + cbPatchBitSize3)) return dwFileTableSize; +#ifdef __STORMLIB_TEST__ // Invalid size of the (attributes) file + // Note that many MPQs, especially Warcraft III maps have the size of (attributes) invalid. + // We only perform this check if this is the STORMLIB testprogram itself assert(false); +#endif + return 0; } diff --git a/test/Test.cpp b/test/Test.cpp index 96fa4f2..ed685a8 100644 --- a/test/Test.cpp +++ b/test/Test.cpp @@ -3472,6 +3472,11 @@ int main(int argc, char * argv[]) printf("==== Test Suite for StormLib version %s ====\n", STORMLIB_VERSION_STRING); nError = InitializeMpqDirectory(argv, argc); + HANDLE hMpq = NULL; + if(SFileOpenArchive(_T("e:\\Ladik\\Incoming\\Castle Defense v7.3 NEWest.w3x"), 0, 0, &hMpq)) + SFileCloseArchive(hMpq); + + // Not a test, but rather a tool for creating links to duplicated files // if(nError == ERROR_SUCCESS) // nError = FindFilePairs(ForEachFile_CreateArchiveLink, "2004 - WoW\\06080", "2004 - WoW\\06299"); |