interest+exclude: rename NameComponent to GenericNameComponent

refs #4526

Change-Id: I8300f68b504ec959ca482759eaa4f7cbf566d729
diff --git a/src/exclude.cpp b/src/exclude.cpp
index bf6bfef..8d29629 100644
--- a/src/exclude.cpp
+++ b/src/exclude.cpp
@@ -127,7 +127,7 @@
 
   size_t totalLength = 0;
 
-  // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
+  // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (GenericNameComponent (Any)?)+
   // Any     ::= ANY-TYPE TLV-LENGTH(=0)
 
   for (const Entry& entry : m_entries) {
@@ -177,7 +177,7 @@
     BOOST_THROW_EXCEPTION(Error("Exclude element cannot be empty"));
   }
 
-  // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
+  // Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (GenericNameComponent (Any)?)+
   // Any     ::= ANY-TYPE TLV-LENGTH(=0)
 
   Block::element_const_iterator i = m_wire.elements_begin();
diff --git a/src/interest.cpp b/src/interest.cpp
index 60e284b..3fc425b 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -250,9 +250,9 @@
         return false;
       // There's opportunity to inspect the Exclude filter and determine whether
       // the digest would make a difference.
-      // eg. "<NameComponent>AA</NameComponent><Any/>" doesn't exclude any digest -
-      //     fullName not needed;
-      //     "<Any/><NameComponent>AA</NameComponent>" and
+      // eg. "<GenericNameComponent>AA</GenericNameComponent><Any/>" doesn't exclude
+      //     any digest - fullName not needed;
+      //     "<Any/><GenericNameComponent>AA</GenericNameComponent>" and
       //     "<Any/><ImplicitSha256DigestComponent>ffffffffffffffffffffffffffffffff
       //      </ImplicitSha256DigestComponent>"
       //     excludes all digests - fullName not needed;
