X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftest_filter_rewrite.cpp;h=1f86a98b3e2bcca71c02f15fc0d9eadd6124a8c3;hb=a5dc369fbffd8e27cde8557a7aa640dc0f222aef;hp=6a815599944b4e825aaac008f94a0937fff88efc;hpb=24c59a891cc78bd319b5db6c5ade450585e37ed1;p=metaproxy-moved-to-github.git diff --git a/src/test_filter_rewrite.cpp b/src/test_filter_rewrite.cpp index 6a81559..1f86a98 100644 --- a/src/test_filter_rewrite.cpp +++ b/src/test_filter_rewrite.cpp @@ -43,7 +43,6 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) { try { - std::cout << "Running non-xml config test case" << std::endl; mp::RouterChain router; mp::filter::HttpRewrite fhr; @@ -68,9 +67,11 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) " \n" " \n" " \n" + " \n" + " \n" + " \n" " \n" " \n" - " \n" " \n" @@ -80,9 +81,13 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) " \n" " \n" " \n" - " \n" + " \n" " \n" - " \n" + " \n" + " \n" + " \n" + " \n" + " \n" " \n" " \n" "\n" @@ -112,7 +117,6 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) const char *resp_buf = "HTTP/1.1 200 OK\r\n" - "Content-Length: 441\r\n" "Content-Type: text/html\r\n" "Link: ; rel=absolute\r\n" "Link: ; rel=relative\r\n" @@ -125,7 +129,8 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) "" "" "" "" "

Welcome to our website. It doesn't make it easy to get pro" @@ -135,13 +140,13 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) "" " Another abs link" "" - "" - "" + "" + "" ""; const char *resp_expected = "HTTP/1.1 200 OK\r\n" - "Content-Length: 564\r\n" + "Content-Length: 631\r\n" "Content-Type: text/html\r\n" "Link: ; rel=absolute\r\n" "Link: ; rel=relative\r\n" @@ -154,7 +159,8 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) "" "" "" "" "

Welcome to our website. It doesn't make it easy to get pro" @@ -164,8 +170,8 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) "" " Another abs link" "" - "" - "" + "" + "" ""; Z_GDU *gdu_res; @@ -205,7 +211,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) { //compare buffers std::cout << "Expected result:\n" << resp_expected << "\n"; - std::cout << "Got result:\n" << "\n"; + std::cout << "Got result:\n"; fflush(stdout); fwrite(resp_result, 1, resp_result_len, stdout); fflush(stdout); @@ -221,12 +227,10 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_1 ) } } - BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) { try { - std::cout << "Running non-xml config test case" << std::endl; mp::RouterChain router; mp::filter::HttpRewrite fhr; @@ -261,12 +265,6 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) " \n" " \n" " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" " \n" " \n" " \n" @@ -298,7 +296,6 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) const char *resp_buf = "HTTP/1.1 200 OK\r\n" - "Content-Length: 140\r\n" "Content-Type: application/javascript\r\n" "Link: ; rel=absolute\r\n" "Link: ; rel=relative\r\n" @@ -307,11 +304,11 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) "my.location = 'http://targetsite/images/bg.png';\n" "my.other = \"http://targetsite/images/fg.png\";\n" "my.thrd = \"other\";\n" - "// http://targetsite/images/bg.png\n"; + "// \"http://targetsite/images/bg.png\n"; const char *resp_expected = "HTTP/1.1 200 OK\r\n" - "Content-Length: 194\r\n" + "Content-Length: 195\r\n" "Content-Type: application/javascript\r\n" "Link: ; rel=absolute\r\n" "Link: ; rel=relative\r\n" @@ -320,7 +317,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) "my.location = 'http://proxyhost/proxypath/targetsite/images/bg.png';\n" "my.other = \"http://proxyhost/proxypath/targetsite/images/fg.png\";\n" "my.thrd = \"other\";\n" - "// http://targetsite/images/bg.png\n"; + "// \"http://targetsite/images/bg.png\n"; Z_GDU *gdu_res; mp::odr dec(ODR_DECODE); @@ -359,7 +356,7 @@ BOOST_AUTO_TEST_CASE( test_filter_rewrite_2 ) { //compare buffers std::cout << "Expected result:\n" << resp_expected << "\n"; - std::cout << "Got result:\n" << "\n"; + std::cout << "Got result:\n"; fflush(stdout); fwrite(resp_result, 1, resp_result_len, stdout); fflush(stdout);