28#define APR_FNM_BITS 15
29#define APR_FNM_FAILBIT 256
31#define FAILS_IF(X) 0, X
32#define SUCCEEDS_IF(X) X, 256
33#define SUCCEEDS 0, 256
53 {
"te\\*t",
"test",
FAILS},
55 {
"te\\?t",
"test",
FAILS},
64 {
"test?",
"test",
FAILS},
79 {
"test*?*[a-z]*",
"testgoop",
SUCCEEDS},
84 {
"te[^x]t",
"text",
FAILS},
85 {
"te[^\\x]t",
"text",
FAILS},
86 {
"te[^x\\",
"text",
FAILS},
87 {
"te[/]t",
"text",
FAILS},
94 {
"te[R-T]t",
"tent",
FAILS},
98 {
"tes[t-]]",
"test",
FAILS},
99 {
"tes[u-]",
"test",
FAILS},
100 {
"tes[t-]",
"tes[t-]",
FAILS},
110 {
"/test",
"test",
FAILS},
111 {
"test",
"/test",
FAILS},
112 {
"test/",
"test",
FAILS},
113 {
"test",
"test/",
FAILS},
116 {
"/*/test/",
"/test",
FAILS},
117 {
"/*/test/",
"/test/test/",
SUCCEEDS},
118 {
"test/this",
"test/",
FAILS},
119 {
"test/",
"test/this",
FAILS},
120 {
"test*/this",
"test/this",
SUCCEEDS},
121 {
"test*/this",
"test/that",
FAILS},
122 {
"test/*this",
"test/this",
SUCCEEDS},
129 {
"test/this",
"test/this",
SUCCEEDS},
134 {
"test/.*",
"test/.this",
SUCCEEDS},
156 if (((
i &
test->require_flags) !=
test->require_flags)
157 || ((
i &
test->fail_flags) ==
test->fail_flags)) {
171 sprintf(
buf,
"apr_fnmatch(\"%s\", \"%s\", %d) returns %d\n",
179 static const struct test {
191 const struct test *
t;
196 if (
res !=
t->result) {
199 sprintf(
buf,
"apr_fnmatch_test(\"%s\") = %d, expected %d\n",
200 t->pattern,
res,
t->result);
void abts_run_test(abts_suite *ts, test_func f, void *value)
void abts_fail(abts_case *tc, const char *message, int lineno)
#define ABTS_STR_EQUAL(a, b, c)
#define ABTS_INT_EQUAL(a, b, c)
#define APR_ASSERT_SUCCESS(tc, ctxt, rv)
const unsigned char * buf
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
const apr_array_header_t * list
apr_array_header_t ** result
#define APR_FNM_CASE_BLIND
static struct pattern_s patterns[]
static void test_glob_currdir(abts_case *tc, void *data)
static void test_glob(abts_case *tc, void *data)
static void test_fnmatch_test(abts_case *tc, void *data)
abts_suite * testfnmatch(abts_suite *suite)
static void test_fnmatch(abts_case *tc, void *data)