tests: avoid deprecated Data::getSignature()
Change-Id: Ica204fe6cd60f070b49f9ec5b72c0f68a32065d6
diff --git a/tests/chunks/producer.t.cpp b/tests/chunks/producer.t.cpp
index e2de21e..6b46320 100644
--- a/tests/chunks/producer.t.cpp
+++ b/tests/chunks/producer.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2019, Regents of the University of California,
+ * Copyright (c) 2016-2020, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -115,9 +115,8 @@
auto lastData = face.sentData.back();
BOOST_REQUIRE_EQUAL(lastData.getName().size(), prefix.size() + 2);
BOOST_CHECK_EQUAL(lastData.getName()[-1].toSegment(), 0);
- BOOST_REQUIRE(lastData.getFinalBlock());
- BOOST_CHECK_EQUAL(lastData.getFinalBlock()->toSegment(), nSegments - 1);
- BOOST_CHECK_EQUAL(lastData.getSignature().getKeyLocator().getName(), keyLocatorName);
+ BOOST_CHECK_EQUAL(lastData.getFinalBlock().value().toSegment(), nSegments - 1);
+ BOOST_CHECK_EQUAL(lastData.getKeyLocator().value().getName(), keyLocatorName);
// segment request
Name nameWithVersion(prefix);
@@ -131,9 +130,8 @@
lastData = face.sentData.back();
BOOST_REQUIRE_EQUAL(lastData.getName().size(), prefix.size() + 2);
BOOST_CHECK_EQUAL(lastData.getName()[-1].toSegment(), requestSegmentNo);
- BOOST_REQUIRE(lastData.getFinalBlock());
- BOOST_CHECK_EQUAL(lastData.getFinalBlock()->toSegment(), nSegments - 1);
- BOOST_CHECK_EQUAL(lastData.getSignature().getKeyLocator().getName(), keyLocatorName);
+ BOOST_CHECK_EQUAL(lastData.getFinalBlock().value().toSegment(), nSegments - 1);
+ BOOST_CHECK_EQUAL(lastData.getKeyLocator().value().getName(), keyLocatorName);
}
BOOST_AUTO_TEST_CASE(RequestSegmentSpecifiedVersion)
@@ -151,9 +149,8 @@
BOOST_REQUIRE_EQUAL(lastData.getName().size(), prefix.size() + 1);
BOOST_CHECK_EQUAL(lastData.getName()[-2].toVersion(), version);
BOOST_CHECK_EQUAL(lastData.getName()[-1].toSegment(), 0);
- BOOST_REQUIRE(lastData.getFinalBlock());
- BOOST_CHECK_EQUAL(lastData.getFinalBlock()->toSegment(), nSegments - 1);
- BOOST_CHECK_EQUAL(lastData.getSignature().getKeyLocator().getName(), keyLocatorName);
+ BOOST_CHECK_EQUAL(lastData.getFinalBlock().value().toSegment(), nSegments - 1);
+ BOOST_CHECK_EQUAL(lastData.getKeyLocator().value().getName(), keyLocatorName);
// segment request
Name nameWithVersion(prefix);
@@ -167,9 +164,8 @@
BOOST_REQUIRE_EQUAL(lastData.getName().size(), prefix.size() + 1);
BOOST_CHECK_EQUAL(lastData.getName()[-2].toVersion(), version);
BOOST_CHECK_EQUAL(lastData.getName()[-1].toSegment(), requestSegmentNo);
- BOOST_REQUIRE(lastData.getFinalBlock());
- BOOST_CHECK_EQUAL(lastData.getFinalBlock()->toSegment(), nSegments - 1);
- BOOST_CHECK_EQUAL(lastData.getSignature().getKeyLocator().getName(), keyLocatorName);
+ BOOST_CHECK_EQUAL(lastData.getFinalBlock().value().toSegment(), nSegments - 1);
+ BOOST_CHECK_EQUAL(lastData.getKeyLocator().value().getName(), keyLocatorName);
}
BOOST_AUTO_TEST_CASE(RequestNotExistingSegment)
@@ -186,9 +182,8 @@
auto lastData = face.sentData.back();
BOOST_REQUIRE_EQUAL(lastData.getName().size(), prefix.size() + 2);
BOOST_CHECK_EQUAL(lastData.getName()[-1].toSegment(), 0);
- BOOST_REQUIRE(lastData.getFinalBlock());
- BOOST_CHECK_EQUAL(lastData.getFinalBlock()->toSegment(), nSegments - 1);
- BOOST_CHECK_EQUAL(lastData.getSignature().getKeyLocator().getName(), keyLocatorName);
+ BOOST_CHECK_EQUAL(lastData.getFinalBlock().value().toSegment(), nSegments - 1);
+ BOOST_CHECK_EQUAL(lastData.getKeyLocator().value().getName(), keyLocatorName);
// segment request
Name nameWithVersion(prefix);
diff --git a/tests/peek/ndnpoke.t.cpp b/tests/peek/ndnpoke.t.cpp
index 621a699..09a562c 100644
--- a/tests/peek/ndnpoke.t.cpp
+++ b/tests/peek/ndnpoke.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -90,7 +90,7 @@
BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms);
BOOST_CHECK_EQUAL(face.sentData.back().getContentType(), tlv::ContentType_Blob);
BOOST_CHECK_EQUAL(face.sentData.back().getContent(), "150E48656C6C6F2C20776F726C64210A"_block);
- BOOST_CHECK_EQUAL(face.sentData.back().getSignature().getType(), tlv::SignatureSha256WithEcdsa);
+ BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa);
// Check for prefix unregistration
BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2); // One for registration, one for unregistration
@@ -135,7 +135,7 @@
BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test");
BOOST_CHECK(!face.sentData.back().getFinalBlock());
BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 1_s);
- BOOST_CHECK_EQUAL(face.sentData.back().getSignature().getType(), tlv::SignatureSha256WithEcdsa);
+ BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa);
}
BOOST_AUTO_TEST_CASE(FinalBlockId)
@@ -157,7 +157,7 @@
BOOST_REQUIRE(face.sentData.back().getFinalBlock());
BOOST_CHECK_EQUAL(*(face.sentData.back().getFinalBlock()), name::Component("123"));
BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms);
- BOOST_CHECK_EQUAL(face.sentData.back().getSignature().getType(), tlv::SignatureSha256WithEcdsa);
+ BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa);
}
BOOST_AUTO_TEST_CASE(DigestSha256)
@@ -177,7 +177,7 @@
BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test");
BOOST_CHECK(!face.sentData.back().getFinalBlock());
BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms);
- BOOST_CHECK_EQUAL(face.sentData.back().getSignature().getType(), tlv::DigestSha256);
+ BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::DigestSha256);
}
BOOST_AUTO_TEST_CASE(Unsolicited)
@@ -194,7 +194,7 @@
BOOST_CHECK_EQUAL(face.sentData.back().getName(), "/poke/test");
BOOST_CHECK(!face.sentData.back().getFinalBlock());
BOOST_CHECK_EQUAL(face.sentData.back().getFreshnessPeriod(), 0_ms);
- BOOST_CHECK_EQUAL(face.sentData.back().getSignature().getType(), tlv::SignatureSha256WithEcdsa);
+ BOOST_CHECK_EQUAL(face.sentData.back().getSignatureType(), tlv::SignatureSha256WithEcdsa);
}
BOOST_AUTO_TEST_CASE(Timeout)