build: switch to C++17
Change-Id: Ia147b22fbdee68d87f0289851683ffbbb4466caa
diff --git a/tests/unit/daemon/db-mgr.t.cpp b/tests/unit/daemon/db-mgr.t.cpp
index 0b69330..a30f2dc 100644
--- a/tests/unit/daemon/db-mgr.t.cpp
+++ b/tests/unit/daemon/db-mgr.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2022, 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.
@@ -18,7 +18,6 @@
*/
#include "daemon/db-mgr.hpp"
-#include "logger.hpp"
#include "boost-test.hpp"
@@ -29,8 +28,6 @@
namespace ndns {
namespace tests {
-NDNS_LOG_INIT(DbMgrTest);
-
BOOST_AUTO_TEST_SUITE(DbMgr)
const auto TEST_DATABASE2 = boost::filesystem::path(UNIT_TESTS_TMPDIR) / "test-ndns.db";
@@ -46,7 +43,6 @@
~DbMgrFixture()
{
session.close();
- NDNS_LOG_INFO("remove database " << TEST_DATABASE2);
boost::filesystem::remove(TEST_DATABASE2);
}
@@ -113,7 +109,7 @@
rrset1.setTtl(time::seconds(4600));
static const std::string DATA1 = "SOME DATA";
- rrset1.setData(makeBinaryBlock(ndn::tlv::Content, DATA1.c_str(), DATA1.size()));
+ rrset1.setData(makeStringBlock(ndn::tlv::Content, DATA1));
BOOST_CHECK_EQUAL(rrset1.getId(), 0);
BOOST_CHECK_NO_THROW(session.insert(rrset1));
@@ -141,7 +137,7 @@
rrset1.setVersion(name::Component::fromVersion(890));
static const std::string DATA2 = "ANOTHER DATA";
- rrset1.setData(makeBinaryBlock(ndn::tlv::Content, DATA2.c_str(), DATA2.size()));
+ rrset1.setData(makeStringBlock(ndn::tlv::Content, DATA2));
BOOST_CHECK_NO_THROW(session.update(rrset1));
@@ -190,7 +186,7 @@
rrset1.setId(1);
BOOST_CHECK_NO_THROW(session.remove(rrset1));
- rrset1.setZone(0);
+ rrset1.setZone(nullptr);
rrset1.setId(1);
BOOST_CHECK_NO_THROW(session.remove(rrset1));
}
@@ -233,7 +229,7 @@
rrset1.setTtl(time::seconds(4600));
static const std::string DATA1 = "SOME DATA";
- rrset1.setData(makeBinaryBlock(ndn::tlv::Content, DATA1.data(), DATA1.size()));
+ rrset1.setData(makeStringBlock(ndn::tlv::Content, DATA1));
session.insert(rrset1);
Rrset rrset2(&zone);
@@ -242,14 +238,13 @@
rrset2.setVersion(name::Component::fromVersion(232));
rrset2.setTtl(time::seconds(2100));
std::string data2 = "host1.net";
- rrset2.setData(makeBinaryBlock(ndn::tlv::Content, data2.c_str(), data2.size()));
+ rrset2.setData(makeStringBlock(ndn::tlv::Content, data2));
session.insert(rrset2);
std::vector<Rrset> vec = session.findRrsets(zone);
BOOST_CHECK_EQUAL(vec.size(), 2);
- std::sort(vec.begin(),
- vec.end(),
+ std::sort(vec.begin(), vec.end(),
[] (const Rrset& n1, const Rrset& n2) {
return n1.getLabel().size() < n2.getLabel().size();
});