You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2011/05/18 22:00:52 UTC

svn commit: r1124400 - in /httpd/apreq/trunk/library/t: at.c at.h cookie.c error.c params.c parsers.c util.c version.c

Author: joes
Date: Wed May 18 20:00:52 2011
New Revision: 1124400

URL: http://svn.apache.org/viewvc?rev=1124400&view=rev
Log:
remove apr dependency from at.[ch].
Note: incorporates work from Mavin Humphrey <ma...@apache.org>

Modified:
    httpd/apreq/trunk/library/t/at.c
    httpd/apreq/trunk/library/t/at.h
    httpd/apreq/trunk/library/t/cookie.c
    httpd/apreq/trunk/library/t/error.c
    httpd/apreq/trunk/library/t/params.c
    httpd/apreq/trunk/library/t/parsers.c
    httpd/apreq/trunk/library/t/util.c
    httpd/apreq/trunk/library/t/version.c

Modified: httpd/apreq/trunk/library/t/at.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/at.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/at.c (original)
+++ httpd/apreq/trunk/library/t/at.c Wed May 18 20:00:52 2011
@@ -15,21 +15,22 @@
 **  limitations under the License.
 */
 
-#include "apr_file_io.h"
 #include "at.h"
-#include "apr_lib.h"
-#include "apr_strings.h"
-#include "apr_tables.h"
+#include <errno.h>
+#include <ctype.h>
 
+#define AT_SUCCESS 0
+#define AT_EGENERAL 14
 
-apr_status_t at_begin(at_t *t, int total)
+
+int at_begin(at_t *t, int total)
 {
     char buf[32];
-    apr_snprintf(buf, 32, "1..%d", total);
+    at_snprintf(buf, 32, "1..%d", total);
     return at_report(t, buf);
 }
 
