State: reset wire after adding names; fix tests when zlib is disabled

refs: #5083, #5077

Change-Id: I48f24ad53d676036f6b03cc0472be9bb5026016e
diff --git a/tests/test-state.cpp b/tests/test-state.cpp
index 25626c4..6d7239c 100644
--- a/tests/test-state.cpp
+++ b/tests/test-state.cpp
@@ -74,6 +74,20 @@
   BOOST_CHECK_EQUAL(state2.getContent().size(), 0);
 }
 
+BOOST_AUTO_TEST_CASE(ReEncode)
+{
+  State state;
+  state.addContent(ndn::Name("test1"));
+  state.addContent(ndn::Name("test2"));
+
+  state.wireEncode();
+
+  state.addContent(ndn::Name("test3"));
+
+  State state2(state.wireEncode());
+  BOOST_CHECK_EQUAL(state2.getContent().size(), 3);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace psync
\ No newline at end of file