MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / LocalStorage_Test

Function LocalStorage_Test

src/External/CascLib/test/CascTest.cpp:883–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883static DWORD LocalStorage_Test(PFN_RUN_TEST PfnRunTest, STORAGE_INFO & StorInfo)
884{
885 TLogHelper LogHelper(StorInfo.szPath);
886 HANDLE hStorage;
887 TCHAR szFullPath[MAX_PATH];
888 DWORD dwErrCode = ERROR_SUCCESS;
889
890 // Prepare the full path of the storage
891 MakeFullPath(szFullPath, _countof(szFullPath), StorInfo.szPath);
892
893 // Open the CASC storage
894 LogHelper.PrintProgress("Opening storage ...");
895 if(CascOpenStorage(szFullPath, 0, &hStorage))
896 {
897 TEST_PARAMS Params;
898
899 // Configure the test parameters
900 Params.hStorage = hStorage;
901 Params.szExpectedNameHash = StorInfo.szNameHash;
902 Params.szExpectedDataHash = StorInfo.szDataHash;
903 Params.szFileName = StorInfo.szFileName;
904 dwErrCode = PfnRunTest(LogHelper, Params);
905 }
906 else
907 {
908 LogHelper.PrintError("Error: Failed to open storage %s", StorInfo.szPath);
909 assert(GetCascError() != ERROR_SUCCESS);
910 dwErrCode = GetCascError();
911 }
912
913 return dwErrCode;
914}
915
916static DWORD SpeedStorage_Test(PFN_RUN_TEST PfnRunTest, LPCSTR szStorage, LPCSTR szExpectedNameHash = NULL, LPCSTR szExpectedDataHash = NULL, LPCSTR szFileName = NULL)
917{

Callers 1

mainFunction · 0.85

Calls 5

MakeFullPathFunction · 0.85
CascOpenStorageFunction · 0.85
GetCascErrorFunction · 0.85
PrintProgressMethod · 0.80
PrintErrorMethod · 0.80

Tested by

no test coverage detected