diff --git a/tests/unit-tests/encoding/block.t.cpp b/tests/unit-tests/encoding/block.t.cpp
index f094460..967a285 100644
--- a/tests/unit-tests/encoding/block.t.cpp
+++ b/tests/unit-tests/encoding/block.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -177,9 +177,9 @@
   const uint8_t PACKET[] = {
     0x06, 0x20, // Data
           0x07, 0x11, // Name
-                0x08, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, // NameComponent 'hello'
-                0x08, 0x01, 0x31, // NameComponent '1'
-                0x08, 0x05, 0x77, 0x6f, 0x72, 0x6c, 0x64, // NameComponent 'world'
+                0x08, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, // GenericNameComponent 'hello'
+                0x08, 0x01, 0x31, // GenericNameComponent '1'
+                0x08, 0x05, 0x77, 0x6f, 0x72, 0x6c, 0x64, // GenericNameComponent 'world'
           0x14, 0x00, // MetaInfo empty
           0x15, 0x00, // Content empty
           0x16, 0x05, // SignatureInfo
@@ -306,9 +306,9 @@
   const uint8_t PACKET[] = {
     0x06, 0x20, // Data
           0x07, 0x11, // Name
-                0x08, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, // NameComponent 'hello'
-                0x08, 0x01, 0x31, // NameComponent '1'
-                0x08, 0x05, 0x77, 0x6f, 0x72, 0x6c, 0x64, // NameComponent 'world'
+                0x08, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, // GenericNameComponent 'hello'
+                0x08, 0x01, 0x31, // GenericNameComponent '1'
+                0x08, 0x05, 0x77, 0x6f, 0x72, 0x6c, 0x64, // GenericNameComponent 'world'
           0x14, 0x00, // MetaInfo empty
           0x15, 0x00, // Content empty
           0x16, 0x05, // SignatureInfo
@@ -334,15 +334,15 @@
 BOOST_AUTO_TEST_CASE(InsertBeginning)
 {
   Block masterBlock(tlv::Name);
-  Block firstBlock = makeStringBlock(tlv::NameComponent, "firstName");
-  Block secondBlock = makeStringBlock(tlv::NameComponent, "secondName");
-  Block thirdBlock = makeStringBlock(tlv::NameComponent, "thirdName");
+  Block firstBlock = makeStringBlock(tlv::GenericNameComponent, "firstName");
+  Block secondBlock = makeStringBlock(tlv::GenericNameComponent, "secondName");
+  Block thirdBlock = makeStringBlock(tlv::GenericNameComponent, "thirdName");
 
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 0);
   masterBlock.push_back(secondBlock);
   masterBlock.push_back(thirdBlock);
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 2);
-  Block::element_const_iterator it = masterBlock.find(tlv::NameComponent);
+  Block::element_const_iterator it = masterBlock.find(tlv::GenericNameComponent);
   BOOST_CHECK_EQUAL(*it == secondBlock, true);
 
   it = masterBlock.insert(it, firstBlock);
@@ -355,9 +355,9 @@
 BOOST_AUTO_TEST_CASE(InsertEnd)
 {
   Block masterBlock(tlv::Name);
-  Block firstBlock = makeStringBlock(tlv::NameComponent, "firstName");
-  Block secondBlock = makeStringBlock(tlv::NameComponent, "secondName");
-  Block thirdBlock = makeStringBlock(tlv::NameComponent, "thirdName");
+  Block firstBlock = makeStringBlock(tlv::GenericNameComponent, "firstName");
+  Block secondBlock = makeStringBlock(tlv::GenericNameComponent, "secondName");
+  Block thirdBlock = makeStringBlock(tlv::GenericNameComponent, "thirdName");
 
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 0);
   masterBlock.push_back(firstBlock);
@@ -376,15 +376,15 @@
 BOOST_AUTO_TEST_CASE(InsertMiddle)
 {
   Block masterBlock(tlv::Name);
-  Block firstBlock = makeStringBlock(tlv::NameComponent, "firstName");
-  Block secondBlock = makeStringBlock(tlv::NameComponent, "secondName");
-  Block thirdBlock = makeStringBlock(tlv::NameComponent, "thirdName");
+  Block firstBlock = makeStringBlock(tlv::GenericNameComponent, "firstName");
+  Block secondBlock = makeStringBlock(tlv::GenericNameComponent, "secondName");
+  Block thirdBlock = makeStringBlock(tlv::GenericNameComponent, "thirdName");
 
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 0);
   masterBlock.push_back(firstBlock);
   masterBlock.push_back(thirdBlock);
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 2);
-  Block::element_const_iterator it = masterBlock.find(tlv::NameComponent);
+  Block::element_const_iterator it = masterBlock.find(tlv::GenericNameComponent);
   BOOST_CHECK_EQUAL(*it == firstBlock, true);
 
   it = masterBlock.insert(it + 1, secondBlock);
@@ -397,16 +397,16 @@
 BOOST_AUTO_TEST_CASE(EraseSingleElement)
 {
   Block masterBlock(tlv::Name);
-  Block firstBlock = makeStringBlock(tlv::NameComponent, "firstName");
-  Block secondBlock = makeStringBlock(tlv::NameComponent, "secondName");
-  Block thirdBlock = makeStringBlock(tlv::NameComponent, "thirdName");
+  Block firstBlock = makeStringBlock(tlv::GenericNameComponent, "firstName");
+  Block secondBlock = makeStringBlock(tlv::GenericNameComponent, "secondName");
+  Block thirdBlock = makeStringBlock(tlv::GenericNameComponent, "thirdName");
 
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 0);
   masterBlock.push_back(firstBlock);
   masterBlock.push_back(secondBlock);
   masterBlock.push_back(thirdBlock);
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 3);
-  Block::element_const_iterator it = masterBlock.find(tlv::NameComponent);
+  Block::element_const_iterator it = masterBlock.find(tlv::GenericNameComponent);
   it++;
   BOOST_CHECK_EQUAL(*it == secondBlock, true);
 
