Replace ndnsType with NdnsContentType

Change-Id: I74afe92d31e78d80404816113063d7f996d666c5
diff --git a/tests/unit/clients/iterative-query-controller.cpp b/tests/unit/clients/iterative-query-controller.cpp
index 308683e..453e743 100644
--- a/tests/unit/clients/iterative-query-controller.cpp
+++ b/tests/unit/clients/iterative-query-controller.cpp
@@ -76,8 +76,6 @@
 
 BOOST_AUTO_TEST_SUITE(IterativeQueryController)
 
-BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(Basic, 3)
-
 BOOST_FIXTURE_TEST_CASE(Basic, QueryControllerFixture)
 {
   using std::string;
diff --git a/tests/unit/clients/response.cpp b/tests/unit/clients/response.cpp
index c575c85..5c41f7d 100644
--- a/tests/unit/clients/response.cpp
+++ b/tests/unit/clients/response.cpp
@@ -36,12 +36,12 @@
   ndns::Response r(zone, qType);
   r.setRrLabel(Name("/ndnsim/www"));
   r.setRrType(label::CERT_RR_TYPE);
-  r.setNdnsType(NDNS_RAW);
+  r.setContentType(NDNS_BLOB);
   r.setFreshnessPeriod(time::seconds(4000));
 
   BOOST_CHECK_EQUAL(r.getFreshnessPeriod(), time::seconds(4000));
   BOOST_CHECK_EQUAL(r.getRrType(), label::CERT_RR_TYPE);
-  BOOST_CHECK_EQUAL(r.getNdnsType(), NDNS_RAW);
+  BOOST_CHECK_EQUAL(r.getContentType(), NDNS_BLOB);
   BOOST_CHECK_EQUAL(r.getZone(), zone);
   BOOST_CHECK_EQUAL(r.getQueryType(), qType);
 
@@ -59,7 +59,7 @@
   ndns::Response r4(zone, qType);
   r4.setRrLabel(Name("/ndnsim/www"));
   r4.setRrType(label::TXT_RR_TYPE);
-  r4.setNdnsType(NDNS_RESP);
+  r4.setContentType(NDNS_RESP);
 
   std::string str = "Just try it";
   Block s = makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size());
diff --git a/tests/unit/daemon/name-server.cpp b/tests/unit/daemon/name-server.cpp
index 64d0429..4b6af12 100644
--- a/tests/unit/daemon/name-server.cpp
+++ b/tests/unit/daemon/name-server.cpp
@@ -75,7 +75,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_LINK);
   });
 
   face.receive(q.toInterest());
@@ -103,13 +103,13 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_NACK);
   });
 
   face.receive(q.toInterest());
   run();
 
-  // will ask for the existing record (will have type NDNS_RAW, as it is certificate)
+  // will ask for the existing record (will have type NDNS_BLOB, as it is certificate)
   face.onSendData.connectSingleShot([&] (const Data& data) {
     ++nDataBack;
     NDNS_LOG_TRACE("get Data back");
@@ -117,7 +117,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_BLOB);
   });
 
   q.setRrLabel("dsk-1");
@@ -135,7 +135,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_BLOB);
   });
 
   run();
@@ -149,7 +149,7 @@
 
     Response resp;
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_NACK);
   });
 
   run();
@@ -163,7 +163,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("net"));
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -190,7 +190,7 @@
     Response resp;
 
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_RESP); // by default NDNS_BLOB is enough
     BOOST_CHECK_GT(resp.getRrs().size(), 0);
     Block block = resp.getRrs()[0];
     block.parse();
@@ -215,7 +215,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("net-XYZ")); // insert new records
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -242,7 +242,7 @@
     Response resp;
 
     BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-    BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
+    BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_RESP); // by default NDNS_BLOB is enough
     BOOST_CHECK_GT(resp.getRrs().size(), 0);
     Block block = resp.getRrs()[0];
     block.parse();
