encoding: don't call memcmp() with null pointer

It's undefined behavior.

Change-Id: Id2fd5cbc0483af2bf9857e81fb6cac8163da3474
Refs: #4368
diff --git a/tests/unit-tests/name-component.t.cpp b/tests/unit-tests/name-component.t.cpp
index 651b160..d91ce24 100644
--- a/tests/unit-tests/name-component.t.cpp
+++ b/tests/unit-tests/name-component.t.cpp
@@ -91,11 +91,19 @@
 
 BOOST_AUTO_TEST_CASE(Generic)
 {
+  name::Component empty;
   name::Component compD("D");
   name::Component compD2("D");
   name::Component compF("F");
   name::Component compAA("AA");
 
+  BOOST_CHECK_EQUAL(empty == empty, true);
+  BOOST_CHECK_EQUAL(empty != empty, false);
+  BOOST_CHECK_EQUAL(empty < empty, false);
+  BOOST_CHECK_EQUAL(empty <= empty, true);
+  BOOST_CHECK_EQUAL(empty == compD, false);
+  BOOST_CHECK_EQUAL(empty < compD, true);
+
   BOOST_CHECK_EQUAL(compD == compD2, true);
   BOOST_CHECK_EQUAL(compD != compD2, false);
   BOOST_CHECK_EQUAL(compD < compD2, false);