Patch file generated Sun Feb 3 19:14:53 NZDT 2008 from CVS branch ayjwork CVS base branch HEAD CVS repository: amosjeffries@cvs.devel.squid-cache.org:/cvsroot/squid CVS module: squid3 Fixes many Unit-test compile errors and testing problems in HttpRequestMethod - Removes implicit conversion from HttpRequestMethod to other types. - Adds id() accessor to retrieve an ID for known methods. - Adds more boolean operators to class library Also adds auto-documantation in some METHOD-related places. cvs -q rdiff -u -kk -r Z-ayjwork_merge_HEAD -r ayjwork squid3 Index: squid3/src/ACLMethodData.cc diff -u squid3/src/ACLMethodData.cc:1.9 squid3/src/ACLMethodData.cc:1.8.8.2 --- squid3/src/ACLMethodData.cc:1.9 Sun Jan 20 01:50:56 2008 +++ squid3/src/ACLMethodData.cc Sat Feb 2 20:38:59 2008 @@ -54,10 +54,11 @@ delete values; } +/// todo make this a pass-by-reference now that HTTPRequestMethods a full class? bool ACLMethodData::match(HttpRequestMethod toFind) { - return values->findAndTune (toFind); + return values->findAndTune(toFind); } /* explicit instantiation required for some systems */ @@ -89,7 +90,7 @@ ; while ((t = strtokFile())) { - List *q = new List (HttpRequestMethod(t)); + List *q = new List (HttpRequestMethod(t, NULL)); *(Tail) = q; Tail = &q->next; } Index: squid3/src/HttpReply.cc diff -u squid3/src/HttpReply.cc:1.45 squid3/src/HttpReply.cc:1.38.4.11 --- squid3/src/HttpReply.cc:1.45 Sun Jan 20 01:50:56 2008 +++ squid3/src/HttpReply.cc Sat Feb 2 20:38:59 2008 @@ -420,7 +420,7 @@ { if (sline.version.major < 1) return -1; - else if (METHOD_HEAD == method) + else if (method.id() == METHOD_HEAD) return 0; else if (sline.status == HTTP_OK) (void) 0; /* common case, continue */ Index: squid3/src/HttpRequest.cc diff -u squid3/src/HttpRequest.cc:1.45 squid3/src/HttpRequest.cc:1.37.4.9 --- squid3/src/HttpRequest.cc:1.45 Sun Jan 20 01:50:56 2008 +++ squid3/src/HttpRequest.cc Sat Feb 2 20:38:59 2008 @@ -143,13 +143,14 @@ bool HttpRequest::sanityCheckStartLine(MemBuf *buf, http_status *error) { - /* + /** * Just see if the request buffer starts with a known * HTTP request method. NOTE this whole function is somewhat * superfluous and could just go away. + \todo AYJ: Check for safely removing this function. We now accept 'unknown' request methods in HTTP. */ - if (METHOD_NONE == HttpRequestMethod(buf->content())) { + if (HttpRequestMethod(buf->content(),NULL) == METHOD_NONE) { debugs(73, 3, "HttpRequest::sanityCheckStartLine: did not find HTTP request method"); return false; } @@ -163,7 +164,7 @@ const char *t = start + strcspn(start, w_space); method = HttpRequestMethod(start, t); - if (METHOD_NONE == method) + if (method == METHOD_NONE) return false; start = t + strspn(t, w_space); Index: squid3/src/HttpRequestMethod.cc diff -u squid3/src/HttpRequestMethod.cc:1.5 squid3/src/HttpRequestMethod.cc:1.2.4.4 --- squid3/src/HttpRequestMethod.cc:1.5 Sun Jan 20 01:50:56 2008 +++ squid3/src/HttpRequestMethod.cc Sat Feb 2 20:38:59 2008 @@ -144,6 +144,7 @@ theImage.limitInit(begin,end-begin); } +/** \todo AYJ: this _should_ be obsolete. Since all such methods fit nicely into METHOD_OTHER now. */ void HttpRequestMethod::AddExtension(const char *mstr) { @@ -187,17 +188,18 @@ } char const* -HttpRequestMethod::image() const -{ - if (METHOD_OTHER != theMethod) { - return RequestMethodStr[theMethod]; - } - else { - if (theImage.size()>0) - return theImage.buf(); - else - return "METHOD_OTHER"; - } +HttpRequestMethod::image() const +{ + if (METHOD_OTHER != theMethod) { + return RequestMethodStr[theMethod]; + } + else { + if (theImage.size()>0) { + return theImage.buf(); + } else { + return "METHOD_OTHER"; + } + } } bool Index: squid3/src/HttpRequestMethod.h diff -u squid3/src/HttpRequestMethod.h:1.5 squid3/src/HttpRequestMethod.h:1.2.4.4 --- squid3/src/HttpRequestMethod.h:1.5 Sun Jan 20 20:51:29 2008 +++ squid3/src/HttpRequestMethod.h Sat Feb 2 20:38:59 2008 @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -93,15 +92,16 @@ }; /* forward decls */ - typedef struct _SquidConfig SquidConfig; -/* This class represents an HTTP Request METHOD - i.e. - * PUT, POST, GET etc. It has a runtime extensionf acility to allow it to +/** + * This class represents an HTTP Request METHOD + * - i.e. PUT, POST, GET etc. + * It has a runtime extension facility to allow it to * efficiently support new methods + \ingroup POD */ - class HttpRequestMethod { @@ -109,14 +109,18 @@ static void AddExtension(const char *methodString); static void Configure(SquidConfig &Config); - HttpRequestMethod() : theMethod(METHOD_NONE) {} + HttpRequestMethod() : theMethod(METHOD_NONE), theImage() {} - HttpRequestMethod(_method_t const aMethod) : theMethod(aMethod) {} + HttpRequestMethod(_method_t const aMethod) : theMethod(aMethod), theImage() {} - HttpRequestMethod(char const * begin, char const * end=0); + /** + \param begin string to convert to request method. + \param end end of the method string (relative to begin). Use NULL if this is unknown. + * + \note DO NOT give end a default (ie NULL). That will cause silent char* conversion clashes. + */ + HttpRequestMethod(char const * begin, char const * end); - operator _method_t() const {return theMethod; } - HttpRequestMethod & operator = (const HttpRequestMethod& aMethod) { theMethod = aMethod.theMethod; @@ -131,38 +135,49 @@ return *this; } - bool operator != (_method_t const & aMethod) { return theMethod != aMethod;} - bool operator != (HttpRequestMethod const & aMethod) - { - return ( (theMethod != aMethod) || (theImage != aMethod.theImage) ); + bool operator == (_method_t const & aMethod) const { return theMethod == aMethod; } + bool operator == (HttpRequestMethod const & aMethod) const + { + return ( (theMethod == aMethod.theMethod) || (theImage == aMethod.theImage) ); + } + + bool operator != (_method_t const & aMethod) const { return theMethod != aMethod; } + bool operator != (HttpRequestMethod const & aMethod) const + { + return ( (theMethod != aMethod.theMethod) || (theImage != aMethod.theImage) ); } - + + /** Iterate through the registered HTTP methods. */ HttpRequestMethod& operator++() { - if (METHOD_OTHER!=theMethod) - { - int tmp = (int)theMethod; - _method_t tmp_m = (_method_t)(++tmp); - - if (METHOD_ENUM_END >= tmp_m) - theMethod = tmp_m; + if(METHOD_OTHER != theMethod) { + int tmp = (int)theMethod; + _method_t tmp_m = (_method_t)(++tmp); + + if (METHOD_ENUM_END >= tmp_m) + theMethod = tmp_m; } return *this; } + /** Get an ID representation of the method. + \retval METHOD_NONE the methopd is currently unset or unknown. + \retval METHOD_UNKNOWN the method has been accepted but is not one of the registerd HTTP methods. + \retval * the method is on of the registered HTTP methods. + */ + _method_t const id() const { return theMethod; } - /* Get a char string representation of the method. */ + /** Get a char string representation of the method. */ char const* image() const; - + bool isCacheble() const; private: - static const char *RequestMethodStr[]; - - _method_t theMethod; ///< Method type - String theImage; ///< Used for store METHOD_OTHER only -}; + static const char *RequestMethodStr[]; + _method_t theMethod; ///< Method type + String theImage; ///< Used for store METHOD_OTHER only +}; inline std::ostream & operator << (std::ostream &os, HttpRequestMethod const &method) Index: squid3/src/client_side.cc diff -u squid3/src/client_side.cc:1.144 squid3/src/client_side.cc:1.119.2.13 --- squid3/src/client_side.cc:1.144 Sun Jan 20 01:50:56 2008 +++ squid3/src/client_side.cc Sat Feb 2 20:38:59 2008 @@ -667,7 +667,7 @@ static int clientIsContentLengthValid(HttpRequest * r) { - switch (r->method) { + switch (r->method.id()) { case METHOD_PUT: Index: squid3/src/client_side_reply.cc diff -u squid3/src/client_side_reply.cc:1.123 squid3/src/client_side_reply.cc:1.90.4.15 --- squid3/src/client_side_reply.cc:1.123 Tue Jan 22 12:50:40 2008 +++ squid3/src/client_side_reply.cc Sat Feb 2 20:38:59 2008 @@ -677,8 +677,8 @@ purgeRequest(); return; } - - if (METHOD_OTHER == r->method) { + + if (r->method == METHOD_OTHER) { // invalidate all cache entries purgeAllCached(); } Index: squid3/src/client_side_request.cc diff -u squid3/src/client_side_request.cc:1.87 squid3/src/client_side_request.cc:1.66.4.17 --- squid3/src/client_side_request.cc:1.87 Sun Jan 20 01:50:56 2008 +++ squid3/src/client_side_request.cc Sat Feb 2 20:39:00 2008 @@ -656,8 +656,8 @@ } } } - - if (METHOD_OTHER == request->method) { + + if (request->method == METHOD_OTHER) { no_cache++; } @@ -1126,7 +1126,7 @@ xfree(uri); uri = xstrdup(urlCanonical(request)); setLogUri(this, urlCanonicalClean(request)); - assert(request->method); + assert(request->method.id()); } else if (HttpReply *new_rep = dynamic_cast(msg)) { debugs(85,3,HERE << "REQMOD reply is HTTP reply"); Index: squid3/src/forward.cc diff -u squid3/src/forward.cc:1.78 squid3/src/forward.cc:1.64.2.9 --- squid3/src/forward.cc:1.78 Sun Jan 20 10:51:12 2008 +++ squid3/src/forward.cc Sat Feb 2 20:39:00 2008 @@ -464,13 +464,13 @@ return false; /* RFC2616 9.1 Safe and Idempotent Methods */ - switch (request->method) { + switch (request->method.id()) { /* 9.1.1 Safe Methods */ case METHOD_GET: case METHOD_HEAD: - /* 9.1.2 Indepontent Methods */ + /* 9.1.2 Idempotent Methods */ case METHOD_PUT: Index: squid3/src/htcp.cc diff -u squid3/src/htcp.cc:1.36 squid3/src/htcp.cc:1.29.4.6 --- squid3/src/htcp.cc:1.36 Sun Jan 20 01:50:57 2008 +++ squid3/src/htcp.cc Sat Feb 2 20:39:00 2008 @@ -762,7 +762,7 @@ /* * Parse the request */ - method = HttpRequestMethod(s->method); + method = HttpRequestMethod(s->method, NULL); s->request = HttpRequest::CreateFromUrlAndMethod(s->uri, method == METHOD_NONE ? HttpRequestMethod(METHOD_GET) : method); Index: squid3/src/http.cc diff -u squid3/src/http.cc:1.129 squid3/src/http.cc:1.99.2.16 --- squid3/src/http.cc:1.129 Sun Jan 20 01:50:57 2008 +++ squid3/src/http.cc Sat Feb 2 20:39:01 2008 @@ -200,12 +200,8 @@ static void httpMaybeRemovePublic(StoreEntry * e, http_status status) { - - int remove - = 0; - + int remove = 0; int forbidden = 0; - StoreEntry *pe; if (!EBIT_TEST(e->flags, KEY_PRIVATE)) @@ -226,9 +222,7 @@ case HTTP_GONE: case HTTP_NOT_FOUND: - - remove - = 1; + remove = 1; break; @@ -255,16 +249,14 @@ */ if (status >= 200 && status < 300) - remove - = 1; + remove = 1; #endif break; } - if (!remove - && !forbidden) + if (!remove && !forbidden) return; assert(e->mem_obj); @@ -279,7 +271,7 @@ pe->release(); } - /* + /** \par * Also remove any cached HEAD response in case the object has * changed. */ @@ -296,7 +288,9 @@ if (forbidden) return; - switch (e->mem_obj->method) { + /// \todo AYJ: given the coment below + new behaviour of accepting METHOD_UNKNOWN, should we invert this test + /// removing the object unless the method is nown to be safely kept? + switch (e->mem_obj->method.id()) { case METHOD_PUT: @@ -311,8 +305,8 @@ case METHOD_BMOVE: case METHOD_BDELETE: - /* - * Remove any cached GET object if it is beleived that the + /** \par + * Remove any cached GET object if it is believed that the * object may have changed as a result of other methods */ Index: squid3/src/store_key_md5.cc diff -u squid3/src/store_key_md5.cc:1.11 squid3/src/store_key_md5.cc:1.7.8.4 --- squid3/src/store_key_md5.cc:1.11 Sun Jan 20 01:50:58 2008 +++ squid3/src/store_key_md5.cc Sat Feb 2 20:39:02 2008 @@ -117,7 +117,7 @@ storeKeyPublic(const char *url, const HttpRequestMethod& method) { static cache_key digest[SQUID_MD5_DIGEST_LENGTH]; - unsigned char m = (unsigned char) method; + unsigned char m = (unsigned char) method.id(); SquidMD5_CTX M; SquidMD5Init(&M); SquidMD5Update(&M, &m, sizeof(m)); @@ -136,7 +136,7 @@ storeKeyPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method) { static cache_key digest[SQUID_MD5_DIGEST_LENGTH]; - unsigned char m = (unsigned char) method; + unsigned char m = (unsigned char) method.id(); const char *url = urlCanonical(request); SquidMD5_CTX M; SquidMD5Init(&M); Index: squid3/src/url.cc diff -u squid3/src/url.cc:1.23 squid3/src/url.cc:1.17.4.8 --- squid3/src/url.cc:1.23 Sun Jan 20 01:50:58 2008 +++ squid3/src/url.cc Sat Feb 2 20:39:02 2008 @@ -430,6 +430,7 @@ urlCanonical(HttpRequest * request) { LOCAL_ARRAY(char, portbuf, 32); +/// \todo AYJ: Performance: making this a ptr and allocating when needed will be better than a write and future xstrdup(). LOCAL_ARRAY(char, urlbuf, MAX_URL); if (request->canonical) @@ -438,7 +439,8 @@ if (request->protocol == PROTO_URN) { snprintf(urlbuf, MAX_URL, "urn:%s", request->urlpath.buf()); } else { - switch (request->method) { +/// \todo AYJ: this could use "if..else and method == METHOD_CONNECT" easier. + switch (request->method.id()) { case METHOD_CONNECT: snprintf(urlbuf, MAX_URL, "%s:%d", request->GetHost(), request->port); @@ -465,6 +467,10 @@ return (request->canonical = xstrdup(urlbuf)); } +/** \todo AYJ: Performance: This is an *almost* duplicate of urlCanoncical. But elides the query-string. + * After copying it on in the first place! Would be less code to merge the two with a flag parameter. + * and never copy the query-string part in the first place + */ char * urlCanonicalClean(const HttpRequest * request) { @@ -476,7 +482,8 @@ if (request->protocol == PROTO_URN) { snprintf(buf, MAX_URL, "urn:%s", request->urlpath.buf()); } else { - switch (request->method) { +/// \todo AYJ: this could use "if..else and method == METHOD_CONNECT" easier. + switch (request->method.id()) { case METHOD_CONNECT: snprintf(buf, MAX_URL, "%s:%d", Index: squid3/src/tests/testHttpRequest.cc diff -u squid3/src/tests/testHttpRequest.cc:1.5 squid3/src/tests/testHttpRequest.cc:1.1.18.6 --- squid3/src/tests/testHttpRequest.cc:1.5 Fri Dec 14 15:51:09 2007 +++ squid3/src/tests/testHttpRequest.cc Sat Feb 2 20:39:03 2008 @@ -36,7 +36,7 @@ expected_port = 90; HttpRequest *nullRequest = NULL; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_GET); CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); @@ -48,7 +48,7 @@ aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_PUT); expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_PUT, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_PUT); CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); @@ -65,7 +65,7 @@ aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_CONNECT); expected_port = 45; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_CONNECT, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_CONNECT); CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String(""), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_NONE, aRequest->protocol); @@ -85,7 +85,7 @@ HttpRequest *aRequest = HttpRequest::CreateFromUrl(url); expected_port = 90; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_GET); CPPUNIT_ASSERT_EQUAL(String("foo"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/bar"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); @@ -108,7 +108,7 @@ aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_GET); expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_GET); CPPUNIT_ASSERT_EQUAL(String("[2000:800::45]"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/foo"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); @@ -120,7 +120,7 @@ aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_GET); expected_port = 90; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_GET); CPPUNIT_ASSERT_EQUAL(String("[2000:800::45]"), String(aRequest->GetHost())); CPPUNIT_ASSERT_EQUAL(String("/foo"), aRequest->urlpath); CPPUNIT_ASSERT_EQUAL(PROTO_HTTP, aRequest->protocol); @@ -132,7 +132,7 @@ aRequest = HttpRequest::CreateFromUrlAndMethod(url, METHOD_GET); expected_port = 80; CPPUNIT_ASSERT_EQUAL(expected_port, aRequest->port); - CPPUNIT_ASSERT_EQUAL(METHOD_GET, aRequest->method); + CPPUNIT_ASSERT(aRequest->method == METHOD_GET); #if USE_IPV6 /* We hasve fixed this in IPv6 build. */ CPPUNIT_ASSERT_EQUAL(String("[2000:800::45]"), String(aRequest->GetHost())); Index: squid3/src/tests/testHttpRequestMethod.cc diff -u squid3/src/tests/testHttpRequestMethod.cc:1.5 squid3/src/tests/testHttpRequestMethod.cc:1.2.8.5 --- squid3/src/tests/testHttpRequestMethod.cc:1.5 Sun Jan 20 01:50:58 2008 +++ squid3/src/tests/testHttpRequestMethod.cc Sat Feb 2 20:39:03 2008 @@ -17,10 +17,10 @@ testHttpRequestMethod::testConstructCharStart() { /* parse an empty string -> METHOD_NONE */ - CPPUNIT_ASSERT(METHOD_NONE == HttpRequestMethod(NULL)); + CPPUNIT_ASSERT(HttpRequestMethod(NULL,NULL) == METHOD_NONE); /* parsing a literal should work */ - CPPUNIT_ASSERT(METHOD_GET == HttpRequestMethod("GET", NULL)); - CPPUNIT_ASSERT(METHOD_OTHER == HttpRequestMethod("QWERTY", NULL)); + CPPUNIT_ASSERT(HttpRequestMethod("GET", NULL) == METHOD_GET); + CPPUNIT_ASSERT(HttpRequestMethod("QWERTY", NULL) == METHOD_OTHER); } /* @@ -31,12 +31,12 @@ { char const * buffer; /* parse an empty string -> METHOD_NONE */ - CPPUNIT_ASSERT(METHOD_NONE == HttpRequestMethod(NULL, NULL)); + CPPUNIT_ASSERT(HttpRequestMethod(NULL, NULL) == METHOD_NONE); /* parsing a literal should work */ - CPPUNIT_ASSERT(METHOD_GET == HttpRequestMethod("GET", NULL)); + CPPUNIT_ASSERT(HttpRequestMethod("GET", NULL) == METHOD_GET); /* parsing with an explicit end should work */ buffer = "POSTPLUS"; - CPPUNIT_ASSERT(METHOD_POST == HttpRequestMethod(buffer, buffer + 4)); + CPPUNIT_ASSERT(HttpRequestMethod(buffer, buffer + 4) == METHOD_POST); } /* @@ -78,9 +78,9 @@ * we should be able to get a char const * version of the method. */ void -testHttpRequestMethod::testConst_str() +testHttpRequestMethod::testImage() { - CPPUNIT_ASSERT_EQUAL(String("POST"), String(HttpRequestMethod("post").const_str())); + CPPUNIT_ASSERT_EQUAL(String("POST"), String(HttpRequestMethod("post",NULL).image())); } /* @@ -92,8 +92,8 @@ { CPPUNIT_ASSERT(HttpRequestMethod(METHOD_NONE) == METHOD_NONE); CPPUNIT_ASSERT(not (HttpRequestMethod(METHOD_POST) == METHOD_GET)); - CPPUNIT_ASSERT(METHOD_GET == HttpRequestMethod(METHOD_GET)); - CPPUNIT_ASSERT(not (METHOD_SEARCH == HttpRequestMethod(METHOD_TRACE))); + CPPUNIT_ASSERT(HttpRequestMethod(METHOD_GET) == METHOD_GET); + CPPUNIT_ASSERT(not (HttpRequestMethod(METHOD_TRACE) == METHOD_SEARCH)); } /* @@ -104,8 +104,8 @@ { CPPUNIT_ASSERT(HttpRequestMethod(METHOD_NONE) != METHOD_GET); CPPUNIT_ASSERT(not (HttpRequestMethod(METHOD_POST) != METHOD_POST)); - CPPUNIT_ASSERT(METHOD_NONE != HttpRequestMethod(METHOD_GET)); - CPPUNIT_ASSERT(not (METHOD_SEARCH != HttpRequestMethod(METHOD_SEARCH))); + CPPUNIT_ASSERT(HttpRequestMethod(METHOD_GET) != METHOD_NONE); + CPPUNIT_ASSERT(not (HttpRequestMethod(METHOD_SEARCH) != METHOD_SEARCH)); } /* @@ -115,6 +115,6 @@ testHttpRequestMethod::testStream() { std::ostringstream buffer; - buffer << HttpRequestMethod("get"); + buffer << HttpRequestMethod("get",NULL); CPPUNIT_ASSERT_EQUAL(String("GET"), String(buffer.str().c_str())); } Index: squid3/src/tests/testHttpRequestMethod.h diff -u squid3/src/tests/testHttpRequestMethod.h:1.1 squid3/src/tests/testHttpRequestMethod.h:1.1.18.1 --- squid3/src/tests/testHttpRequestMethod.h:1.1 Fri May 12 06:49:57 2006 +++ squid3/src/tests/testHttpRequestMethod.h Sat Feb 2 05:12:57 2008 @@ -18,7 +18,7 @@ CPPUNIT_TEST( testDefaultConstructor ); CPPUNIT_TEST( testEqualmethod_t ); CPPUNIT_TEST( testNotEqualmethod_t ); - CPPUNIT_TEST( testConst_str ); + CPPUNIT_TEST( testImage ); CPPUNIT_TEST( testStream ); CPPUNIT_TEST_SUITE_END(); @@ -29,7 +29,7 @@ void testConstructmethod_t(); void testConstructCharStart(); void testConstructCharStartEnd(); - void testConst_str(); + void testImage(); void testDefaultConstructor(); void testEqualmethod_t(); void testNotEqualmethod_t();