Skip to content

Commit

Permalink
tests: use std::optional
Browse files Browse the repository at this point in the history
Change-Id: I53feb53061cd8374bc296b7dfd13175d7c7d4e37
  • Loading branch information
Pesa committed Mar 13, 2023
1 parent ad26607 commit 3653dae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/peek/ndnpeek.t.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
Expand Down Expand Up @@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Default, OutputCheck, OutputChecks)
BOOST_CHECK_EQUAL(interest.getMustBeFresh(), false);
BOOST_CHECK_EQUAL(interest.getForwardingHint().empty(), true);
BOOST_CHECK_EQUAL(interest.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
BOOST_CHECK(interest.getHopLimit() == nullopt);
BOOST_CHECK(interest.getHopLimit() == std::nullopt);
BOOST_CHECK(!interest.hasApplicationParameters());
BOOST_CHECK(peek->getResult() == NdnPeek::Result::DATA);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/test-common.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -28,8 +28,8 @@
namespace ndn::tests {

shared_ptr<Interest>
makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> lifetime,
optional<Interest::Nonce> nonce)
makeInterest(const Name& name, bool canBePrefix, std::optional<time::milliseconds> lifetime,
std::optional<Interest::Nonce> nonce)
{
auto interest = std::make_shared<Interest>(name);
interest->setCanBePrefix(canBePrefix);
Expand Down
8 changes: 4 additions & 4 deletions tests/test-common.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -36,8 +36,8 @@ namespace ndn::tests {
*/
shared_ptr<Interest>
makeInterest(const Name& name, bool canBePrefix = false,
optional<time::milliseconds> lifetime = nullopt,
optional<Interest::Nonce> nonce = nullopt);
std::optional<time::milliseconds> lifetime = std::nullopt,
std::optional<Interest::Nonce> nonce = std::nullopt);

/**
* \brief Create a Data with a null (i.e., empty) signature
Expand Down Expand Up @@ -71,7 +71,7 @@ makeNack(Interest interest, lp::NackReason reason);

/**
* \brief Replace a name component in a packet
* \param[inout] pkt the packet
* \param[in,out] pkt the packet
* \param index the index of the name component to replace
* \param args arguments to name::Component constructor
*/
Expand Down

0 comments on commit 3653dae

Please sign in to comment.