r6284: Starting on 3.0.14:
[Samba.git] / source / torture / t_strstr.c
blob7b928fb26bea41f017526aa3c317a7866eeb7001
1 /*
2 * Copyright (C) 2003 by Martin Pool
4 * Test harness for strstr_m
5 */
7 #include "includes.h"
9 int main(int argc, char *argv[])
11 int i;
12 int iters = 1;
14 const char *ret = NULL;
16 /* Needed to initialize character set */
17 lp_load("/dev/null", True, False, False);
19 if (argc < 3) {
20 fprintf(stderr, "usage: %s STRING1 STRING2 [ITERS]\n"
21 "Compares two strings, prints the results of strstr_m\n",
22 argv[0]);
23 return 2;
25 if (argc >= 4)
26 iters = atoi(argv[3]);
28 for (i = 0; i < iters; i++) {
29 ret = strstr_m(argv[1], argv[2]);
32 if (ret == NULL)
33 ret = "(null)";
35 printf("%s\n", ret);
37 return 0;