face: revert unintended behavior change in Transport::setPersistency
Prior to commit 32dab97321d954800f70e4a695e326c998d37a93, persistency
transitions from NONE were not logged and before/afterChangePersistency
was not called. Restore that behavior.
This commit also improves test coverage of the persistency-related
functions in the various Transport subclasses.
Change-Id: Ide77c67ea277fca3d1cad5ea131ae0fa259db75c
Refs: #3232
diff --git a/tests/daemon/face/ethernet-transport.t.cpp b/tests/daemon/face/ethernet-transport.t.cpp
index 4cc9ceb..cd46a04 100644
--- a/tests/daemon/face/ethernet-transport.t.cpp
+++ b/tests/daemon/face/ethernet-transport.t.cpp
@@ -52,6 +52,16 @@
BOOST_CHECK_EQUAL(transport.getLinkType(), ndn::nfd::LINK_TYPE_MULTI_ACCESS);
}
+BOOST_AUTO_TEST_CASE(PersistencyChange)
+{
+ SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
+ EthernetTransport transport(netifs.front(), ethernet::getDefaultMulticastAddress());
+
+ BOOST_CHECK_EQUAL(transport.canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_ON_DEMAND), false);
+ BOOST_CHECK_EQUAL(transport.canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_PERSISTENT), false);
+ BOOST_CHECK_EQUAL(transport.canChangePersistencyTo(ndn::nfd::FACE_PERSISTENCY_PERMANENT), true);
+}
+
///\todo #3369 add the equivalent of these test cases from ethernet.t.cpp
/// as of commit:65caf200924b28748037750449e28bcb548dbc9c
/// SendPacket, ProcessIncomingPacket