Go to the documentation of this file.Go to the SVN repository for this file.
30 #define PRINTF if (v) printf
54 #define count (int)(sizeof(cflags)/sizeof(int))
60 static const char *
data0_1[] = {
"posix",
"lower posix",
"upper POSIX",
NULL };
61 static const char *
data2_3[] = {
"(*LF)^(cat|dog)",
"catastrophic\ncataclysm",
62 "dogfight",
"no animals",
NULL };
63 static const char *
data4[] = {
"*badpattern",
NULL };
121 int main(
int argc,
char **argv)
125 int v = argc > 1 &&
strcmp(argv[1],
"-v") == 0;
127 PRINTF(
"Test of pcre2posix.h without pcre2.h\n");
131 char *pattern =
data[
i][0];
132 char **subjects =
data[
i] + 1;
140 fprintf(stderr,
"Unexpected compile error %d (expected %d)\n", rc, *rd);
141 fprintf(stderr,
"Pattern is: %s\n", pattern);
151 PRINTF(
"Compile error %d: %s (expected)\n", rc,
buffer);
156 for (; *subjects !=
NULL; subjects++)
160 PRINTF(
"Subject: %s\n", *subjects);
166 fprintf(stderr,
"Unexpected match error %d (expected %d)\n", rc, *rd);
167 fprintf(stderr,
"Pattern is: %s\n", pattern);
168 fprintf(stderr,
"Subject is: %s\n", *subjects);
177 if (m->
rm_so < 0)
continue;
178 if (m->
rm_so != *(++rd) || m->
rm_eo != *(++rd))
181 fprintf(stderr,
"Mismatched results for successful match\n");
182 fprintf(stderr,
"Pattern is: %s\n", pattern);
183 fprintf(stderr,
"Subject is: %s\n", *subjects);
184 fprintf(stderr,
"Result %d: expected %d %d received %d %d\n",
int strcmp(const char *str1, const char *str2)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
static const char * data2_3[]
static const char * data0_1[]
int main(int argc, char **argv)
static const char * data4[]