md5: return non-zero if built-in tests (-x) fail

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2020-07-23 20:06:24 +00:00
parent 205f3e1597
commit af9de844c4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363457

View File

@ -498,10 +498,12 @@ MDTestSuite(const Algorithm_t *alg)
for (i = 0; i < MDTESTCOUNT; i++) {
(*alg->Data)(MDTestInput[i], strlen(MDTestInput[i]), buffer);
printf("%s (\"%s\") = %s", alg->name, MDTestInput[i], buffer);
if (strcmp(buffer, (*alg->TestOutput)[i]) == 0)
if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) {
printf(" - verified correct\n");
else
} else {
printf(" - INCORRECT RESULT!\n");
failed++;
}
}
}