ping: set CanBePrefix=false

This commit also sets CanBePrefix in ndndump and ndnpoke tests.

refs #4581

Change-Id: Ie91839426acc02f1879495312ad7ef131e8dac57
diff --git a/tests/dump/ndndump.t.cpp b/tests/dump/ndndump.t.cpp
index 771de00..8facd0e 100644
--- a/tests/dump/ndndump.t.cpp
+++ b/tests/dump/ndndump.t.cpp
@@ -167,36 +167,25 @@
 
 BOOST_AUTO_TEST_CASE(Interest)
 {
-  ndn::Interest interest("/test");
-  interest.setNonce(0);
-
-  this->receive(interest);
-
-  BOOST_CHECK(output.is_equal("0.000000 Ethernet, INTEREST: /test?ndn.Nonce=0\n"));
+  this->receive(*makeInterest("/test", true, DEFAULT_INTEREST_LIFETIME, 1));
+  BOOST_CHECK(output.is_equal("0.000000 Ethernet, INTEREST: /test?ndn.Nonce=1\n"));
 }
 
 BOOST_AUTO_TEST_CASE(Data)
 {
-  ndn::Data data("/test");
-  m_keyChain.sign(data);
-
-  this->receive(data);
-
+  this->receive(*makeData("/test"));
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, DATA: /test\n"));
 }
 
 BOOST_AUTO_TEST_CASE(Nack)
 {
-  ndn::Interest interest("/test");
-  interest.setNonce(0);
-  lp::Nack nack(interest);
-  nack.setReason(lp::NackReason::DUPLICATE);
-  lp::Packet lpPacket(interest.wireEncode());
+  auto interest = makeInterest("/test", true, DEFAULT_INTEREST_LIFETIME, 1);
+  auto nack = makeNack(*interest, lp::NackReason::DUPLICATE);
+  lp::Packet lpPacket(interest->wireEncode());
   lpPacket.add<lp::NackField>(nack.getHeader());
 
   this->receive(lpPacket);
-
-  BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDNLPv2, NACK (Duplicate): /test?ndn.Nonce=0\n"));
+  BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDNLPv2, NACK (Duplicate): /test?ndn.Nonce=1\n"));
 }
 
 BOOST_AUTO_TEST_CASE(LpFragment)
@@ -214,16 +203,13 @@
   lpPacket.add<lp::SequenceField>(1000);
 
   this->receive(lpPacket);
-
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDNLPv2 fragment\n"));
 }
 
 BOOST_AUTO_TEST_CASE(LpIdle)
 {
   lp::Packet lpPacket;
-
   this->receive(lpPacket);
-
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDNLPv2 idle\n"));
 }
 
@@ -237,21 +223,17 @@
     0x0a, 0x04, // Nonce
       0x00, 0x00, 0x00, 0x01
   };
-
   EncodingBuffer buffer;
   buffer.prependByteArray(interest, 4);
 
   this->receiveEthernet(buffer);
-
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDN truncated packet, length 4\n"));
 }
 
 BOOST_AUTO_TEST_CASE(UnsupportedNdnPacket)
 {
   EncodingBuffer buffer(encoding::makeEmptyBlock(tlv::Name));
-
   this->receiveEthernet(buffer);
-
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, [Unsupported NDN packet type 7]\n"));
 }
 
@@ -262,7 +244,6 @@
   endian::native_to_big_inplace(type);
 
   this->receiveEthernet(pkt, type);
-
   BOOST_CHECK(output.is_equal("0.000000 [Unsupported ethertype 0x806]\n"));
 }