Revision: 14649
Author: adrian.chadd
Date: Wed May 12 21:06:18 2010
Log: Another test case, content-length.
http://code.google.com/p/lusca-cache/source/detail?r=14649
Modified:
/branches/LUSCA_HEAD/test-suite/atf/libhttp.c
=======================================
--- /branches/LUSCA_HEAD/test-suite/atf/libhttp.c Wed May 12 19:50:37 2010
+++ /branches/LUSCA_HEAD/test-suite/atf/libhttp.c Wed May 12 21:06:18 2010
@@ -62,11 +62,6 @@
ATF_TC_BODY(libhttp_parse_1, tc)
{
HttpHeader hdr;
-#if 0
- HttpHeaderPos pos = HttpHeaderInitPos;
- const HttpHeaderEntry *e;
-#endif
-
const char *hdrs = "Host: www.creative.net.au\r\nContent-type:
text/html\r\nFoo: bar\r\n\r\n";
const char *hdr_start = hdrs;
const char *hdr_end = hdr_start + strlen(hdrs);
@@ -84,6 +79,33 @@
ATF_TC_CLEANUP(libhttp_parse_1, tc)
{
}
+
+ATF_TC_WITH_CLEANUP(libhttp_parse_2);
+ATF_TC_HEAD(libhttp_parse_2, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "content-length header parsing");
+}
+
+ATF_TC_BODY(libhttp_parse_2, tc)
+{
+ HttpHeader hdr;
+ const char *hdrs = "Host: www.creative.net.au\r\nContent-Length:
12345\r\nContent-type: text/html\r\nFoo: bar\r\n\r\n";
+ const char *hdr_start = hdrs;
+ const char *hdr_end = hdr_start + strlen(hdrs);
+
+ test_core_init();
+
+ httpHeaderInitLibrary();
+ httpHeaderInit(&hdr, hoRequest);
+
+ ATF_REQUIRE(httpHeaderParse(&hdr, hdr_start, hdr_end) == 1);
+
+ httpHeaderClean(&hdr);
+}
+
+ATF_TC_CLEANUP(libhttp_parse_2, tc)
+{
+}
extern int hh_check_content_length(HttpHeader *hdr, const char *val, int
vlen);
@@ -158,6 +180,7 @@
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, libhttp_parse_1);
+ ATF_TP_ADD_TC(tp, libhttp_parse_2);
ATF_TP_ADD_TC(tp, libhttp_parse_content_length_1);
return atf_no_error();
}
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.