daemon: Support query that explicitly specify version
Change-Id: I8eac2c5d2a646fbb965691498f8d416a86b70763
diff --git a/tests/unit/daemon/name-server.cpp b/tests/unit/daemon/name-server.cpp
index 32f911c..9e7a926 100644
--- a/tests/unit/daemon/name-server.cpp
+++ b/tests/unit/daemon/name-server.cpp
@@ -130,6 +130,34 @@
run();
BOOST_CHECK_EQUAL(nDataBack, 2);
+
+ // explicit interest with correct version
+ face->receive(Interest("/test19/KEY/dsk-1/ID-CERT/%FDd"));
+
+ face->onSendData.connectSingleShot([&] (const Data& data) {
+ ++nDataBack;
+
+ Response resp;
+ BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
+ });
+
+ run();
+ BOOST_CHECK_EQUAL(nDataBack, 3);
+
+ // explicit interest with wrong version
+ face->receive(Interest("/test19/KEY/dsk-1/ID-CERT/%FD010101010"));
+
+ face->onSendData.connectSingleShot([&] (const Data& data) {
+ ++nDataBack;
+
+ Response resp;
+ BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
+ });
+
+ run();
+ BOOST_CHECK_EQUAL(nDataBack, 4);
}
BOOST_AUTO_TEST_CASE(UpdateReplaceRr)