- }
-
- pack.response() = gdu_res;
-
- //feed to the router
- pack.router(router).move();
-
- //analyze the response
- Z_GDU *gdu_res_rew = pack.response().get();
- BOOST_CHECK(gdu_res_rew);
- BOOST_CHECK_EQUAL(gdu_res_rew->which, Z_GDU_HTTP_Response);
-
- Z_HTTP_Response *hres = gdu_res_rew->u.HTTP_Response;
- BOOST_CHECK(hres);
-
- //compare buffers
- std::cout << "Expected result:\n" << resp_expected << std::endl;
-
- ODR enc = odr_createmem(ODR_ENCODE);
- z_GDU(enc, &gdu_res_rew, 0, 0);
- char *resp_result;
- int resp_result_len;
- resp_result = odr_getbuf(enc, &resp_result_len, 0);
-
- 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::endl;
-
- BOOST_CHECK(memcmp(resp_result, resp_expected, resp_result_len) == 0);