encoding: Optimized encoding of Interest and related data structures

Change-Id: I0609b40565835568e09c3cc0330db441fd9243b6
refs: #1172
diff --git a/tests/test-command-interest.cpp b/tests/test-command-interest.cpp
index 59619ca..fb447d9 100644
--- a/tests/test-command-interest.cpp
+++ b/tests/test-command-interest.cpp
@@ -63,7 +63,12 @@
   shared_ptr<Interest> commandInterest2 = make_shared<Interest>("/TestCommandInterest/Validation/Command2");
   int64_t timestamp = time::now() / 1000000;
   timestamp -= 5000;
-  commandInterest2->getName().append(name::Component::fromNumber(timestamp)).append(name::Component::fromNumber(random::generateWord64()));
+  Name commandName = commandInterest2->getName();
+  commandName
+    .append(name::Component::fromNumber(timestamp))
+    .append(name::Component::fromNumber(random::generateWord64()));
+  commandInterest2->setName(commandName);
+  
   keyChain.signByIdentity(*commandInterest2, identity);
   validator.validate(*commandInterest2,
   		     bind(&TestCore::validated, &core, _1),