@@ -291,7 +291,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("ndnsim-XYZ")); // insert new records
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -393,7 +393,7 @@
   re.setQueryType(label::NDNS_ITERATIVE_QUERY);
   re.setRrLabel(Name("ndnsim-XYZ")); // insert new records
   re.setRrType(label::NS_RR_TYPE);
-  re.setNdnsType(NDNS_RESP);
+  re.setContentType(NDNS_RESP);
 
   std::string str = "ns1.ndnsim.net";
   re.addRr(makeBinaryBlock(ndns::tlv::RrData, str.c_str(), str.size()));
@@ -429,7 +429,7 @@
       Response resp;
 
       BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
-      BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
+      BOOST_CHECK_EQUAL(resp.getContentType(), NDNS_RESP); // by default NDNS_BLOB is enough
       BOOST_CHECK_GT(resp.getRrs().size(), 0);
       Block block = resp.getRrs()[0];
       block.parse();
diff --git a/tests/unit/database-test-data.cpp b/tests/unit/database-test-data.cpp
index 6edcd1c..4b1de42 100644
--- a/tests/unit/database-test-data.cpp
+++ b/tests/unit/database-test-data.cpp
@@ -78,17 +78,20 @@
     const time::seconds ttl(3000 + 100 * certificateIndex);
     const name::Component version = name::Component::fromVersion(100 + 1000 * certificateIndex);
     name::Component qType(label::NDNS_ITERATIVE_QUERY);
-    NdnsType ndnsType = NDNS_RESP;
+    NdnsContentType contentType = NDNS_RESP;
     if (type == label::CERT_RR_TYPE) {
-      ndnsType = NDNS_RAW;
+      contentType = NDNS_BLOB;
       qType = label::NDNS_CERT_QUERY;
+    } else if (type == label::NS_RR_TYPE) {
+      contentType = NDNS_LINK;
+    } else if (type == label::TXT_RR_TYPE) {
+      contentType = NDNS_RESP;
     }
     std::ostringstream os;
     os << "a fake content: " << (++certificateIndex) << "th";
 
-    addRrset(zone, label, type, ttl, version, qType, ndnsType, os.str());
+    addRrset(zone, label, type, ttl, version, qType, contentType, os.str());
   };
-
   addQueryRrset("/dsk-1", m_root, label::CERT_RR_TYPE);
   addQueryRrset("/net/ksk-2", m_root, label::CERT_RR_TYPE);
   addQueryRrset("/dsk-3", m_net, label::CERT_RR_TYPE);
@@ -114,7 +117,7 @@
 void
 DbTestData::addRrset(Zone& zone, const Name& label, const name::Component& type,
                      const time::seconds& ttl, const name::Component& version,
-                     const name::Component& qType, NdnsType ndnsType, const std::string& msg)
+                     const name::Component& qType, NdnsContentType contentType, const std::string& msg)
 {
   Rrset rrset;
   RrsetFactory rf(TEST_DATABASE.string(), zone.getName(),
@@ -123,7 +126,7 @@
   if (type == label::NS_RR_TYPE) {
     ndn::Link::DelegationSet ds = {std::pair<uint32_t, Name>(1,"/xx")};
     rrset = rf.generateNsRrset(label, type, version.toVersion(), ttl, ds);
-    if (ndnsType != NDNS_AUTH) {
+    if (contentType != NDNS_AUTH) {
       // do not add AUTH packet to link
       m_links.push_back(Link(rrset.getData()));
     }
diff --git a/tests/unit/database-test-data.hpp b/tests/unit/database-test-data.hpp
index 26e092f..82410fe 100644
--- a/tests/unit/database-test-data.hpp
+++ b/tests/unit/database-test-data.hpp
@@ -46,7 +46,7 @@
   void
   addRrset(Zone& zone, const Name& label, const name::Component& type,
            const time::seconds& ttl, const name::Component& version,
-           const name::Component& qType, NdnsType ndnsType, const std::string& msg);
+           const name::Component& qType, NdnsContentType contentType, const std::string& msg);
 public:
   class PreviousStateCleaner
   {