From jorton@apache.org Wed Nov 17 12:24:05 2004 Return-Path: Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Delivered-To: mailing list commits@apr.apache.org Received: (qmail 8325 invoked by uid 99); 17 Nov 2004 12:24:05 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 17 Nov 2004 04:24:05 -0800 Received: (qmail 19917 invoked by uid 65534); 17 Nov 2004 12:24:03 -0000 Date: 17 Nov 2004 12:24:03 -0000 Message-ID: <20041117122403.19915.qmail@minotaur.apache.org> From: jorton@apache.org To: commits@apr.apache.org Subject: svn commit: rev 76120 - apr/apr/trunk/test X-Virus-Checked: Checked Author: jorton Date: Wed Nov 17 04:24:00 2004 New Revision: 76120 Modified: apr/apr/trunk/test/testfnmatch.c Log: * test/testfnmatch.c (test_glob, test_glob_currdir): Fix for presence of third .txt file in data (!?!) and use APR_ASSERT_SUCCESS. Modified: apr/apr/trunk/test/testfnmatch.c ============================================================================== --- apr/apr/trunk/test/testfnmatch.c (original) +++ apr/apr/trunk/test/testfnmatch.c Wed Nov 17 04:24:00 2004 @@ -18,18 +18,22 @@ #include "apr_fnmatch.h" #include "apr_tables.h" +/* XXX NUM_FILES must be equal to the nummber of expected files with a + * .txt extension in the data directory at the time testfnmatch + * happens to be run (!?!). */ + +#define NUM_FILES (3) + 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); + + APR_ASSERT_SUCCESS(tc, "glob match against data/*.txt", + apr_match_glob("data\\*.txt", &result, p)); - 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. - */ - ABTS_INT_EQUAL(tc, 2, result->nelts); + ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts); list = (char **)result->elts; for (i = 0; i < result->nelts; i++) { @@ -43,15 +47,13 @@ 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); + + APR_ASSERT_SUCCESS(tc, "glob match against *.txt with data as current", + apr_match_glob("*.txt", &result, p)); + - 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. - */ - ABTS_INT_EQUAL(tc, 2, result->nelts); + ABTS_INT_EQUAL(tc, NUM_FILES, result->nelts); list = (char **)result->elts; for (i = 0; i < result->nelts; i++) {