Revision: 14809
Author: adrian.chadd
Date: Mon Oct 18 20:30:14 2010
Log: * add > 32 bit file size in the test suite
* and add the parse return codes = 0, 1, -1 aren't really "right" any
longer.
http://code.google.com/p/lusca-cache/source/detail?r=14809
Modified:
/branches/LUSCA_HEAD/test-suite/atf/libhttp.c
=======================================
--- /branches/LUSCA_HEAD/test-suite/atf/libhttp.c Mon Oct 18 20:17:32 2010
+++ /branches/LUSCA_HEAD/test-suite/atf/libhttp.c Mon Oct 18 20:30:14 2010
@@ -114,7 +114,15 @@
/* ** */
-extern int hh_check_content_length(HttpHeader *hdr, const char *val, int
vlen);
+/* XXX should be in an include file from libhttp! */
+typedef enum {
+ PR_NONE,
+ PR_ERROR,
+ PR_IGNORE,
+ PR_WARN,
+ PR_OK
+} parse_retval_t;
+extern parse_retval_t hh_check_content_length(HttpHeader *hdr, const char
*val, int vlen);
static int
test_core_parse_header(HttpHeader *hdr, const char *hdrs)
@@ -151,7 +159,7 @@
httpHeaderClean(&hdr);
}
-static int
+static parse_retval_t
test_http_content_length(HttpHeader *hdr, const char *str)
{
int r;
@@ -254,11 +262,11 @@
httpHeaderInitLibrary();
httpHeaderInit(&hdr, hoRequest);
- ATF_REQUIRE(test_http_content_length(&hdr, "12345") == 1);
- ATF_REQUIRE(test_http_content_length(&hdr, "123b5") == 1);
- ATF_REQUIRE(test_http_content_length(&hdr, "b1234") == -1);
- ATF_REQUIRE(test_http_content_length(&hdr, "abcde") == -1);
- ATF_REQUIRE(test_http_content_length(&hdr, "4790023270") == 1);
+ ATF_REQUIRE(test_http_content_length(&hdr, "12345") == PR_OK);
+ ATF_REQUIRE(test_http_content_length(&hdr, "123b5") == PR_OK);
+ ATF_REQUIRE(test_http_content_length(&hdr, "b1234") == PR_ERROR);
+ ATF_REQUIRE(test_http_content_length(&hdr, "abcde") == PR_ERROR);
+ ATF_REQUIRE(test_http_content_length(&hdr, "4790023270") == PR_OK);
/* Clean up */
httpHeaderClean(&hdr);
--
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.