util: add literal operators for duration types
Change-Id: I007fa61c80e535c6e4b12e85a32eeeee62fecc3c
Refs: #4468
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index ee80dd1..79d5eb2 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.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).
*
@@ -87,8 +87,8 @@
request.setName(request.getKeyName().append("parent").appendVersion());
SignatureInfo info;
- info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
- time::system_clock::now() + time::days(7300)));
+ auto now = time::system_clock::now();
+ info.setValidityPeriod(security::ValidityPeriod(now, now + 7300_days));
v2::AdditionalDescription description;
description.set("type", "sub-certificate");
@@ -112,15 +112,15 @@
// set metainfo
certificate.setContentType(tlv::ContentType_Key);
- certificate.setFreshnessPeriod(time::hours(1));
+ certificate.setFreshnessPeriod(1_h);
// set content
certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
// set signature-info
SignatureInfo info;
- info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
- time::system_clock::now() + time::days(10)));
+ auto now = time::system_clock::now();
+ info.setValidityPeriod(security::ValidityPeriod(now, now + 10_days));
m_keyChain.sign(certificate, signingByKey(key).setSignatureInfo(info));
return certificate;