projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Same header and footer for all files. Header includes copyright +
[metaproxy-moved-to-github.git]
/
src
/
test_filter2.cpp
diff --git
a/src/test_filter2.cpp
b/src/test_filter2.cpp
index
f4a9b3e
..
4b70368
100644
(file)
--- a/
src/test_filter2.cpp
+++ b/
src/test_filter2.cpp
@@
-1,3
+1,8
@@
+/* $Id: test_filter2.cpp,v 1.9 2005-10-15 14:09:09 adam Exp $
+ Copyright (c) 2005, Index Data.
+
+%LICENSE%
+ */
#include "config.hpp"
#include "config.hpp"
@@
-13,20
+18,20
@@
using namespace boost::unit_test;
using namespace boost::unit_test;
-class FilterConstant: public yp2::Filter {
+class FilterConstant: public yp2::filter::Base {
public:
public:
- yp2::Package & process(yp2::Package & package) const {
+ void process(yp2::Package & package) const {
package.data() = 1234;
package.data() = 1234;
- return package.move();
+ package.move();
};
};
};
};
-class FilterDouble: public yp2::Filter {
+class FilterDouble: public yp2::filter::Base {
public:
public:
- yp2::Package & process(yp2::Package & package) const {
+ void process(yp2::Package & package) const {
package.data() = package.data() * 2;
package.data() = package.data() * 2;
- return package.move();
+ package.move();
};
};
};
};
@@
-46,31
+51,30
@@
BOOST_AUTO_TEST_CASE( testfilter2 )
router1.rule(fc);
router1.rule(fd);
router1.rule(fc);
router1.rule(fd);
+
+ yp2::Session session;
+ yp2::Origin origin;
+ yp2::Package pack(session, origin);
- yp2::Package pack_in;
-
- yp2::Package pack_out;
-
- pack_out = pack_in.router(router1).move();
+ pack.router(router1).move();
- BOOST_CHECK (pack_out.data() == 2468);
+ BOOST_CHECK (pack.data() == 2468);
}
{
}
{
-
yp2::RouterChain router2;
router2.rule(fd);
router2.rule(fc);
yp2::RouterChain router2;
router2.rule(fd);
router2.rule(fc);
- yp2::Package pack_in;
-
- yp2::Package pack_out;
-
- pack_out = pack_in.router(router2).move();
+ yp2::Session session;
+ yp2::Origin origin;
+ yp2::Package pack(session, origin);
+
+ pack.router(router2).move();
- BOOST_CHECK (pack_out.data() == 1234);
+ BOOST_CHECK (pack.data() == 1234);
}
}
@@
-89,6
+93,7
@@
BOOST_AUTO_TEST_CASE( testfilter2 )
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
* Local variables:
* c-basic-offset: 4
* indent-tabs-mode: nil
+ * c-file-style: "stroustrup"
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/