randyk 2004/07/17 21:19:28
Modified: . STATUS
t parsers.c
Log:
add tests for apreq_enctype.
Revision Changes Path
1.73 +1 -2 httpd-apreq-2/STATUS
Index: STATUS
===================================================================
RCS file: /home/cvs/httpd-apreq-2/STATUS,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- STATUS 18 Jul 2004 03:49:49 -0000 1.72
+++ STATUS 18 Jul 2004 04:19:28 -0000 1.73
@@ -61,7 +61,6 @@
- The current tests don't cover these functions,
so add CuTest tests for them:
- apreq_merge_values()
- - apreq_enctype()
- apreq_memmem()
- CuTest needs va_arg to print comments for a failed unit test.
1.18 +9 -1 httpd-apreq-2/t/parsers.c
Index: parsers.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/t/parsers.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- parsers.c 9 Jul 2004 23:00:39 -0000 1.17
+++ parsers.c 18 Jul 2004 04:19:28 -0000 1.18
@@ -43,8 +43,12 @@
const char *val;
apreq_request_t *req = apreq_request(APREQ_URL_ENCTYPE,"");
apr_status_t rv;
+ const char *enctype;
CuAssertPtrNotNull(tc, req);
+ enctype = apreq_enctype(req->env);
+ CuAssertStrEquals(tc, APREQ_URL_ENCTYPE, enctype);
+
bb = apr_brigade_create(p, apr_bucket_alloc_create(p));
APR_BRIGADE_INSERT_HEAD(bb,
@@ -80,14 +84,18 @@
apr_size_t len;
apr_table_t *t;
apr_status_t rv;
+ const char *enctype;
apreq_request_t *req = apreq_request(APREQ_MFD_ENCTYPE
"; charset=\"iso-8859-1\"; boundary=\"AaB03x\""
,"");
apr_bucket_brigade *bb = apr_brigade_create(p,
apr_bucket_alloc_create(p));
- int j;
+ apr_size_t j;
CuAssertPtrNotNull(tc, req);
CuAssertStrEquals(tc, req->env, apreq_env_content_type(req->env));
+
+ enctype = apreq_enctype(req->env);
+ CuAssertStrEquals(tc, APREQ_MFD_ENCTYPE, enctype);
/* strlen(form_data) == 319 */
for (j = 0; j <= strlen(form_data); ++j) {