2017-10-21 23:40:19 +00:00
|
|
|
/* Conformance Test 15.7.0.1: Verification of strstr function */
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2022-10-17 22:50:42 +00:00
|
|
|
int printf(const char *, ...);
|
|
|
|
|
|
|
|
int main (void)
|
2017-10-21 23:40:19 +00:00
|
|
|
{
|
|
|
|
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");
|
2022-10-17 22:50:42 +00:00
|
|
|
return 0;
|
2017-10-21 23:40:19 +00:00
|
|
|
|
|
|
|
Fail:
|
|
|
|
printf ("Failed Conformance Test 15.7.0.1\n");
|
|
|
|
}
|