diff options
author | Joe Orton <jorton@apache.org> | 2004-03-06 08:40:42 +0000 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2004-03-06 08:40:42 +0000 |
commit | c695558b563fe0b0386cc6bceeb4997a2242f779 (patch) | |
tree | 3a01d01625b8ba93067e35cdbbba9a13613f5793 /test/testfnmatch.c | |
parent | 4087b8845faf8c0c1c01c4bb2d0c3b24e23bfb58 (diff) | |
download | apr-c695558b563fe0b0386cc6bceeb4997a2242f779.tar.gz |
* test/testfnmatch.c: Convert to Unix newlines.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testfnmatch.c')
-rw-r--r-- | test/testfnmatch.c | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/test/testfnmatch.c b/test/testfnmatch.c index 4dcb058d0..dbd5852c0 100644 --- a/test/testfnmatch.c +++ b/test/testfnmatch.c @@ -1,77 +1,77 @@ -/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "test_apr.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "apr_file_info.h"
-#include "apr_fnmatch.h"
-#include "apr_tables.h"
-
-static void test_glob(CuTest *tc)
-{
- int i;
- char **list;
- apr_array_header_t *result;
- apr_status_t rv = apr_match_glob("data\\*.txt", &result, p);
-
- CuAssertIntEquals(tc, APR_SUCCESS, rv);
- /* XXX If we ever add a file that matches *.txt to data, then we need
- * to increase this.
- */
- CuAssertIntEquals(tc, 2, result->nelts);
-
- list = (char **)result->elts;
- for (i = 0; i < result->nelts; i++) {
- char *dot = strrchr(list[i], '.');
- CuAssertStrEquals(tc, dot, ".txt");
- }
-}
-
-static void test_glob_currdir(CuTest *tc)
-{
- int i;
- char **list;
- apr_array_header_t *result;
- apr_status_t rv;
- apr_filepath_set("data", p);
- rv = apr_match_glob("*.txt", &result, p);
-
- CuAssertIntEquals(tc, APR_SUCCESS, rv);
- /* XXX If we ever add a file that matches *.txt to data, then we need
- * to increase this.
- */
- CuAssertIntEquals(tc, 2, result->nelts);
-
- list = (char **)result->elts;
- for (i = 0; i < result->nelts; i++) {
- char *dot = strrchr(list[i], '.');
- CuAssertStrEquals(tc, dot, ".txt");
- }
-}
-
-CuSuite *testfnmatch(void)
-{
- CuSuite *suite = CuSuiteNew("Fnmatch");
-
- SUITE_ADD_TEST(suite, test_glob);
- SUITE_ADD_TEST(suite, test_glob_currdir);
-
- return suite;
-}
-
+/* Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "test_apr.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "apr_file_info.h" +#include "apr_fnmatch.h" +#include "apr_tables.h" + +static void test_glob(CuTest *tc) +{ + int i; + char **list; + apr_array_header_t *result; + apr_status_t rv = apr_match_glob("data\\*.txt", &result, p); + + CuAssertIntEquals(tc, APR_SUCCESS, rv); + /* XXX If we ever add a file that matches *.txt to data, then we need + * to increase this. + */ + CuAssertIntEquals(tc, 2, result->nelts); + + list = (char **)result->elts; + for (i = 0; i < result->nelts; i++) { + char *dot = strrchr(list[i], '.'); + CuAssertStrEquals(tc, dot, ".txt"); + } +} + +static void test_glob_currdir(CuTest *tc) +{ + int i; + char **list; + apr_array_header_t *result; + apr_status_t rv; + apr_filepath_set("data", p); + rv = apr_match_glob("*.txt", &result, p); + + CuAssertIntEquals(tc, APR_SUCCESS, rv); + /* XXX If we ever add a file that matches *.txt to data, then we need + * to increase this. + */ + CuAssertIntEquals(tc, 2, result->nelts); + + list = (char **)result->elts; + for (i = 0; i < result->nelts; i++) { + char *dot = strrchr(list[i], '.'); + CuAssertStrEquals(tc, dot, ".txt"); + } +} + +CuSuite *testfnmatch(void) +{ + CuSuite *suite = CuSuiteNew("Fnmatch"); + + SUITE_ADD_TEST(suite, test_glob); + SUITE_ADD_TEST(suite, test_glob_currdir); + + return suite; +} + |