/* $Id$ */
-/* Release $Name$ */
-
/* strchr( const char *, int )
This file is part of the Public Domain C Library (PDCLib).
#include <string.h>
+#ifndef REGTEST
+
char * strchr( const char * s, int c )
{
do
return NULL;
}
-#warning Test driver missing.
+#endif
#ifdef TEST
-int main()
+#include <_PDCLIB_test.h>
+
+int main( void )
{
- return 0;
+ char abccd[] = "abccd";
+ TESTCASE( strchr( abccd, 'x' ) == NULL );
+ TESTCASE( strchr( abccd, 'a' ) == &abccd[0] );
+ TESTCASE( strchr( abccd, 'd' ) == &abccd[4] );
+ TESTCASE( strchr( abccd, '\0' ) == &abccd[5] );
+ TESTCASE( strchr( abccd, 'c' ) == &abccd[2] );
+ return TEST_RESULTS;
}
#endif