lp: Packet::wireDecode checks TLV-TYPE of Block before decoding

refs #3256

Change-Id: Ia0fe8f88416eeecf969cc1a585e3625efe42e866
diff --git a/tests/unit-tests/lp/packet.t.cpp b/tests/unit-tests/lp/packet.t.cpp
index 4150e0c..29ec091 100644
--- a/tests/unit-tests/lp/packet.t.cpp
+++ b/tests/unit-tests/lp/packet.t.cpp
@@ -325,6 +325,13 @@
                                 encoded.begin(), encoded.end());
 }
 
+BOOST_AUTO_TEST_CASE(DecodeUnrecognizedTlvType)
+{
+  Packet packet;
+  Block wire = encoding::makeEmptyBlock(ndn::tlv::Name);
+  BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests