In encode methods, return a ptr_lib::shared_ptr<vector<unsigned char> >
diff --git a/tests/test-encode-decode-ContentObject.cpp b/tests/test-encode-decode-ContentObject.cpp
index 852b2d0..665d097 100644
--- a/tests/test-encode-decode-ContentObject.cpp
+++ b/tests/test-encode-decode-ContentObject.cpp
@@ -74,12 +74,11 @@
     cout << "ContentObject timestamp " << timestamp.date().year() << "/" << timestamp.date().month() << "/" << timestamp.date().day() 
          << " " << timestamp.time_of_day().hours() << ":" << timestamp.time_of_day().minutes() << ":" << timestamp.time_of_day().seconds()  << endl;
     
-    vector<unsigned char> encoding;
-    contentObject.encode(encoding);
-    cout << "ContentObject encoding length " << encoding.size() << " vs. sizeof(ContentObject1) " << sizeof(ContentObject1) << endl;
+    ptr_lib::shared_ptr<vector<unsigned char> > encoding = contentObject.encode();
+    cout << "ContentObject encoding length " << encoding->size() << " vs. sizeof(ContentObject1) " << sizeof(ContentObject1) << endl;
     
     ContentObject reDecodedContentObject;
-    reDecodedContentObject.decode(encoding);
+    reDecodedContentObject.decode(*encoding);
     cout << "Re-decoded ContentObject name " << reDecodedContentObject.getName().to_uri() << endl;
     timestamp = UNIX_EPOCH_TIME + milliseconds(reDecodedContentObject.getSignedInfo().getTimestampMilliseconds());
     cout << "Re-decoded ContentObject timestamp " << timestamp.date().year() << "/" << timestamp.date().month() << "/" << timestamp.date().day() << endl;
diff --git a/tests/test-encode-decode-Interest.cpp b/tests/test-encode-decode-Interest.cpp
index d715c85..412f78e 100644
--- a/tests/test-encode-decode-Interest.cpp
+++ b/tests/test-encode-decode-Interest.cpp
@@ -44,12 +44,11 @@
     cout << "Interest excludeEntryCount " << interest.getExclude().getEntryCount() << endl;
     cout << "InterestLifetimeMilliseconds " << interest.getInterestLifetimeMilliseconds() << endl;
     
-    vector<unsigned char> encoding;
-    interest.encode(encoding);
-    cout << "Interest encoding length " << encoding.size() << " vs. sizeof(Interest1) " << sizeof(Interest1) << endl;
+    ptr_lib::shared_ptr<vector<unsigned char> > encoding = interest.encode();
+    cout << "Interest encoding length " << encoding->size() << " vs. sizeof(Interest1) " << sizeof(Interest1) << endl;
 
     Interest reDecodedInterest;
-    reDecodedInterest.decode(encoding);
+    reDecodedInterest.decode(*encoding);
     cout << "Re-decoded Interest name " << reDecodedInterest.getName().to_uri() << endl;
     cout << "Re-decoded Interest minSuffixComponents " << reDecodedInterest.getMinSuffixComponents() << endl;
     cout << "Re-decoded Interest publisherPublicKeyDigest length " << reDecodedInterest.getPublisherPublicKeyDigest().getPublisherPublicKeyDigest().size() << endl;