From 3424ac8ba449b6036d49fd28725f6a2d7c4548e9 Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Fri, 17 Dec 2021 23:42:52 +0100 Subject: Finalizing --- PostBuild.bat | 34 ------------------------ StormLib_vs08.vcproj | 32 +++++++++++------------ StormLib_vs19.vcxproj | 64 ++++++++++++++++++++++++++++++++++------------ StormLib_vs19_dll.vcxproj | 4 +++ StormLib_vs19_test.vcxproj | 4 +++ make-msvc.bat | 33 ++++++++++++++++-------- make.bat | 8 +++--- test/StormTest.cpp | 55 +++++++++++++++++---------------------- test/TLogHelper.cpp | 2 +- 9 files changed, 123 insertions(+), 113 deletions(-) delete mode 100644 PostBuild.bat diff --git a/PostBuild.bat b/PostBuild.bat deleted file mode 100644 index c2d2534..0000000 --- a/PostBuild.bat +++ /dev/null @@ -1,34 +0,0 @@ -@echo off -rem Post-build batch for StormLib project -rem Called as PostBuild.bat $(ProjectName) $(PlatformName) $(ConfigurationName) [vs2008] -rem Example: PostBuild.bat StormLib_dll x64 Debug vs2008 - -rem Select build type -if "%1" == "StormLib_dll" goto PostBuild_DLL -if "%1" == "StormLib" goto PostBuild_LIB -goto:eof - -:PostBuild_DLL - -rem Build steps for the DLL. On 32-bit Release version, increment the build number -if not "x%2" == "xWin32" goto:eof -if not "x%3" == "xRelease" goto:eof -PostBuild.exe .\src\DllMain.rc -goto:eof - -:PostBuild_LIB - -rem Set target folders -if "x%2" == "xWin32" set TARGET_DIR_LEVEL2=lib32 -if "x%2" == "xx64" set TARGET_DIR_LEVEL2=lib64 -if "x%4" == "xvs2008" set TARGET_DIR_LEVEL3=vs2008 - -rem Check & create target folder structure -if not exist ..\aaa goto:eof -if not exist ..\aaa\%TARGET_DIR_LEVEL2% md ..\aaa\%TARGET_DIR_LEVEL2% -if not exist ..\aaa\%TARGET_DIR_LEVEL2%\%TARGET_DIR_LEVEL3% md ..\aaa\%TARGET_DIR_LEVEL2%\%TARGET_DIR_LEVEL3% - -rem Copy include and LIB files to the target folder -copy /Y .\src\StormLib.h ..\aaa\inc >nul -copy /Y .\src\StormPort.h ..\aaa\inc >nul -copy /Y .\bin\%1\%2\%3\StormLib???.lib ..\aaa\%TARGET_DIR_LEVEL2%\%TARGET_DIR_LEVEL3% >nul diff --git a/StormLib_vs08.vcproj b/StormLib_vs08.vcproj index 0c02e13..4f59a1b 100644 --- a/StormLib_vs08.vcproj +++ b/StormLib_vs08.vcproj @@ -80,7 +80,7 @@ /> diff --git a/StormLib_vs19.vcxproj b/StormLib_vs19.vcxproj index e0c83f9..eba3ea2 100644 --- a/StormLib_vs19.vcxproj +++ b/StormLib_vs19.vcxproj @@ -269,12 +269,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -289,12 +291,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -306,12 +310,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -326,12 +332,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -342,12 +350,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -361,12 +371,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -377,12 +389,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -396,12 +410,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -413,12 +429,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -433,12 +451,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -450,12 +470,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -470,12 +492,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -486,12 +510,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -505,12 +531,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -521,12 +549,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + @@ -540,12 +570,14 @@ Level1 ProgramDatabase + true ./bin/$(ProjectName)/$(Platform)/$(Configuration)/$(TargetName).lib - PostBuild.bat $(ProjectName) $(Platform) $(Configuration) + + diff --git a/StormLib_vs19_dll.vcxproj b/StormLib_vs19_dll.vcxproj index 1dbbce8..ba888e9 100644 --- a/StormLib_vs19_dll.vcxproj +++ b/StormLib_vs19_dll.vcxproj @@ -100,6 +100,7 @@ Level1 ProgramDatabase + true $(OutDir)StormLib.dll @@ -123,6 +124,7 @@ Level1 ProgramDatabase + true $(OutDir)StormLib.dll @@ -141,6 +143,7 @@ Level1 ProgramDatabase + true $(OutDir)StormLib.dll @@ -164,6 +167,7 @@ Level1 ProgramDatabase + true $(OutDir)StormLib.dll diff --git a/StormLib_vs19_test.vcxproj b/StormLib_vs19_test.vcxproj index 9f91ade..d293549 100644 --- a/StormLib_vs19_test.vcxproj +++ b/StormLib_vs19_test.vcxproj @@ -98,6 +98,7 @@ Level1 EditAndContinue Default + true true @@ -121,6 +122,7 @@ Level1 ProgramDatabase Default + true true @@ -138,6 +140,7 @@ Level1 ProgramDatabase + true true @@ -160,6 +163,7 @@ Level1 ProgramDatabase + true true diff --git a/make-msvc.bat b/make-msvc.bat index 8b9a559..d8097d1 100644 --- a/make-msvc.bat +++ b/make-msvc.bat @@ -21,8 +21,8 @@ if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2019\Professional\VC\Auxil if exist "%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" set VCVARS_2019=%PROGRAM_FILES_DIR%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat ::Build all libraries using Visual Studio 2008 and 2017 -call :BuildLibs "%VCVARS_2008%" x86 %LIB_NAME%_vs08.sln -call :BuildLibs "%VCVARS_2008%" x64 %LIB_NAME%_vs08.sln +call :BuildLibs "%VCVARS_2008%" x86 %LIB_NAME%_vs08.sln \vs2008 +call :BuildLibs "%VCVARS_2008%" x64 %LIB_NAME%_vs08.sln \vs2008 call :BuildLibs "%VCVARS_2019%" x86 %LIB_NAME%_vs19.sln call :BuildLibs "%VCVARS_2019%" x64 %LIB_NAME%_vs19.sln goto:eof @@ -35,21 +35,31 @@ goto:eof :: %1 Full path to the VCVARS.BAT file :: %2 Target build platform (x86 or x64) :: %3 Plain name of the /sln solution file +:: %4 Subdirectory for the target folder of the library ("\vs2008" or "") :: :BuildLibs -::set VSCMD_DEBUG=1 call %1 %2 if "%2" == "x86" set SLN_TRG=Win32 +if "%2" == "x86" set LIB_TRG=lib32 if "%2" == "x64" set SLN_TRG=x64 -devenv.com %3 /project "%LIB_NAME%" /build "DebugAD|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "DebugAS|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "DebugUD|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "DebugUS|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "ReleaseAD|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "ReleaseAS|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "ReleaseUD|%SLN_TRG%" -devenv.com %3 /project "%LIB_NAME%" /build "ReleaseUS|%SLN_TRG%" +if "%2" == "x64" set LIB_TRG=lib64 +devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugAD|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugAD\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugAS|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugAS\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugUD|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugUD\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "DebugUS|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\DebugUS\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseAD|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseAD\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseAS|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseAS\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseUD|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseUD\*.lib ..\aaa\%LIB_TRG%%4 +devenv.com %3 /project "%LIB_NAME%" /rebuild "ReleaseUS|%SLN_TRG%" +xcopy.exe /Y /D .\bin\StormLib\%SLN_TRG%\ReleaseUS\*.lib ..\aaa\%LIB_TRG%%4 :: Restore environment variables to the old level set INCLUDE=%SAVE_INCLUDE% @@ -58,3 +68,4 @@ set PATH=%SAVE_PATH% set VSINSTALLDIR= set VCINSTALLDIR= set DevEnvDir= +goto:eof diff --git a/make.bat b/make.bat index 8765eb5..7b29207 100644 --- a/make.bat +++ b/make.bat @@ -35,10 +35,10 @@ del buildfre_wlh_amd64.log echo. :COPY_LIBS -copy /Y .\objfre_wlh_amd64\amd64\%LIBRARY_NAME%.lib ..\aaa\lib64\%LIBRARY_NAME%.lib >nul -copy /Y .\objfre_w2k_x86\i386\%LIBRARY_NAME%.lib ..\aaa\lib32\%LIBRARY_NAME%.lib >nul -copy /Y .\src\StormPort.h ..\aaa\inc >nul -copy /Y .\src\StormLib.h ..\aaa\inc >nul +xcopy /Y /D .\src\StormLib.h ..\aaa\inc >nul +xcopy /Y /D .\src\StormPort.h ..\aaa\inc >nul +xcopy /Y /D .\objfre_w2k_x86\i386\%LIBRARY_NAME%.lib ..\aaa\lib32\%LIBRARY_NAME%.lib >nul +xcopy /Y /D .\objfre_wlh_amd64\amd64\%LIBRARY_NAME%.lib ..\aaa\lib64\%LIBRARY_NAME%.lib >nul :CLEANUP if exist sources-cpp.cpp del sources-cpp.cpp diff --git a/test/StormTest.cpp b/test/StormTest.cpp index 3d783aa..13b0ace 100644 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -4327,56 +4327,49 @@ int _tmain(int argc, TCHAR * argv[]) // Open all files from the command line // -<<<<<<< HEAD for(int i = 1; i < argc; i++) { TestArchive(_T("MPQ_2021_v1_CantExtractCHK.scx"), _T("Listfile_Blizzard.txt"), 0, NULL, NULL); } -======= - //for(int i = 1; i < argc; i++) - //{ - // TestArchive(_T("MPQ_2021_v1_CantExtractCHK.scx"), _T("Listfile_Blizzard.txt"), TEST_FLAG_FILE_COUNT, NULL, NULL); - //} ->>>>>>> 1a94f94 (Support for protected SCX files) // // Search all testing archives and verify their SHA1 hash // - //if(dwErrCode == ERROR_SUCCESS) - //{ - // dwErrCode = FindFiles(ForEachFile_VerifyFileChecksum, szMpqSubDir); - //} + if(dwErrCode == ERROR_SUCCESS) + { + dwErrCode = FindFiles(ForEachFile_VerifyFileChecksum, szMpqSubDir); + } // // Test file stream operations // - //if(dwErrCode == ERROR_SUCCESS) - //{ - // for(size_t i = 0; i < _countof(TestList_StreamOps); i++) - // { - // dwErrCode = TestFileStreamOperations(TestList_StreamOps[i].szMpqName1, TestList_StreamOps[i].dwFlags); - // if(dwErrCode != ERROR_SUCCESS) - // break; - // } - //} + if(dwErrCode == ERROR_SUCCESS) + { + for(size_t i = 0; i < _countof(TestList_StreamOps); i++) + { + dwErrCode = TestFileStreamOperations(TestList_StreamOps[i].szMpqName1, TestList_StreamOps[i].dwFlags); + if(dwErrCode != ERROR_SUCCESS) + break; + } + } // // Test master-mirror reading operations // - //if(dwErrCode == ERROR_SUCCESS) - //{ - // for(size_t i = 0; i < _countof(TestList_MasterMirror); i++) - // { - // dwErrCode = TestReadFile_MasterMirror(TestList_MasterMirror[i].szMpqName1, - // TestList_MasterMirror[i].szMpqName2, - // TestList_MasterMirror[i].dwFlags != 0); - // if(dwErrCode != ERROR_SUCCESS) - // break; - // } - //} + if(dwErrCode == ERROR_SUCCESS) + { + for(size_t i = 0; i < _countof(TestList_MasterMirror); i++) + { + dwErrCode = TestReadFile_MasterMirror(TestList_MasterMirror[i].szMpqName1, + TestList_MasterMirror[i].szMpqName2, + TestList_MasterMirror[i].dwFlags != 0); + if(dwErrCode != ERROR_SUCCESS) + break; + } + } // // Test opening various archives - correct, damaged, protected diff --git a/test/TLogHelper.cpp b/test/TLogHelper.cpp index f277e64..3d09823 100644 --- a/test/TLogHelper.cpp +++ b/test/TLogHelper.cpp @@ -423,7 +423,7 @@ char * TLogHelper::CopyFormatCharacter(char * szBuffer, const char *& szFormat) // String format if(szFormat[0] == '%') { - if(szFormat[1] == 's') + if(szFormat[1] == 's' && szFormat[2] != ')') { strcpy(szBuffer, szStringFormat); szFormat += 2; -- cgit v1.2.3