encoding: convert to span
Change-Id: I8bd73284fbd5acc0ff8ad2626af9b4324e9df7a1
diff --git a/tests/unit/mgmt/status-dataset-context.t.cpp b/tests/unit/mgmt/status-dataset-context.t.cpp
index 6d1e0b9..4192337 100644
--- a/tests/unit/mgmt/status-dataset-context.t.cpp
+++ b/tests/unit/mgmt/status-dataset-context.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -67,7 +67,7 @@
size_t valueLength = 0;
for (const auto& args : sendDataHistory) {
const auto& content = args.content;
- valueLength += encoder.appendByteArray(content.value(), content.value_size());
+ valueLength += encoder.appendBytes({content.value(), content.value_size()});
}
encoder.prependVarNumber(valueLength);
encoder.prependVarNumber(tlv::Content);
@@ -237,7 +237,7 @@
BOOST_AUTO_TEST_CASE(AppendReject)
{
const uint8_t buf[] = {0x82, 0x01, 0x02};
- BOOST_CHECK_NO_THROW(context.append(Block(buf, sizeof(buf))));
+ BOOST_CHECK_NO_THROW(context.append(Block(buf)));
BOOST_CHECK_EXCEPTION(context.reject(), std::logic_error, [] (const auto& e) {
return e.what() == "cannot call reject() after append/end"s;
});
@@ -246,7 +246,7 @@
BOOST_AUTO_TEST_CASE(AppendEndReject)
{
const uint8_t buf[] = {0x82, 0x01, 0x02};
- BOOST_CHECK_NO_THROW(context.append(Block(buf, sizeof(buf))));
+ BOOST_CHECK_NO_THROW(context.append(Block(buf)));
BOOST_CHECK_NO_THROW(context.end());
BOOST_CHECK_EXCEPTION(context.reject(), std::logic_error, [] (const auto& e) {
return e.what() == "cannot call reject() after append/end"s;
@@ -257,7 +257,7 @@
{
BOOST_CHECK_NO_THROW(context.end());
const uint8_t buf[] = {0x82, 0x01, 0x02};
- BOOST_CHECK_EXCEPTION(context.append(Block(buf, sizeof(buf))), std::logic_error, [] (const auto& e) {
+ BOOST_CHECK_EXCEPTION(context.append(Block(buf)), std::logic_error, [] (const auto& e) {
return e.what() == "cannot call append() on a finalized context"s;
});
}
@@ -282,7 +282,7 @@
{
BOOST_CHECK_NO_THROW(context.reject());
const uint8_t buf[] = {0x82, 0x01, 0x02};
- BOOST_CHECK_EXCEPTION(context.append(Block(buf, sizeof(buf))), std::logic_error, [] (const auto& e) {
+ BOOST_CHECK_EXCEPTION(context.append(Block(buf)), std::logic_error, [] (const auto& e) {
return e.what() == "cannot call append() on a finalized context"s;
});
}