X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ftest_filter_backend_test.cpp;h=d23ee5c5ac0780e9fcafb3281d714d0e09d832f6;hb=77dee8966dd1304a0fb8540c3fc68d02dc6ce84a;hp=f3db9ee96a72eb7e0743ab77bfe105d54b96087d;hpb=d7b1186d1f020678b617e2368415485bffef93f9;p=metaproxy-moved-to-github.git diff --git a/src/test_filter_backend_test.cpp b/src/test_filter_backend_test.cpp index f3db9ee..d23ee5c 100644 --- a/src/test_filter_backend_test.cpp +++ b/src/test_filter_backend_test.cpp @@ -1,4 +1,4 @@ -/* $Id: test_filter_backend_test.cpp,v 1.2 2005-10-26 10:21:03 marc Exp $ +/* $Id: test_filter_backend_test.cpp,v 1.6 2005-12-02 12:21:07 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -8,7 +8,7 @@ #include #include -#include "test_util.hpp" +#include "util.hpp" #include "filter_backend_test.hpp" #include "filter_log.hpp" @@ -24,7 +24,7 @@ #include using namespace boost::unit_test; -BOOST_AUTO_TEST_CASE( test_filter_backend_test_1 ) +BOOST_AUTO_UNIT_TEST( test_filter_backend_test_1 ) { try { @@ -35,24 +35,23 @@ BOOST_AUTO_TEST_CASE( test_filter_backend_test_1 ) } } -BOOST_AUTO_TEST_CASE( test_filter_backend_test_2 ) +BOOST_AUTO_UNIT_TEST( test_filter_backend_test_2 ) { try { yp2::RouterChain router; yp2::filter::Backend_test btest; - router.rule(btest); + router.append(btest); yp2::Package pack; - ODR odr = odr_createmem(ODR_ENCODE); + yp2::odr odr; Z_APDU *apdu = zget_APDU(odr, Z_APDU_initRequest); BOOST_CHECK(apdu); pack.request() = apdu; - odr_destroy(odr); // Put it in router pack.router(router).move(); @@ -74,20 +73,20 @@ BOOST_AUTO_TEST_CASE( test_filter_backend_test_2 ) } } -BOOST_AUTO_TEST_CASE( test_filter_backend_test_3 ) +BOOST_AUTO_UNIT_TEST( test_filter_backend_test_3 ) { try { yp2::RouterChain router; yp2::filter::Backend_test btest; - router.rule(btest); + router.append(btest); yp2::Package pack; // send search request as first request.. That should fail with // a close from the backend - ODR odr = odr_createmem(ODR_ENCODE); + yp2::odr odr; Z_APDU *apdu = zget_APDU(odr, Z_APDU_searchRequest); yp2::util::pqf(odr, apdu, "computer"); @@ -100,7 +99,6 @@ BOOST_AUTO_TEST_CASE( test_filter_backend_test_3 ) BOOST_CHECK(apdu); pack.request() = apdu; - odr_destroy(odr); // Put it in router pack.router(router).move(); @@ -122,26 +120,25 @@ BOOST_AUTO_TEST_CASE( test_filter_backend_test_3 ) } } -BOOST_AUTO_TEST_CASE( test_filter_backend_test_4 ) +BOOST_AUTO_UNIT_TEST( test_filter_backend_test_4 ) { try { yp2::RouterChain router; yp2::filter::Backend_test btest; - router.rule(btest); + router.append(btest); yp2::Package pack; // send present request as first request.. That should fail with // a close from the backend - ODR odr = odr_createmem(ODR_ENCODE); + yp2::odr odr; Z_APDU *apdu = zget_APDU(odr, Z_APDU_presentRequest); BOOST_CHECK(apdu); pack.request() = apdu; - odr_destroy(odr); // Put it in router pack.router(router).move();