summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLadislav <Zezula>2013-11-15 10:17:43 +0100
committerLadislav <Zezula>2013-11-15 10:17:43 +0100
commit87eb1df287ebe76725d376a28facccbe0ccd7f92 (patch)
treed911227a2c9976a075426f9817812f9119404759 /test
parenta9579a3f4ab1a27a822bcc53f3e6a9b1a00e6418 (diff)
+ Support for compile-time messages for deprecated symbols
+ Replaced MPQ_FILE_COMPRESSED with more descriptive MPQ_FILE_COMPRESS_MASK
Diffstat (limited to 'test')
-rw-r--r--test/Test.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/test/Test.cpp b/test/Test.cpp
index 3e4b1fb..3d8b785 100644
--- a/test/Test.cpp
+++ b/test/Test.cpp
@@ -1222,6 +1222,33 @@ static int TestArchiveOpenAndClose(const TCHAR * szMpqName)
return nError;
}
+static int TestAddFilesToArchive(const TCHAR * szMpqName)
+{
+ HANDLE hFile;
+ HANDLE hMpq;
+ LPCSTR szFileData = "0123456789";
+ char szAddedFile[128];
+ DWORD dwFileSize = 10;
+
+ CopyFile(_T("e:\\Ladik\\Incoming\\Tya's Zerg Defense.SC2Map"), _T("e:\\Multimedia\\MPQs\\Tya's Zerg Defense.SC2Map"), FALSE);
+
+ for(int i = 0; i < 3; i++)
+ {
+ if(SFileOpenArchive(szMpqName, 0, 0, &hMpq))
+ {
+ sprintf(szAddedFile, "AddedFile%04u.txt", i);
+
+ if(SFileCreateFile(hMpq, szAddedFile, 0, dwFileSize, 0, MPQ_FILE_COMPRESS, &hFile))
+ {
+ SFileWriteFile(hMpq, szFileData, dwFileSize, MPQ_COMPRESSION_ZLIB);
+ SFileFinishFile(hFile);
+ }
+ }
+ }
+
+ return ERROR_SUCCESS;
+}
+
static int TestFindFiles(const TCHAR * szMpqName)
{
TMPQFile * hf;
@@ -2213,11 +2240,15 @@ int main(void)
// nError = TestSectorCompress(MPQ_SECTOR_SIZE);
// Test the archive open and close
- if(nError == ERROR_SUCCESS)
- nError = TestArchiveOpenAndClose(MAKE_PATH("2012 - Longwu Online\\Data\\Scp.mpk"));
+// if(nError == ERROR_SUCCESS)
+// nError = TestArchiveOpenAndClose(MAKE_PATH("2012 - Longwu Online\\Data\\Scp.mpk"));
// nError = TestArchiveOpenAndClose(MAKE_PATH("1997 - Diablo I\\DIABDAT.MPQ"));
// nError = TestArchiveOpenAndClose(MAKE_PATH("2012 - War of the Immortals\\1\\Other.sqp"));
+ // Test for bug reported by BlueRaja
+ if(nError == ERROR_SUCCESS)
+ nError = TestAddFilesToArchive(MAKE_PATH("Tya's Zerg Defense.SC2Map"));
+
// if(nError == ERROR_SUCCESS)
// nError = TestFindFiles(MAKE_PATH("2002 - Warcraft III/HumanEd.mpq"));