update FetchManager and Fetcher
diff --git a/test/test-fetch-manager.cc b/test/test-fetch-manager.cc
index 276fe0c..a526c10 100644
--- a/test/test-fetch-manager.cc
+++ b/test/test-fetch-manager.cc
@@ -33,8 +33,8 @@
struct FetcherTestData
{
- set<uint32_t> recvData;
- set<uint32_t> recvContent;
+ set<uint64_t> recvData;
+ set<uint64_t> recvContent;
set<Name> differentNames;
set<Name> segmentNames;
@@ -49,11 +49,12 @@
}
void
- onData (Fetcher &fetcher, uint32_t seqno, const Ccnx::Name &basename,
- const Ccnx::Name &name, Ccnx::PcoPtr pco)
+ onData (const Ccnx::Name &deviceName, const Ccnx::Name &basename, uint64_t seqno, Ccnx::PcoPtr pco)
{
recvData.insert (seqno);
differentNames.insert (basename);
+ Name name = basename;
+ name.appendComp(seqno);
segmentNames.insert (name);
BytesPtr data = pco->contentPtr ();
@@ -67,6 +68,11 @@
}
void
+ finish(const Ccnx::Name &deviceName, const Ccnx::Name &baseName)
+ {
+ }
+
+ void
onComplete (Fetcher &fetcher)
{
m_done = true;
@@ -87,6 +93,7 @@
CcnxWrapperPtr ccnx = make_shared<CcnxWrapper> ();
Name baseName ("/base");
+ Name deviceName ("/device");
/* publish seqnos: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, <gap 5>, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, <gap 1>, 26 */
// this will allow us to test our pipeline of 6
for (int i = 0; i < 10; i++)
@@ -105,10 +112,11 @@
FetcherTestData data;
Fetcher fetcher (ccnx,
- bind (&FetcherTestData::onData, &data, _1, _2, _3, _4, _5),
+ bind (&FetcherTestData::onData, &data, _1, _2, _3, _4),
+ bind (&FetcherTestData::finish, &data, _1, _2),
bind (&FetcherTestData::onComplete, &data, _1),
bind (&FetcherTestData::onFail, &data, _1),
- Name ("/base"), 0, 26,
+ deviceName, Name ("/base"), 0, 26,
boost::posix_time::seconds (5)); // this time is not precise
BOOST_CHECK_EQUAL (fetcher.IsActive (), false);
@@ -124,11 +132,11 @@
{
ostringstream recvData;
- for (set<uint32_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
+ for (set<uint64_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
recvData << *i << ", ";
ostringstream recvContent;
- for (set<uint32_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
+ for (set<uint64_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
recvContent << *i << ", ";
BOOST_CHECK_EQUAL (recvData.str (), "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ");
@@ -156,11 +164,11 @@
{
ostringstream recvData;
- for (set<uint32_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
+ for (set<uint64_t>::iterator i = data.recvData.begin (); i != data.recvData.end (); i++)
recvData << *i << ", ";
ostringstream recvContent;
- for (set<uint32_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
+ for (set<uint64_t>::iterator i = data.recvContent.begin (); i != data.recvContent.end (); i++)
recvContent << *i << ", ";
BOOST_CHECK_EQUAL (recvData.str (), "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ");