diff options
Diffstat (limited to 'test/StormTest.cpp')
-rw-r--r-- | test/StormTest.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/StormTest.cpp b/test/StormTest.cpp index e8a52dc..916eed0 100644 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -4184,6 +4184,33 @@ int _tmain(int argc, TCHAR * argv[]) printf("==== Test Suite for StormLib version %s ====\n", STORMLIB_VERSION_STRING);
dwErrCode = InitializeMpqDirectory(argv, argc);
+/*
+ // Check creation of the MPQ with LZMA compression
+ LPCTSTR szArchiveName = _T("E:\\new-mpq.mpq");
+ HANDLE hFile = NULL;
+ HANDLE hMpq = NULL;
+
+ DeleteFile(szArchiveName);
+ if(SFileCreateArchive(szArchiveName, MPQ_CREATE_ARCHIVE_V2 | MPQ_CREATE_LISTFILE | MPQ_CREATE_ATTRIBUTES, 0x1000, &hMpq))
+ {
+ SFileAddFileEx(hMpq, _T("e:\\DlgSetFileAssoc.cpp"), "DlgSetFileAssoc.cpp", MPQ_FILE_SINGLE_UNIT | MPQ_FILE_COMPRESS, MPQ_COMPRESSION_LZMA, MPQ_COMPRESSION_NEXT_SAME);
+ SFileCloseArchive(hMpq);
+
+ if(SFileOpenArchive(szArchiveName, 0, 0, &hMpq))
+ {
+ if(SFileOpenFileEx(hMpq, "DlgSetFileAssoc.cpp", 0, &hFile))
+ {
+ DWORD dwBytesRead = 0;
+ BYTE Buffer[0x100];
+
+ SFileReadFile(hFile, Buffer, sizeof(Buffer), &dwBytesRead, NULL);
+ SFileCloseFile(hFile);
+ }
+ SFileCloseArchive(hMpq);
+ }
+ }
+*/
+
#ifdef TEST_COMMAND_LINE
// Test-open MPQs from the command line. They must be plain name
// and must be placed in the Test-MPQs folder
|