Introduce Denial-of-Existence (DoE) for Nack response.
Note this commit changes how names are stored in the database, compliant
to the canonical order.
Change-Id: I9857aaefc1f7da08ff53eff43c8f8c8bd5443953
Refs: #4152
diff --git a/tests/unit/daemon/rrset.cpp b/tests/unit/daemon/rrset.cpp
index c71fe0b..d202e78 100644
--- a/tests/unit/daemon/rrset.cpp
+++ b/tests/unit/daemon/rrset.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California.
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -50,6 +50,9 @@
// rrset2.setZone(nullptr);
BOOST_CHECK_EQUAL(rrset1, rrset2); // zone point to nullptr
+ bool isLess = rrset1 < rrset2;
+ BOOST_CHECK_EQUAL(isLess, false);
+
rrset2.setId(2);
BOOST_CHECK_EQUAL(rrset1, rrset2); // with different Id
@@ -58,9 +61,14 @@
rrset2.setZone(&zone);
BOOST_CHECK_NE(rrset1, rrset2); // with different zone name
+ BOOST_CHECK_THROW(isLess = rrset1 < rrset2, std::runtime_error);
+
rrset1.setZone(&zone);
BOOST_CHECK_EQUAL(rrset1, rrset2);
+ isLess = rrset1 < rrset2;
+ BOOST_CHECK_EQUAL(isLess, false);
+
Zone zone3("/ndn");
rrset1.setZone(&zone3);
BOOST_CHECK_EQUAL(rrset1, rrset2);
@@ -71,14 +79,26 @@
rrset2 = rrset1;
rrset2.setLabel(Name("/www/2"));
BOOST_CHECK_NE(rrset1, rrset2);
+
+ isLess = rrset1 < rrset2;
+ BOOST_CHECK_EQUAL(isLess, true);
+
rrset2 = rrset1;
rrset2.setType(name::Component("TXT"));
BOOST_CHECK_NE(rrset1, rrset2);
+
+ isLess = rrset1 < rrset2;
+ BOOST_CHECK_EQUAL(isLess, true);
+
rrset2 = rrset1;
rrset2.setVersion(name::Component::fromVersion(2));
BOOST_CHECK_NE(rrset1, rrset2);
+
+ isLess = rrset1 < rrset2;
+ BOOST_CHECK_EQUAL(isLess, true);
+
rrset2 = rrset1;
rrset2.setTtl(time::seconds(1));