some tweaks to the moved tests to make them more suitable for automatic testing

This commit is contained in:
mrdudz
2020-07-13 21:26:07 +02:00
parent 882194c221
commit 5ad365c5df
7 changed files with 108 additions and 64 deletions

View File

@@ -10,15 +10,19 @@ static const char S2[] = {
'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '\0', 'B'
};
int fails = 0;
int main (void)
{
char I;
int ret;
for (I = 0; I < 20; ++I) {
printf ("%02d: %d\n", I, strncmp (S1, S2, I));
ret = strncmp (S1, S2, I);
printf ("%02d: %d\n", I, ret);
if ((ret != 0) && (I < 7)) {
fails++;
}
}
return 0;
printf("fails: %d\n", fails);
return fails;
}