Revert "Test strtok()."

This reverts commit 3a7bd53956.
This commit is contained in:
Sven Michael Klose 2024-03-05 07:04:59 +01:00
parent 294b034920
commit a887b29ffb
1 changed files with 0 additions and 43 deletions

View File

@ -1,43 +0,0 @@
// 2024-02-14 Sven Michael Klose <pixel@hugbox.org>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
error (void)
{
printf ("strtok() test failed!\n");
exit (-1);
}
void
test (char * s)
{
if (strcmp ("test", strtok (s, "/")))
error ();
if (strcmp ("foo", strtok (NULL, "/")))
error ();
if (strcmp ("bar", strtok (NULL, "/")))
error ();
if (strtok (NULL, "/"))
error ();
if (strtok (NULL, "/"))
error ();
}
int
main (void)
{
char s1[] = "test/foo/bar";
char s2[] = "/test/foo/bar";
char s3[] = "//test/foo/bar";
char s4[] = "//test/foo/bar//";
test (s1);
test (s2);
test (s3);
test (s4);
return 0;
}