encoding: delete deprecated overload of Block::Block
Change-Id: I5e7a702e6cf7ea7389a923bc0b62f523f46ab229
diff --git a/tests/unit-tests/mgmt/dispatcher.t.cpp b/tests/unit-tests/mgmt/dispatcher.t.cpp
index b9577cb..535e8bd 100644
--- a/tests/unit-tests/mgmt/dispatcher.t.cpp
+++ b/tests/unit-tests/mgmt/dispatcher.t.cpp
@@ -304,21 +304,23 @@
BOOST_AUTO_TEST_CASE(StatusDataset)
{
- static Block smallBlock("\x81\x01\0x01", 3);
- static Block largeBlock = [] () -> Block {
+ const uint8_t smallBuf[] = {0x81, 0x01, 0x01};
+ const Block smallBlock(smallBuf, sizeof(smallBuf));
+ Block largeBlock;
+ {
EncodingBuffer encoder;
for (size_t i = 0; i < 2500; ++i) {
encoder.prependByte(1);
}
encoder.prependVarNumber(2500);
encoder.prependVarNumber(129);
- return encoder.block();
- }();
+ largeBlock = encoder.block();
+ }
dispatcher.addStatusDataset("test/small",
makeTestAuthorization(),
- [] (const Name& prefix, const Interest& interest,
- StatusDatasetContext& context) {
+ [&smallBlock] (const Name& prefix, const Interest& interest,
+ StatusDatasetContext& context) {
context.append(smallBlock);
context.append(smallBlock);
context.append(smallBlock);
@@ -327,8 +329,8 @@
dispatcher.addStatusDataset("test/large",
makeTestAuthorization(),
- [] (const Name& prefix, const Interest& interest,
- StatusDatasetContext& context) {
+ [&largeBlock] (const Name& prefix, const Interest& interest,
+ StatusDatasetContext& context) {
context.append(largeBlock);
context.append(largeBlock);
context.append(largeBlock);
@@ -436,8 +438,8 @@
BOOST_AUTO_TEST_CASE(NotificationStream)
{
- static Block block("\x82\x01\x02", 3);
-
+ const uint8_t buf[] = {0x82, 0x01, 0x02};
+ const Block block(buf, sizeof(buf));
auto post = dispatcher.addNotificationStream("test");
post(block);
diff --git a/tests/unit-tests/mgmt/status-dataset-context.t.cpp b/tests/unit-tests/mgmt/status-dataset-context.t.cpp
index be7b198..5c432a7 100644
--- a/tests/unit-tests/mgmt/status-dataset-context.t.cpp
+++ b/tests/unit-tests/mgmt/status-dataset-context.t.cpp
@@ -253,13 +253,15 @@
BOOST_AUTO_TEST_CASE(AppendReject)
{
- BOOST_CHECK_NO_THROW(context.append(Block("\x82\x01\x02", 3)));
+ const uint8_t buf[] = {0x82, 0x01, 0x02};
+ BOOST_CHECK_NO_THROW(context.append(Block(buf, sizeof(buf))));
BOOST_CHECK_THROW(context.reject(), std::domain_error);
}
BOOST_AUTO_TEST_CASE(AppendEndReject)
{
- BOOST_CHECK_NO_THROW(context.append(Block("\x82\x01\x02", 3)));
+ const uint8_t buf[] = {0x82, 0x01, 0x02};
+ BOOST_CHECK_NO_THROW(context.append(Block(buf, sizeof(buf))));
BOOST_CHECK_NO_THROW(context.end());
BOOST_CHECK_THROW(context.reject(), std::domain_error);
}
@@ -268,7 +270,8 @@
{
BOOST_CHECK_NO_THROW(context.end());
// end, append -> error
- BOOST_CHECK_THROW(context.append(Block("\x82\x01\x02", 3)), std::domain_error);
+ const uint8_t buf[] = {0x82, 0x01, 0x02};
+ BOOST_CHECK_THROW(context.append(Block(buf, sizeof(buf))), std::domain_error);
}
BOOST_AUTO_TEST_CASE(EndEnd)
@@ -286,7 +289,8 @@
BOOST_AUTO_TEST_CASE(RejectAppend)
{
BOOST_CHECK_NO_THROW(context.reject());
- BOOST_CHECK_THROW(context.append(Block("\x82\x01\x02", 3)), std::domain_error);
+ const uint8_t buf[] = {0x82, 0x01, 0x02};
+ BOOST_CHECK_THROW(context.append(Block(buf, sizeof(buf))), std::domain_error);
}
BOOST_AUTO_TEST_CASE(RejectEnd)