2 * Copyright (c) 2020 Proofpoint, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
11 SM_IDSTR(id, "@(#)$Id: t-qic.c,v 1.10 2013-11-22 20:51:43 ca Exp $")
16 #include <sm/sendmail.h>
20 extern bool SmTestVerbose;
23 tstrncaseeq(s1, s2, len)
28 return SM_STRNCASEEQ(s1, s2, len);
35 fprintf(stderr, "usage: %s [options]\n", prg);
36 fprintf(stderr, "options:\n");
45 /* replace just one \x char */
46 while ((c = *str++) != '\0')
53 case 'n': c ='\n'; break;
54 case 't': c ='\t'; break;
55 case 'r': c ='\r'; break;
56 /* case 'X': c ='\X'; break; */
57 default: c ='\0'; break;
72 char s1[MAXL], s2[MAXL];
74 while ((o = getopt(argc, argv, "h")) != -1)
84 sm_test_begin(argc, argv, "test strncaseeq");
86 while (fscanf(stdin, "%d:%s\n", &len, s1) == 2 &&
87 fscanf(stdin, "%d:%s\n", &o,s2) == 2)
93 SM_TEST(tstrncaseeq(s1, s2, len) == o);
94 if ((r = tstrncaseeq(s1, s2, len)) != o)
95 fprintf(stderr, "\"%s\"\n\"%s\"\n%d!=%d\n", s1, s2, o, r);