ORCA-C/Tests/Conformance/C15.7.0.1.CC
2017-10-21 18:40:19 -05:00

26 lines
524 B
C++

/* Conformance Test 15.7.0.1: Verification of strstr function */
#include <stddef.h>
#include <string.h>
main ()
{
char string [] = " this is the source string, a source string";
char *strPtr;
strPtr = strstr (string, "source string");
if (strPtr != (&( (string) [(13)] )) )
goto Fail;
strPtr = strstr (string, "source string!");
if (strPtr != NULL)
goto Fail;
printf ("Passed Conformance Test 15.7.0.1\n");
return;
Fail:
printf ("Failed Conformance Test 15.7.0.1\n");
}