COMMON: Remove various variants of the md5_file / md5_file_string funcs; turned the (disabled) MD5 test code into a working unit test

svn-id: r46108
This commit is contained in:
Max Horn 2009-11-23 22:30:22 +00:00
parent 3d342bec3c
commit 6b8dd7ab7a
7 changed files with 78 additions and 162 deletions

View file

@ -370,17 +370,19 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p
debug(3, "+ %s", fname.c_str());
SizeMD5 tmp;
if (!md5_file_string(allFiles[fname], tmp.md5, params.md5Bytes))
Common::File testFile;
if (testFile.open(allFiles[fname])) {
tmp.size = (int32)testFile.size();
if (!md5_file_string(testFile, tmp.md5, params.md5Bytes))
tmp.md5[0] = 0;
} else {
tmp.size = -1;
tmp.md5[0] = 0;
}
debug(3, "> '%s': '%s'", fname.c_str(), tmp.md5);
Common::File testFile;
if (testFile.open(allFiles[fname]))
tmp.size = (int32)testFile.size();
else
tmp.size = -1;
filesSizeMD5[fname] = tmp;
}
}