From: Adam Dickmeiss Date: Tue, 25 Jun 2013 14:46:53 +0000 (+0200) Subject: Remove unused code, fix printing X-Git-Tag: v1.3.59~49 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=917e40f8768670e2c6da49e9d44ca92f01ea52ac;p=metaproxy-moved-to-github.git Remove unused code, fix printing --- diff --git a/src/test_filter_rewrite.cpp b/src/test_filter_rewrite.cpp index 36e1a15..b16768f 100644 --- a/src/test_filter_rewrite.cpp +++ b/src/test_filter_rewrite.cpp @@ -86,6 +86,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) " to='${proto}${pxhost}/${pxpath}/${host}/${path}' />\n" " \n" " \n" + " \n" " \n" "\n" ; @@ -199,8 +200,9 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) BOOST_CHECK(resp_result); BOOST_CHECK_EQUAL((size_t) resp_result_len, strlen(resp_expected)); - std::cout << "Rewriten result:\n" << resp_result << std::endl; - std::cout << "Rewriten result buf len: " << resp_result_len + std::cout << "Rewritten result:\n" << std::endl; + fwrite(resp_result, 1, resp_result_len, stdout); + std::cout << "\nRewritten result buf len: " << resp_result_len << std::endl; BOOST_CHECK(memcmp(resp_result, resp_expected, resp_result_len) == 0); @@ -215,143 +217,6 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) } } -/* -BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) -{ - try - { - std::cout << "Running xml config test case" << std::endl; - mp::RouterChain router; - mp::filter::HttpRewrite fhr; - - std::string xmlconf = - "\n" - "\n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - "\n" - ; - - std::cout << xmlconf; - - // reading and parsing XML conf - xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(), xmlconf.size()); - BOOST_CHECK(doc); - xmlNode *root_element = xmlDocGetRootElement(doc); - fhr.configure(root_element, true, ""); - xmlFreeDoc(doc); - - router.append(fhr); - - // create an http request - mp::Package pack; - - mp::odr odr; - Z_GDU *gdu_req = z_get_HTTP_Request_uri(odr, - "http://proxyhost/proxypath/targetsite/page1.html", 0, 1); - - pack.request() = gdu_req; - - //create the http response - - const char *resp_buf = - "HTTP/1.1 200 OK\r\n" - "Content-Length: 50\r\n" - "Content-Type: text/html\r\n" - "Link: ; rel=absolute\r\n" - "Link: ; rel=relative\r\n" - "\r\n" - "Hello proxy!" - "" - "" - "" - "" - "

Welcome to our website. It doesn't make it easy to get pro" - "xified" - "" - " An absolute link" - "" - "" - "" - "" - "

Welcome to our website. It doesn't make it easy to get pro" - "xified" - "" - " An absolute link" - "