Remove use of deprecated code
Change-Id: I721e9d0f9b41e7a53d75b1fde4a718c349273eeb
Refs: #3988
diff --git a/tests/integrated/test-basic-command-insert-delete.cpp b/tests/integrated/test-basic-command-insert-delete.cpp
index 10775f7..f9e58e3 100644
--- a/tests/integrated/test-basic-command-insert-delete.cpp
+++ b/tests/integrated/test-basic-command-insert-delete.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2017, Regents of the University of California.
*
* This file is part of NDN repo-ng (Next generation of NDN repository).
* See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -89,10 +89,10 @@
void
- onInsertData(const Interest& interest, Data& data);
+ onInsertData(const Interest& interest, const Data& data);
void
- onDeleteData(const Interest& interest, Data& data);
+ onDeleteData(const Interest& interest, const Data& data);
void
onInsertTimeout(const Interest& interest);
@@ -179,7 +179,7 @@
}
template<class T> void
-Fixture<T>::onInsertData(const Interest& interest, Data& data)
+Fixture<T>::onInsertData(const Interest& interest, const Data& data)
{
RepoCommandResponse response;
response.wireDecode(data.getContent().blockFromValue());
@@ -189,7 +189,7 @@
}
template<class T> void
-Fixture<T>::onDeleteData(const Interest& interest, Data& data)
+Fixture<T>::onDeleteData(const Interest& interest, const Data& data)
{
RepoCommandResponse response;
response.wireDecode(data.getContent().blockFromValue());
@@ -218,6 +218,7 @@
{
insertFace.expressInterest(insertInterest,
bind(&Fixture<T>::onInsertData, this, _1, _2),
+ bind(&Fixture<T>::onInsertTimeout, this, _1), // Nack
bind(&Fixture<T>::onInsertTimeout, this, _1));
}
@@ -226,6 +227,7 @@
{
deleteFace.expressInterest(deleteInterest,
bind(&Fixture<T>::onDeleteData, this, _1, _2),
+ bind(&Fixture<T>::onDeleteTimeout, this, _1), // Nack
bind(&Fixture<T>::onDeleteTimeout, this, _1));
}
@@ -328,5 +330,5 @@
BOOST_AUTO_TEST_SUITE_END()
-} //namespace tests
-} //namespace repo
+} // namespace tests
+} // namespace repo
diff --git a/tests/integrated/test-basic-command-watch.cpp b/tests/integrated/test-basic-command-watch.cpp
index ae06eb1..8c4c13e 100644
--- a/tests/integrated/test-basic-command-watch.cpp
+++ b/tests/integrated/test-basic-command-watch.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2017, Regents of the University of California.
*
* This file is part of NDN repo-ng (Next generation of NDN repository).
* See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -36,7 +36,7 @@
using ndn::time::milliseconds;
using ndn::time::seconds;
using ndn::EventId;
-namespace random=ndn::random;
+namespace random = ndn::random;
//All the test cases in this test suite should be run at once.
BOOST_AUTO_TEST_SUITE(TestBasicCommandWatchDelete)
@@ -80,10 +80,10 @@
stopFaceProcess();
void
- onWatchData(const Interest& interest, Data& data);
+ onWatchData(const Interest& interest, const Data& data);
void
- onWatchStopData(const Interest& interest, Data& data);
+ onWatchStopData(const Interest& interest, const Data& data);
void
onWatchTimeout(const Interest& interest);
@@ -158,7 +158,7 @@
}
template<class T> void
-Fixture<T>::onWatchData(const Interest& interest, Data& data)
+Fixture<T>::onWatchData(const Interest& interest, const Data& data)
{
RepoCommandResponse response;
response.wireDecode(data.getContent().blockFromValue());
@@ -168,7 +168,7 @@
}
template<class T> void
-Fixture<T>::onWatchStopData(const Interest& interest, Data& data)
+Fixture<T>::onWatchStopData(const Interest& interest, const Data& data)
{
RepoCommandResponse response;
response.wireDecode(data.getContent().blockFromValue());
@@ -188,6 +188,7 @@
{
watchFace.expressInterest(watchInterest,
bind(&Fixture<T>::onWatchData, this, _1, _2),
+ bind(&Fixture<T>::onWatchTimeout, this, _1), // Nack
bind(&Fixture<T>::onWatchTimeout, this, _1));
}
@@ -196,6 +197,7 @@
{
watchFace.expressInterest(watchInterest,
bind(&Fixture<T>::onWatchStopData, this, _1, _2),
+ bind(&Fixture<T>::onWatchTimeout, this, _1), // Nack
bind(&Fixture<T>::onWatchTimeout, this, _1));
}
@@ -263,5 +265,5 @@
BOOST_AUTO_TEST_SUITE_END()
-} //namespace tests
-} //namespace repo
+} // namespace tests
+} // namespace repo
diff --git a/tests/integrated/test-basic-interest-read.cpp b/tests/integrated/test-basic-interest-read.cpp
index d4eba2e..79a7e8f 100644
--- a/tests/integrated/test-basic-interest-read.cpp
+++ b/tests/integrated/test-basic-interest-read.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2017, Regents of the University of California.
*
* This file is part of NDN repo-ng (Next generation of NDN repository).
* See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -74,7 +74,7 @@
Interest readInterest((*i)->getName());
readInterest.setMustBeFresh(true);
scheduler.scheduleEvent(ndn::time::milliseconds(timeCount * 50),
- ndn::bind(&BasicInterestReadFixture<Dataset>::sendInterest, this,
+ bind(&BasicInterestReadFixture<Dataset>::sendInterest, this,
readInterest));
timeCount++;
}
@@ -87,7 +87,7 @@
}
void
- onReadData(const ndn::Interest& interest, ndn::Data& data)
+ onReadData(const ndn::Interest& interest, const ndn::Data& data)
{
int rc = memcmp(data.getContent().value(), content, sizeof(content));
BOOST_CHECK_EQUAL(rc, 0);
@@ -104,6 +104,7 @@
{
readFace.expressInterest(interest,
bind(&BasicInterestReadFixture::onReadData, this, _1, _2),
+ bind(&BasicInterestReadFixture::onReadTimeout, this, _1), // Nack
bind(&BasicInterestReadFixture::onReadTimeout, this, _1));
}
@@ -134,16 +135,16 @@
this->startListen();
this->scheduler.scheduleEvent(ndn::time::seconds(0),
- ndn::bind(&BasicInterestReadFixture<T>::scheduleReadEvent, this));
+ bind(&BasicInterestReadFixture<T>::scheduleReadEvent, this));
// schedule an event to terminate IO
this->scheduler.scheduleEvent(ndn::time::seconds(20),
- ndn::bind(&BasicInterestReadFixture<T>::stopFaceProcess, this));
+ bind(&BasicInterestReadFixture<T>::stopFaceProcess, this));
this->repoFace.getIoService().run();
}
BOOST_AUTO_TEST_SUITE_END()
-} //namespace tests
-} //namespace repo
+} // namespace tests
+} // namespace repo