From 804b26bb85ddfe1363a315ab938065c9549587ae Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Wed, 31 Mar 2021 17:22:23 +0200 Subject: Test --- test/StormTest.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/StormTest.cpp') diff --git a/test/StormTest.cpp b/test/StormTest.cpp index 0993826..9a7724d 100644 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -679,10 +679,10 @@ static HANDLE InitDirectorySearch(LPCTSTR szDirectory) HANDLE hFind; TCHAR szSearchMask[MAX_PATH]; - // Keep compilers happy + // Construct the directory mask _stprintf(szSearchMask, _T("%s\\*"), szDirectory); - // Construct the directory mask + // Perform the search hFind = FindFirstFile(szSearchMask, &wf); return (hFind != INVALID_HANDLE_VALUE) ? hFind : NULL; @@ -2169,9 +2169,12 @@ static DWORD TestOnLocalListFile(LPCTSTR szPlainName) if(SFileOpenFileEx(NULL, szFileName1, SFILE_OPEN_LOCAL_FILE, &hFile)) { // Retrieve the file name. It must match the name under which the file was open - SFileGetFileName(hFile, szFileName2); - if(strcmp(szFileName2, szFileName1)) - Logger.PrintMessage("The retrieved name does not match the open name"); + if(FileStream_Prefix(szPlainName, NULL) == 0) + { + SFileGetFileName(hFile, szFileName2); + if(strcmp(szFileName2, szFileName1)) + Logger.PrintMessage("The retrieved name does not match the open name"); + } // Retrieve the file size dwFileSizeLo = SFileGetFileSize(hFile, &dwFileSizeHi); @@ -4286,6 +4289,7 @@ int _tmain(int argc, TCHAR * argv[]) if(dwErrCode == ERROR_SUCCESS) { + TestOnLocalListFile(_T("FLAT-MAP:ListFile_Blizzard.txt")); dwErrCode = TestOnLocalListFile(_T("ListFile_Blizzard.txt")); } -- cgit v1.2.3 From 48f26f9f75a840a31b86a245f974009edf6d90bf Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Wed, 31 Mar 2021 17:40:00 +0200 Subject: Linux fix --- test/StormTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/StormTest.cpp') diff --git a/test/StormTest.cpp b/test/StormTest.cpp index 9a7724d..0c1aea4 100644 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -51,7 +51,7 @@ typedef struct _LINE_INFO { LONG nLinePos; DWORD nLineLen; - char * szLine; + const char * szLine; } LINE_INFO, *PLINE_INFO; //------------------------------------------------------------------------------ @@ -63,7 +63,7 @@ static const TCHAR szListFileDir[] = { '1', '9', '9', '5', ' ', '-', ' ', 'T', ' #endif #ifdef STORMLIB_LINUX -#define WORK_PATH_ROOT "/media/ladik/MPQs" +#define WORK_PATH_ROOT "/media/ladik/CascStorages/MPQs" static const TCHAR szListFileDir[] = { '1', '9', '9', '5', ' ', '-', ' ', 'T', 'e', 's', 't', ' ', 'M', 'P', 'Q', 's', '\\', 'l', 'i', 's', 't', 'f', 'i', 'l', 'e', 's', '-', (TCHAR)0xe6, (TCHAR)0x96, (TCHAR)0xB0, (TCHAR)0xE5, (TCHAR)0xBB, (TCHAR)0xBA, (TCHAR)0xE6, (TCHAR)0x96, (TCHAR)0x87, (TCHAR)0xE4, (TCHAR)0xBB, (TCHAR)0xB6, (TCHAR)0xE5, (TCHAR)0xA4, (TCHAR)0xB9, 0 }; #endif -- cgit v1.2.3