Author: joes
Date: Thu Feb 24 14:27:51 2005
New Revision: 155263
URL: http://svn.apache.org/viewcvs?view=rev&rev=155263
Log:
Some at.c fixes, hoping this will help shake out the
locate_default_parsers WinFU.
Modified:
httpd/apreq/branches/multi-env-unstable/library/t/at.c
httpd/apreq/branches/multi-env-unstable/library/t/at.h
httpd/apreq/branches/multi-env-unstable/library/t/parsers.c
Modified: httpd/apreq/branches/multi-env-unstable/library/t/at.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/t/at.c?view=diff&r1=155262&r2=155263
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/t/at.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/t/at.c Thu Feb 24 14:27:51
2005
@@ -56,19 +56,22 @@
if (rv <= 0)
return APR_EINVAL;
+
end = b + rv;
buf[0] = '#';
buf[1] = ' ';
if (rv == 250) {
+ end[-1] = '.';
*end++ = '.';
*end++ = '.';
- *end++ = '.';
- *end = '\n';
+ *end++ = '\n';
+ *end = 0;
}
else if (end[-1] != '\n') {
- *end = '\n';
+ *end++ = '\n';
+ *end = 0;
}
b = buf;
@@ -76,10 +79,9 @@
char *eol;
eol = strchr(b + 2, '\n');
- assert(eol != NULL);
*eol = 0;
s = at_report(t, b);
- if (s != APR_SUCCESS || eol == end)
+ if (s != APR_SUCCESS || eol == end - 1)
break;
b = eol - 1;
@@ -234,8 +236,10 @@
}
longjmp(*AT->abort, 0);
}
- AT->current--;
- q->passed++;
+ else if (strncmp(msg, "ok", 2) == 0) {
+ AT->current--;
+ q->passed++;
+ }
return APR_SUCCESS;
}
Modified: httpd/apreq/branches/multi-env-unstable/library/t/at.h
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/t/at.h?view=diff&r1=155262&r2=155263
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/t/at.h (original)
+++ httpd/apreq/branches/multi-env-unstable/library/t/at.h Thu Feb 24 14:27:51
2005
@@ -148,18 +148,15 @@
va_start(vp, fmt);
if (AT_FLAG_TRACE(t->flags)) {
- char format[64] = "testing: %s (%s:%d)";
- at_trace(t, format, label, file, line);
+ char format[32] = "testing: %s (%s:%d)";
+ at_trace(t, format, label, file, line);
if (fmt != NULL) {
- char *f;
- at_trace(t, " format: %s", fmt);
- strcpy(format, " left: ");
- strcpy(format + sizeof(" left: ") -1, fmt);
- f = format + strlen(format);
- strcpy(f+1, format);
- *f = '\n';
- memcpy(f+1, " right: ", sizeof(" right: ") -1);
+ apr_snprintf(format, sizeof format, " format: %s", fmt);
+ at_trace(t, "%s", format);
+ memcpy(format, " left:", 8);
+ at_comment(t, format, vp);
+ memcpy(format, " right:", 8);
at_comment(t, format, vp);
}
}
Modified: httpd/apreq/branches/multi-env-unstable/library/t/parsers.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/t/parsers.c?view=diff&r1=155262&r2=155263
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/t/parsers.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/t/parsers.c Thu Feb 24
14:27:51 2005
@@ -110,17 +110,19 @@
{
apreq_parser_function_t f;
- /* initialize default-parser hash */
- apreq_register_parser(NULL, NULL);
-
+ AT_trace_on();
+
f = apreq_parser(URL_ENCTYPE);
- AT_EQ(f, apreq_parse_urlencoded, "%pp");
+ AT_EQ(f, (apreq_parser_function_t)apreq_parse_urlencoded, "%pp");
f = apreq_parser(MFD_ENCTYPE);
- AT_EQ(f, apreq_parse_multipart, "%pp");
+ AT_EQ(f, (apreq_parser_function_t)apreq_parse_multipart, "%pp");
f = apreq_parser(MR_ENCTYPE);
- AT_EQ(f, apreq_parse_multipart, "%pp");
+ AT_EQ(f, (apreq_parser_function_t)apreq_parse_multipart, "%pp");
+
+ AT_trace_off();
+
}
static void parse_urlencoded(dAT)
@@ -512,7 +514,7 @@
AT = at_create(test_pool, 0, at_report_stdout_make(test_pool));
-// AT_trace_on();
+
for (i = 0; i < sizeof(test_list) / sizeof(at_test_t); ++i)
plan += test_list[i].plan;