@@ -420,12 +420,12 @@
 BOOST_AUTO_TEST_CASE(EraseRange)
 {
   Block masterBlock(tlv::Name);
-  Block firstBlock = makeStringBlock(tlv::NameComponent, "firstName");
-  Block secondBlock = makeStringBlock(tlv::NameComponent, "secondName");
-  Block thirdBlock = makeStringBlock(tlv::NameComponent, "thirdName");
-  Block fourthBlock = makeStringBlock(tlv::NameComponent, "fourthName");
-  Block fifthBlock = makeStringBlock(tlv::NameComponent, "fifthName");
-  Block sixthBlock = makeStringBlock(tlv::NameComponent, "sixthName");
+  Block firstBlock = makeStringBlock(tlv::GenericNameComponent, "firstName");
+  Block secondBlock = makeStringBlock(tlv::GenericNameComponent, "secondName");
+  Block thirdBlock = makeStringBlock(tlv::GenericNameComponent, "thirdName");
+  Block fourthBlock = makeStringBlock(tlv::GenericNameComponent, "fourthName");
+  Block fifthBlock = makeStringBlock(tlv::GenericNameComponent, "fifthName");
+  Block sixthBlock = makeStringBlock(tlv::GenericNameComponent, "sixthName");
 
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 0);
   masterBlock.push_back(firstBlock);
@@ -435,7 +435,7 @@
   masterBlock.push_back(fifthBlock);
   masterBlock.push_back(sixthBlock);
   BOOST_CHECK_EQUAL(masterBlock.elements_size(), 6);
-  Block::element_const_iterator itStart = masterBlock.find(tlv::NameComponent);
+  Block::element_const_iterator itStart = masterBlock.find(tlv::GenericNameComponent);
   itStart++;
   Block::element_const_iterator itEnd = itStart + 3;
   BOOST_CHECK_EQUAL(*itStart == secondBlock, true);
diff --git a/tests/unit-tests/exclude.t.cpp b/tests/unit-tests/exclude.t.cpp
index 715f747..da93a85 100644
--- a/tests/unit-tests/exclude.t.cpp
+++ b/tests/unit-tests/exclude.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -31,7 +31,7 @@
 
 BOOST_AUTO_TEST_SUITE(TestExclude)
 
