encoding: delete deprecated overload of Block::Block
Change-Id: I5e7a702e6cf7ea7389a923bc0b62f523f46ab229
diff --git a/tests/unit-tests/encoding/block.t.cpp b/tests/unit-tests/encoding/block.t.cpp
index 0036175..f094460 100644
--- a/tests/unit-tests/encoding/block.t.cpp
+++ b/tests/unit-tests/encoding/block.t.cpp
@@ -473,18 +473,21 @@
BOOST_AUTO_TEST_CASE(Equality)
{
- Block a("\x08\x00", 2);
- Block b("\x08\x00", 2);;
+ const uint8_t one[] = {0x08, 0x00};
+ Block a(one, sizeof(one));
+ Block b(one, sizeof(one));
BOOST_CHECK_EQUAL(a == b, true);
BOOST_CHECK_EQUAL(a != b, false);
- Block c("\x06\x00", 2);
- Block d("\x08\x00", 2);;
+ const uint8_t two[] = {0x06, 0x00};
+ Block c(two, sizeof(two));
+ Block d(one, sizeof(one));
BOOST_CHECK_EQUAL(c == d, false);
BOOST_CHECK_EQUAL(c != d, true);
- Block e("\x06\x00", 2);
- Block f("\x06\x01\xcc", 3);;
+ const uint8_t three[] = {0x06, 0x01, 0xcc};
+ Block e(two, sizeof(two));
+ Block f(three, sizeof(three));
BOOST_CHECK_EQUAL(e == f, false);
BOOST_CHECK_EQUAL(e != f, true);
}
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)