summaryrefslogtreecommitdiff
path: root/test/testfnmatch.c
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2004-05-13 00:50:20 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2004-05-13 00:50:20 +0000
commit4ac08957a95bed976c28b0a04f27f89c88d6b7f0 (patch)
tree7efbac56f447f9a37ff68adec5fe28a9ec5cbb79 /test/testfnmatch.c
parent51e9d33da3e0900f25feac8a48463eedbc58a4dd (diff)
downloadlibapr-4ac08957a95bed976c28b0a04f27f89c88d6b7f0.tar.gz
Move the APR test suite from CuTest to abts. The output is cleaner,
and it prints output while running the test. Also, if a test fails the rest of the test function is run, allowing for proper cleanup. Finally, it is possible to call the same function multiple times with different data, and each call is considered a separate test. This is the first of a multi-step process to get a more useful test suite. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65091 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testfnmatch.c')
-rw-r--r--test/testfnmatch.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/testfnmatch.c b/test/testfnmatch.c
index 7b099e10d..ac5c5347f 100644
--- a/test/testfnmatch.c
+++ b/test/testfnmatch.c
@@ -13,32 +13,32 @@
* limitations under the License.
*/
-#include "test_apr.h"
+#include "testutil.h"
#include "apr_file_info.h"
#include "apr_fnmatch.h"
#include "apr_tables.h"
-static void test_glob(CuTest *tc)
+static void test_glob(abts_case *tc, void *data)
{
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);
+ abts_int_equal(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);
+ abts_int_equal(tc, 2, result->nelts);
list = (char **)result->elts;
for (i = 0; i < result->nelts; i++) {
char *dot = strrchr(list[i], '.');
- CuAssertStrEquals(tc, dot, ".txt");
+ abts_str_equal(tc, dot, ".txt");
}
}
-static void test_glob_currdir(CuTest *tc)
+static void test_glob_currdir(abts_case *tc, void *data)
{
int i;
char **list;
@@ -47,26 +47,26 @@ static void test_glob_currdir(CuTest *tc)
apr_filepath_set("data", p);
rv = apr_match_glob("*.txt", &result, p);
- CuAssertIntEquals(tc, APR_SUCCESS, rv);
+ abts_int_equal(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);
+ abts_int_equal(tc, 2, result->nelts);
list = (char **)result->elts;
for (i = 0; i < result->nelts; i++) {
char *dot = strrchr(list[i], '.');
- CuAssertStrEquals(tc, dot, ".txt");
+ abts_str_equal(tc, dot, ".txt");
}
apr_filepath_set("..", p);
}
-CuSuite *testfnmatch(void)
+abts_suite *testfnmatch(abts_suite *suite)
{
- CuSuite *suite = CuSuiteNew("Fnmatch");
+ suite = ADD_SUITE(suite)
- SUITE_ADD_TEST(suite, test_glob);
- SUITE_ADD_TEST(suite, test_glob_currdir);
+ abts_run_test(suite, test_glob, NULL);
+ abts_run_test(suite, test_glob_currdir, NULL);
return suite;
}