-BOOST_AUTO_TEST_SUITE(GenericComponent) // exclude generic NameComponent
+BOOST_AUTO_TEST_SUITE(GenericComponent) // exclude GenericNameComponent
 
 BOOST_AUTO_TEST_CASE(One)
 {
@@ -239,7 +239,7 @@
 
 /** \brief make a name::Component with an octet repeated util::Sha256::DIGEST_SIZE times
  *  \param octet the octet to fill the component
- *  \param isDigest whether to make an ImplicitSha256DigestComponent or a generic NameComponent
+ *  \param isDigest whether to make an ImplicitSha256DigestComponent or a GenericNameComponent
  *  \param lastOctet if non-negative, set the last octet to a different value
  */
 static name::Component
@@ -503,7 +503,7 @@
   BOOST_CHECK_THROW(e2.wireDecode(Block(ANY_ANY, sizeof(ANY_ANY))),
                                   Exclude::Error);
 
-  // // <Exclude><Any/><NameComponent>T</NameComponent><Any/></Exclude>
+  // // <Exclude><Any/><GenericNameComponent>T</GenericNameComponent><Any/></Exclude>
   // const uint8_t ANY_COMPONENT_ANY[] = { 0x10, 0x07, 0x13, 0x00, 0x08, 0x01, 0x54, 0x13, 0x00 };
   // BOOST_CHECK_THROW(e2.wireDecode(Block(ANY_COMPONENT_ANY, sizeof(ANY_COMPONENT_ANY))),
   //                   Exclude::Error);
diff --git a/tests/unit-tests/interest.t.cpp b/tests/unit-tests/interest.t.cpp
index c1dc23d..4fe7288 100644
--- a/tests/unit-tests/interest.t.cpp
+++ b/tests/unit-tests/interest.t.cpp
@@ -48,9 +48,9 @@
   const uint8_t WIRE[] = {
     0x05, 0x1c, // Interest
           0x07, 0x14, // Name
-                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // NameComponent
-                0x08, 0x03, 0x6e, 0x64, 0x6e, // NameComponent
-                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // NameComponent
+                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // GenericNameComponent
+                0x08, 0x03, 0x6e, 0x64, 0x6e, // GenericNameComponent
+                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // GenericNameComponent
           0x0a, 0x04, // Nonce
                 0x01, 0x00, 0x00, 0x00
   };
@@ -74,9 +74,9 @@
   const uint8_t WIRE[] = {
     0x05, 0x31, // Interest
           0x07, 0x14, // Name
-                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // NameComponent
-                0x08, 0x03, 0x6e, 0x64, 0x6e, // NameComponent
-                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // NameComponent
+                0x08, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, // GenericNameComponent
+                0x08, 0x03, 0x6e, 0x64, 0x6e, // GenericNameComponent
+                0x08, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, // GenericNameComponent
           0x09, 0x03, // Selectors
                 0x0d, 0x01, 0x01,  // MinSuffixComponents
           0x0a, 0x04, // Nonce
diff --git a/tests/unit-tests/name.t.cpp b/tests/unit-tests/name.t.cpp
index 67782cf..65cadf6 100644
--- a/tests/unit-tests/name.t.cpp
+++ b/tests/unit-tests/name.t.cpp
@@ -31,22 +31,22 @@
 
 static const uint8_t TestName[] = {
         0x7,  0x14, // Name
-          0x8,  0x5, // NameComponent
+          0x8,  0x5, // GenericNameComponent
               0x6c,  0x6f,  0x63,  0x61,  0x6c,
-          0x8,  0x3, // NameComponent
+          0x8,  0x3, // GenericNameComponent
               0x6e,  0x64,  0x6e,
-          0x8,  0x6, // NameComponent
+          0x8,  0x6, // GenericNameComponent
               0x70,  0x72,  0x65,  0x66,  0x69,  0x78
 };
 
 const uint8_t Name1[] = {0x7,  0x7, // Name
-                           0x8,  0x5, // NameComponent
+                           0x8,  0x5, // GenericNameComponent
                              0x6c,  0x6f,  0x63,  0x61,  0x6c};
 
 const uint8_t Name2[] = {0x7,  0xc, // Name
-                           0x8,  0x5, // NameComponent
+                           0x8,  0x5, // GenericNameComponent
                              0x6c,  0x6f,  0x63,  0x61,  0x6c,
-                           0x8,  0x3, // NameComponent
+                           0x8,  0x3, // GenericNameComponent
                              0x6e,  0x64,  0x6e};
 
 // ---- encoding, decoding ----
diff --git a/tests/unit-tests/selectors.t.cpp b/tests/unit-tests/selectors.t.cpp
index 0b5d70f..202fd71 100644
--- a/tests/unit-tests/selectors.t.cpp
+++ b/tests/unit-tests/selectors.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -74,10 +74,10 @@
                       0x08, 0x03, 0x6b, 0x65, 0x79,
                       0x08, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
           0x10, 0x14, // Exclude
-                0x08, 0x04, 0x61, 0x6c, 0x65, 0x78, // NameComponent
-                0x08, 0x04, 0x78, 0x78, 0x78, 0x78, // NameComponent
+                0x08, 0x04, 0x61, 0x6c, 0x65, 0x78, // GenericNameComponent
+                0x08, 0x04, 0x78, 0x78, 0x78, 0x78, // GenericNameComponent
                 0x13, 0x00, // Any
-                0x08, 0x04, 0x79, 0x79, 0x79, 0x79, // NameComponent
+                0x08, 0x04, 0x79, 0x79, 0x79, 0x79, // GenericNameComponent
           0x11, 0x01, 0x01, // ChildSelector
           0x12, 0x00 // MustBeFresh
   };