-static apr_status_t test_cleanup(void *data)
+static int test_cleanup(void *data)
 {
     at_t *t = data;
     if (t->current < t->plan)
@@ -40,20 +41,20 @@ static apr_status_t test_cleanup(void *d
 
 void at_end(at_t *t)
 {
-    apr_pool_cleanup_kill(t->pool, t, test_cleanup);
     test_cleanup(t);
+    free(t);
 }
 
-apr_status_t at_comment(at_t *t, const char *fmt, va_list vp)
+int at_comment(at_t *t, const char *fmt, va_list vp)
 {
-    apr_status_t s;
+    int s;
     char buf[256], *b = buf + 2;
     char *end;
     int rv;
-    rv = apr_vsnprintf(b, 250, fmt, vp);
+    rv = at_vsnprintf(b, 250, fmt, vp);
 
     if (rv <= 0)
-        return APR_EINVAL;
+        return EINVAL;
 
 
     end = b + rv;
@@ -80,7 +81,7 @@ apr_status_t at_comment(at_t *t, const c
         eol = strchr(b + 2, '\n');
         *eol = 0;
         s = at_report(t, b);
-        if (s != APR_SUCCESS || eol == end - 1)
+        if (s != AT_SUCCESS || eol == end - 1)
             break;
 
         b    = eol - 1;
@@ -126,8 +127,8 @@ void at_ok(at_t *t, int is_ok, const cha
     else
         comment = is_todo ? "todo" : is_skip ? "skip" : "at";
 
-    rv = apr_snprintf(buf, 256, fmt, t->current + t->prior,
-                      label, comment,  file, line, t->current, t->name);
+    rv = at_snprintf(buf, 256, fmt, t->current + t->prior,
+                     label, comment,  file, line, t->current, t->name);
 
     if (rv <= 0)
         exit(-1);
@@ -141,13 +142,13 @@ void at_ok(at_t *t, int is_ok, const cha
         *end = '\0';
     }
 
-    if (memchr(buf, '\n', rv) != NULL || at_report(t, buf) != APR_SUCCESS)
+    if (memchr(buf, '\n', rv) != NULL || at_report(t, buf) != AT_SUCCESS)
         exit(-1);
 
     if (!is_ok && is_fatal) {
         while (t->current++ < t->plan) {
-            apr_snprintf(buf, 256, "not ok %d # skipped: aborting test %s",
-                     t->prior + t->current, t->name);
+            at_snprintf(buf, 256, "not ok %d # skipped: aborting test %s",
+                        t->prior + t->current, t->name);
             at_report(t, buf);
         }
         longjmp(*t->abort, 0);
@@ -156,68 +157,80 @@ void at_ok(at_t *t, int is_ok, const cha
 
 struct at_report_file {
     at_report_t module;
-    apr_file_t *file;
+    FILE *file;
 };
 
-
-static apr_status_t at_report_file_write(at_report_t *ctx, const char *msg)
+static int at_report_file_write(at_report_t *ctx, const char *msg)
 {
     struct at_report_file *r = (struct at_report_file *)ctx;
-    apr_file_t *f = r->file;
-    apr_size_t len = strlen(msg);
-    apr_status_t s;
+    FILE *f = r->file;
+    size_t len = strlen(msg);
+    size_t bytes_written;
+    int status;
 
-    s = apr_file_write_full(f, msg, len, &len);
-    if (s != APR_SUCCESS)
-        return s;
+    bytes_written = fwrite(msg, sizeof(char), len, f);
+    if (bytes_written != len)
+        return errno;
 
-    s = apr_file_putc('\n', f);
-    if (s != APR_SUCCESS)
-        return s;
+    status = putc('\n', f);
+    if (status == EOF)
+        return errno;
 
-    return apr_file_flush(f);
+    return fflush(f);
 }
 
-at_report_t *at_report_file_make(apr_pool_t *p, apr_file_t *f)
+at_report_t *at_report_file_make(FILE *f)
 {
-    struct at_report_file *r = apr_palloc(p, sizeof *r);
+    struct at_report_file *r = malloc(sizeof *r);
     r->module.func = at_report_file_write;
     r->file = f;
     return &r->module;
 }
 
-
+void at_report_file_cleanup(at_report_t *r)
+{
+    free(r);
+}
 
 struct at_report_local {
     at_report_t  module;
     at_t        *t;
     at_report_t *saved_report;
     const int   *saved_fatal;
+    const int   *saved_skip;
+    const int   *saved_todo;
     int          dummy_fatal;
-    const char  *file;
+    char        *file;
     int          line;
     int          passed;
-    apr_pool_t  *pool;
 };
 
-
-static apr_status_t report_local_cleanup(void *data)
+static int report_local_cleanup(void *data)
 {
     struct at_report_local *q = data;
     dAT = q->t;
     char label[32];
 
-    apr_snprintf(label, 32, "collected %d passing tests", q->passed);
+    at_snprintf(label, 32, "collected %d passing tests", q->passed);
 
     AT->report = q->saved_report;
-    AT->fatal = q->saved_fatal;
+    AT->fatal  = q->saved_fatal;
+    AT->skip   = q->saved_skip;
+    AT->todo   = q->saved_todo;
 
     at_ok(q->t, 1, label, q->file, q->line);
-    return APR_SUCCESS;
+
+    free(q->file);
+    free(q);
+
+    return AT_SUCCESS;
 }
 
+void at_report_delocalize(at_t *AT) {
+    report_local_cleanup(AT->report);
+}
 
-static apr_status_t at_report_local_write(at_report_t *ctx, const char *msg)
+static int at_report_local_write(at_report_t *ctx, const char *msg)
 {
     char buf[256];
     struct at_report_local *q = (struct at_report_local *)ctx;
@@ -225,12 +238,10 @@ static apr_status_t at_report_local_writ
 
     if (strncmp(msg, "not ok", 6) == 0) {
         q->saved_report->func(q->saved_report, msg);
-        AT->report = q->saved_report;
-        AT->fatal = q->saved_fatal;
-        apr_pool_cleanup_kill(q->pool, q, report_local_cleanup);
+        report_local_cleanup(q);
         while (AT->current++ < AT->plan) {
-            apr_snprintf(buf, 256, "not ok %d # skipped: aborting test %s",
-                     AT->prior + AT->current, AT->name);
+            at_snprintf(buf, 256, "not ok %d # skipped: aborting test %s",
+                        AT->prior + AT->current, AT->name);
             at_report(AT, buf);
         }
         longjmp(*AT->abort, 0);
@@ -239,78 +250,84 @@ static apr_status_t at_report_local_writ
         AT->current--;
         q->passed++;
     }
-    return APR_SUCCESS;
+    return AT_SUCCESS;
 }
 
-void at_report_local(at_t *AT, apr_pool_t *p, const char *file, int line)
+void at_report_local(at_t *AT, const char *file, int line)
 {
-    struct at_report_local *q = apr_palloc(p, sizeof *q);
+    struct at_report_local *q = malloc(sizeof *q);
+    size_t len;
+
     q->module.func = at_report_local_write;
     q->t = AT;
     q->saved_report = AT->report;
     q->saved_fatal = AT->fatal;
+    q->saved_skip = AT->skip;
+    q->saved_todo = AT->todo;
     q->dummy_fatal = 0;
-    q->file = apr_pstrdup(p, file);
     q->line = line;
     q->passed = 0;
-    q->pool = p;
 
-    AT->fatal = &q->dummy_fatal;
+    len = strlen(file) + 1;
+    q->file = (char*)malloc(len);
+    memcpy(q->file, file, len);
+
+    AT->fatal = AT->skip = AT->todo = &q->dummy_fatal;
     AT->report = &q->module;
 
     if (*q->saved_fatal == AT->current + 1)
         q->saved_fatal++;
 
-    apr_pool_cleanup_register(p, q, report_local_cleanup,
-                                    report_local_cleanup);
 }
 
-
-at_t *at_create(apr_pool_t *pool, unsigned char flags, at_report_t *report)
+at_t *at_create(unsigned char flags, at_report_t *report)
 {
-    at_t *t = apr_pcalloc(pool, sizeof *t);
+    at_t *t = calloc(sizeof *t, 1);
     t->flags = flags;
     t->report = report;
-    t->pool = pool;
-
-    apr_pool_cleanup_register(pool, t, test_cleanup, test_cleanup);
     return t;
 }
 
+static int* at_list(const char *spec)
+{
+    int prev, current = 0, count = 0, idx = 0, *elts;
+    const char *start = spec;
 
-#define AT_NELTS 4
+    do {
+        while (*spec && !isdigit((unsigned char)*spec))
+            ++spec;
+        prev = current;
+        current = (int)strtol(spec, (char **)(void *)&spec, 10);
+        ++count;
 
-static int* at_list(apr_pool_t *pool, const char *spec, int *list)
-{
-    apr_array_header_t arr;
-    int prev, current = 0;
+    } while (prev <= current);
 
-    arr.pool = pool;
-    arr.elt_size = sizeof *list;
-    arr.nelts = 0;
-    arr.nalloc = AT_NELTS;
-    arr.elts = (char *)list;
+    elts = malloc(++count * sizeof *elts);
+    spec = start;
+    current = 0;
 
     do {
-        while (*spec && !apr_isdigit(*spec))
+        while (*spec && !isdigit((unsigned char)*spec))
             ++spec;
-
         prev = current;
-        current = (int)apr_strtoi64(spec, (char **)(void *)&spec, 10);
-        *(int *)apr_array_push(&arr) = current;
+        current = (int)strtol(spec, (char **)(void *)&spec, 10);
+        elts[idx++] = current;
 
-    } while (prev >= current);
+    } while (prev <= current);
 
-    *(int *)apr_array_push(&arr) = 0; /* sentinel */
+    elts[idx] = 0; /* sentinel */
 
-    return (int *)arr.elts;
+    return elts;
 }
 
+#define at_free_lists do { if (flist) free((void *)flist);       \
+                           if (slist) free((void *)slist);       \
+                           if (tlist) free((void *)tlist); } while (0)
 
-
-apr_status_t at_run(at_t *AT, const at_test_t *test)
+int at_run(at_t *AT, const at_test_t *test)
 {
-    int dummy = 0, fbuf[AT_NELTS], sbuf[AT_NELTS], tbuf[AT_NELTS];
+    int dummy = 0;
+    const int *flist = NULL, *slist = NULL, *tlist = NULL;
     jmp_buf j;
 
     AT->current = 0;
@@ -319,25 +336,56 @@ apr_status_t at_run(at_t *AT, const at_t
     AT->plan    = test->plan;
 
     if (test->fatals)
-        AT->fatal = at_list(AT->pool, test->fatals, fbuf);
+        flist = AT->fatal = at_list(test->fatals);
     else
         AT->fatal = &dummy;
 
     if (test->skips)
-        AT->skip = at_list(AT->pool, test->skips, sbuf);
+        slist = AT->skip = at_list(test->skips);
     else
         AT->skip = &dummy;
 
     if (test->todos)
-        AT->todo = at_list(AT->pool, test->todos, tbuf);
+        tlist = AT->todo = at_list(test->todos);
     else
         AT->todo = &dummy;
 
     AT->abort = &j;
     if (setjmp(j) == 0) {
         test->func(AT);
-        return APR_SUCCESS;
+        at_free_lists;
+        return AT_SUCCESS;
     }
+    at_free_lists;
     AT->abort = NULL;
-    return APR_EGENERAL;
+    return AT_EGENERAL;
+}
+
+int at_snprintf(char *buf, int size, const char *format, ...)
+{
+    va_list args;
+    int status;
+    va_start(args, format);
+    status = at_vsnprintf(buf, size, format, args);
+    va_end(args);
+    return status;
 }
+
+int at_vsnprintf(char *buf, int size, const char *format, va_list args)
+{
+#ifdef _MSC_VER
+    int status = _vsnprintf(buf, size, format, args);
+    /* Make Microsoft's _vsnprintf behave like C99 vsnprintf on overflow:
+     * NULL-terminate, and return the number of chars printed minus one. */
+    if (status < 0) {
+        if (errno != EINVAL) {
+            status = size - 1;
+            buf[status] = '\0';
+        }
+    }
+    return status;
+#else 
+    return vsnprintf(buf, size, format, args);
+#endif /* _MSC_VER */
+}
+

Modified: httpd/apreq/trunk/library/t/at.h
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/at.h?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/at.h (original)
+++ httpd/apreq/trunk/library/t/at.h Wed May 18 20:00:52 2011
@@ -21,17 +21,16 @@
 #ifndef AT_H
 #define AT_H
 
-#include "apr.h"
-#include "apr_file_io.h"
 #include <stdarg.h>
 #include <stdlib.h>
 #include <setjmp.h>
-#include "apr_strings.h"
+#include <stdio.h>
+#include <string.h>
 
 typedef struct at_t at_t;
 typedef struct at_report_t at_report_t;
 
-typedef apr_status_t (*at_report_function_t)(at_report_t *r, const char *msg);
+typedef int (*at_report_function_t)(at_report_t *r, const char *msg);
 typedef void(*at_test_function_t)(at_t *t);
 typedef struct at_test_t at_test_t;
 
@@ -48,6 +47,11 @@ struct at_report_t {
     at_report_function_t func;
 };
 
+/* Private, portable snprintf implementation. 
+ */
+int at_snprintf(char *buf, int size, const char *format, ...);
+int at_vsnprintf(char *buf, int size, const char *format, va_list args); 
+
 /* We only need one at_t struct per test suite, so lets call it *AT.
  * The mnemonic we follow is that (for lowercase foo) "AT_foo(bar)"
  * should be syntactically equivalent to "at_foo(AT, bar)".
@@ -68,14 +72,13 @@ struct at_t {
     const int           *todo;    /* list of expected failures */
     at_report_t         *report  ;/* handles the results of each check */
     unsigned char        flags;   /* verbosity: concise, trace, debug, etc. */
-    apr_pool_t          *pool;    /* creator pool with end-of-test cleanup */
     jmp_buf             *abort;   /* where fatals go to die */
 };
 
 
 
-static APR_INLINE
-apr_status_t at_report(at_t *t, const char *msg) {
+static inline
+int at_report(at_t *t, const char *msg) {
     at_report_t *r = t->report;
     return r->func(r, msg);
 }
@@ -85,11 +88,11 @@ apr_status_t at_report(at_t *t, const ch
 void at_ok(at_t *t, int is_ok, const char *label, const char *file, int line);
 #define AT_ok(is_ok, label) at_ok(AT, is_ok, label, __FILE__, __LINE__)
 
-at_t *at_create(apr_pool_t *pool, unsigned char flags, at_report_t *report);
-apr_status_t at_begin(at_t *t, int total);
+at_t *at_create(unsigned char flags, at_report_t *report);
+int at_begin(at_t *t, int total);
 #define AT_begin(total) at_begin(AT, total)
 
-apr_status_t at_run(at_t *AT, const at_test_t *test);
+int at_run(at_t *AT, const at_test_t *test);
 #define AT_run(test) at_run(AT, test)
 
 void at_end(at_t *t);
@@ -118,9 +121,9 @@ void at_end(at_t *t);
 /* Additional reporting utils.
    These emit TAP comments, and are not "checks". */
 
-apr_status_t at_comment(at_t *t, const char *fmt, va_list vp);
+int at_comment(at_t *t, const char *fmt, va_list vp);
 
-static APR_INLINE
+static inline
 void at_debug(at_t *t, const char *fmt, ...) {
     va_list vp;
     va_start(vp, fmt);
@@ -129,7 +132,7 @@ void at_debug(at_t *t, const char *fmt, 
     va_end(vp);
 }
 
-static APR_INLINE
+static inline
 void at_trace(at_t *t, const char *fmt, ...) {
     va_list vp;
     va_start(vp, fmt);
@@ -141,7 +144,7 @@ void at_trace(at_t *t, const char *fmt, 
 
 /* These are "checks". */
 
-static APR_INLINE
+static inline
 void at_check(at_t *t, int is_ok, const char *label, const char *file,
            int line, const char *fmt, ...)
 {
@@ -154,11 +157,11 @@ void at_check(at_t *t, int is_ok, const 
 
         if (fmt != NULL) {
             char *f;
-            apr_snprintf(format, sizeof format, " format: %s", fmt);
+            at_snprintf(format, sizeof format, " format: %s", fmt);
             at_trace(t, "%s", format);
             memcpy(format, "   left:", 8);
             f = format + strlen(format);
-            apr_snprintf(f, sizeof format - strlen(format), "\n  right: %s", fmt);
+            at_snprintf(f, sizeof format - strlen(format), "\n  right: %s", fmt);
             at_comment(t, format, vp);
         }
     }
@@ -173,8 +176,8 @@ void at_check(at_t *t, int is_ok, const 
     char fmt[] =  ", as %u-byte struct pointers";                       \
     char buf[256] = #a " != " #b;                                       \
     const unsigned blen = sizeof(#a " != " #b);                         \
-    apr_snprintf(buf + blen - 1, 256 - blen, fmt, sz);                  \
-    apr_snprintf(fmt, sizeof(fmt), "%%.%us", sz);                       \
+    at_snprintf(buf + blen - 1, 256 - blen, fmt, sz);                   \
+    at_snprintf(fmt, sizeof(fmt), "%%.%us", sz);                        \
     at_check(AT, memcmp(left, right, sz), buf, __FILE__, __LINE__,      \
            fmt, left, right);                                           \
 } while (0)                                                             \
@@ -185,8 +188,8 @@ void at_check(at_t *t, int is_ok, const 
     char fmt[] =  ", as %u-byte struct pointers";                       \
     char buf[256] = #a " == " #b;                                       \
     const unsigned blen = sizeof(#a " == " #b);                         \
-    apr_snprintf(buf + blen - 1, 256 - blen , fmt, sz);                 \
-    apr_snprintf(fmt, sizeof(fmt), "%%.%us", sz);                       \
+    at_snprintf(buf + blen - 1, 256 - blen , fmt, sz);                  \
+    at_snprintf(fmt, sizeof(fmt), "%%.%us", sz);                        \
     at_check(AT, !memcmp(left, right, sz), buf, __FILE__, __LINE__,     \
            fmt, left, right);                                           \
 } while (0)
@@ -209,13 +212,13 @@ void at_check(at_t *t, int is_ok, const 
 #define AT_ptr_eq(a, b) do {                                    \
     const void *left = a, *right = b;                           \
     at_check(AT, left == right, #a " == " #b ", as pointers",   \
-            __FILE__, __LINE__, "%pp", left, right);            \
+            __FILE__, __LINE__, "%p", left, right);             \
 } while (0)
 
 #define AT_ptr_ne(a, b) do {                                    \
     const void *left = a, *right = b;                           \
     at_check(AT, left != right, #a " != " #b ", as pointers",   \
-            __FILE__, __LINE__, "%pp", left, right);            \
+            __FILE__, __LINE__, "%p", left, right);             \
 } while (0)
 
 
@@ -245,13 +248,13 @@ void at_check(at_t *t, int is_ok, const 
                                   __FILE__, __LINE__, fmt, a, b)
 
 
-static APR_INLINE
+static inline
 void at_skip(at_t *t, int n, const char *reason, const char *file, int line) {
     char buf[256];
     while (n-- > 0) {
         ++t->current;
-        apr_snprintf(buf, 256, "ok %d - %s (%d) #skipped: %s (%s:%d)",
-                     t->current + t->prior, t->name, t->current, reason, file, line);
+        at_snprintf(buf, 256, "ok %d - %s (%d) #skipped: %s (%s:%d)",
+                    t->current + t->prior, t->name, t->current, reason, file, line);
         at_report(t, buf);
     }
 }
@@ -261,17 +264,18 @@ void at_skip(at_t *t, int n, const char 
 
 /* Report utilities. */
 
-at_report_t *at_report_file_make(apr_pool_t *p, apr_file_t *f);
-APR_INLINE
-static at_report_t *at_report_stdout_make(apr_pool_t *p)
+at_report_t *at_report_file_make(FILE *f);
+inline
+static at_report_t *at_report_stdout_make(void)
 {
-    apr_file_t *out;
-    apr_file_open_stdout(&out, p);
-    return at_report_file_make(p, out);
+    return at_report_file_make(stdout);
 }
+void at_report_file_cleanup(at_report_t *r);
+#define at_report_stdout_cleanup(r) at_report_file_cleanup(r)
 
-void at_report_local(at_t *AT, apr_pool_t *p, const char *file, int line);
-#define AT_localize(p) at_report_local(AT, p, __FILE__, __LINE__)
-
+void at_report_local(at_t *AT, const char *file, int line);
+#define AT_localize() at_report_local(AT, __FILE__, __LINE__)
+void at_report_delocalize(at_t *AT);
+#define AT_delocalize() at_report_delocalize(AT)
 
 #endif /* AT_H */

Modified: httpd/apreq/trunk/library/t/cookie.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/cookie.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/cookie.c (original)
+++ httpd/apreq/trunk/library/t/cookie.c Wed May 18 20:00:52 2011
@@ -230,8 +230,8 @@ int main(int argc, char *argv[])
 
     apr_pool_create(&p, NULL);
 
-    AT = at_create(p, 0, at_report_stdout_make(p));
-
+    AT = at_create(0, at_report_stdout_make());
+    AT_trace_on();
     for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
         plan += test_list[i].plan;
 

Modified: httpd/apreq/trunk/library/t/error.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/error.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/error.c (original)
+++ httpd/apreq/trunk/library/t/error.c Wed May 18 20:00:52 2011
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
 
     apr_pool_create(&p, NULL);
 
-    AT = at_create(p, 0, at_report_stdout_make(p));
+    AT = at_create(0, at_report_stdout_make());
 
     for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
         plan += test_list[i].plan;

Modified: httpd/apreq/trunk/library/t/params.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/params.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/params.c (original)
+++ httpd/apreq/trunk/library/t/params.c Wed May 18 20:00:52 2011
@@ -212,7 +212,7 @@ int main(int argc, char *argv[])
 
     apreq_initialize(p);
 
-    AT = at_create(p, 0, at_report_stdout_make(p));
+    AT = at_create(0, at_report_stdout_make());
     AT_trace_on();
     for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
         plan += test_list[i].plan;

Modified: httpd/apreq/trunk/library/t/parsers.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/parsers.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/parsers.c (original)
+++ httpd/apreq/trunk/library/t/parsers.c Wed May 18 20:00:52 2011
@@ -189,7 +189,7 @@ static void parse_multipart(dAT)
          * when this many (~1M) tests are involved.
          */
 
-        AT_localize(p);
+        AT_localize();
 
         for (i = 0; i <= strlen(form_data); ++i) {
             const char *val;
@@ -261,6 +261,7 @@ static void parse_multipart(dAT)
 #ifdef APR_POOL_DEBUG
         apr_bucket_alloc_destroy(ba);
 #endif
+        AT_delocalize();
         apr_pool_clear(p);
     }
 }
@@ -536,7 +537,7 @@ int main(int argc, char *argv[])
     apreq_initialize(p);
 
 
-    AT = at_create(test_pool, 0, at_report_stdout_make(test_pool));
+    AT = at_create(0, at_report_stdout_make());
 
     for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
         plan += test_list[i].plan;

Modified: httpd/apreq/trunk/library/t/util.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/util.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/util.c (original)
+++ httpd/apreq/trunk/library/t/util.c Wed May 18 20:00:52 2011
@@ -324,7 +324,7 @@ int main(int argc, char *argv[])
 
     apr_pool_create(&p, NULL);
 
-    AT = at_create(p, 0, at_report_stdout_make(p));
+    AT = at_create(0, at_report_stdout_make());
 
     for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
         plan += test_list[i].plan;

Modified: httpd/apreq/trunk/library/t/version.c
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/library/t/version.c?rev=1124400&r1=1124399&r2=1124400&view=diff
==============================================================================
--- httpd/apreq/trunk/library/t/version.c (original)
+++ httpd/apreq/trunk/library/t/version.c Wed May 18 20:00:52 2011
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
 
     apr_pool_create(&p, NULL);
 
-    AT = at_create(p, 0, at_report_stdout_make(p));
+    AT = at_create(0, at_report_stdout_make());
 
     for (i = 0; i < sizeof(test_list) / sizeof(at_test_t);  ++i)
         plan += test_list[i].plan;