Show all failing CRCs.

Added note to README regarding expected failures with "version 1" records.
This commit is contained in:
Andy McFadden 2003-03-06 01:34:45 +00:00
parent 74921ad1c1
commit 16460a8d2e
2 changed files with 18 additions and 7 deletions

View File

@ -105,6 +105,15 @@ place", deleting and adding threads within existing records several times.
The changes are periodically flushed, but the archive is never closed.
The goal is to test repeated updates on an open archive.
This will leave a file called "TwirlCopy678" in the current directory, and
overwrite "TwirlTmp789" during processing.
The CRC verification mechanism will fail on archives created with ProDOS
8 ShrinkIt. The older "version 1" records didn't have CRCs in the thread
headers, so you will get a series of messages that look like this:
ERROR: CRC mismatch: 0 old=0x0000 new=0x681b
ERROR: CRC mismatch: 1 old=0x0000 new=0x5570
ERROR: CRC mismatch: 2 old=0x0000 new=0x4ec5
This will leave the original archive alone, making a copy of it named
"TwirlCopy678" in the current directory. It overwrites its temp file,
"TwirlTmp789", without prompting.

View File

@ -233,6 +233,7 @@ CompareCRCs(NuArchive* pArchive, const CRCList* pOldCRCList)
{
CRCList* pNewCRCList = nil;
int result = -1;
int badCrc = 0;
int i;
pNewCRCList = GatherCRCs(pArchive);
@ -250,13 +251,14 @@ CompareCRCs(NuArchive* pArchive, const CRCList* pOldCRCList)
for (i = 0; i < pNewCRCList->numEntries; i++) {
if (pOldCRCList->entries[i] != pNewCRCList->entries[i]) {
fprintf(stderr, "ERROR: CRC mismatch: %5d old=0x%04x new=0x%04x\n",
i, pOldCRCList->numEntries, pNewCRCList->numEntries);
goto bail;
i, pOldCRCList->entries[i], pNewCRCList->entries[i]);
badCrc = 1;
}
}
printf(" Matched %d CRCs\n", pOldCRCList->numEntries);
result = 0;
if (!badCrc) {
printf(" Matched %d CRCs\n", pOldCRCList->numEntries);
result = 0;
}
bail:
FreeCRCs(pNewCRCList);