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

@@ -3,24 +3,32 @@
static const char fox[] = "The quick brown fox jumped over the lazy dogs.";
void main (void)
int fails = 0;
int main (void)
{
printf ("Testing strpbrk():\n");
if (strpbrk (fox, "qwerty") != &fox[2]) {
printf ("\nThe first 'e' wasn't found.\n");
fails++;
}
if (strpbrk (fox, "QWERTY") != &fox[0]) {
printf ("The 'T' wasn't found.\n");
fails++;
}
if (strpbrk (fox, "asdfg") != &fox[16]) {
printf ("The 'f' wasn't found.\n");
fails++;
}
if (strpbrk (fox, "nxv,zmb") != &fox[10]) {
printf ("The 'b' wasn't found.\n");
fails++;
}
if (strpbrk (fox, "!@#$%^&*()-+=[];:',/?<>.") != &fox[45]) {
printf ("The '.' wasn't found.\n");
fails++;
}
printf ("\nFinished.\n");
printf ("\nFinished. fails = %d\n", fails);
return fails;
}