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>
21 extern bool SmTestVerbose;
22 static int Verbose = 0;
34 fprintf(stderr, "str=\"%s\", len=%d, expected=%d\n",
43 int outlen, leni, lenx, ilen;
48 sm_strlcpy(line_in, str, sizeof(line_in));
49 obp = quote_internal_chars(str, NULL, &outlen, NULL);
52 for (ilen = 0; *obp != '\0'; obp++, ilen++)
57 fprintf(stderr, "str=\"%s\", ilen=%d, xlen=%d\n",
59 SM_TEST(ilen == leni);
61 fprintf(stderr, "str=\"%s\", ilen=%d, leni=%d\n",
63 SM_TEST(xlen == lenx);
65 fprintf(stderr, "str=\"%s\", xlen=%d, lenx=%d\n",
79 fprintf(stderr, "str=\"%s\", len=%d, expected=%d\n",
88 fprintf(stderr, "usage: %s [options]\n", prg);
89 fprintf(stderr, "options:\n");
90 fprintf(stderr, "-x xleni\n");
103 while ((o = getopt(argc, argv, "bxV")) != -1)
125 sm_test_begin(argc, argv, "test ilenx");
129 while (fscanf(stdin, "%s\n", line) == 1)
131 return sm_test_end();
133 while (fscanf(stdin, "%d:%s\n", &len, line) == 2)
141 return sm_test_end();
143 #else /* _FFR_8BITENVADDR */
151 #endif /* _FFR_8BITENVADDR */