fix style issues
Change-Id: I4fbac59fdc87c8059cb09838a3604b811e14ff1f
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 0927e9c..2e0be42 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -73,7 +73,7 @@
BOOST_CHECK(security::verifySignature(response, cert));
auto contentBlock = response.getContent();
contentBlock.parse();
- auto caItem = infoEncoder::decodeDataContent(contentBlock);
+ auto caItem = infotlv::decodeDataContent(contentBlock);
BOOST_CHECK_EQUAL(caItem.m_caPrefix, "/ndn");
BOOST_CHECK_EQUAL(caItem.m_probeParameterKeys.size(), 1);
BOOST_CHECK_EQUAL(caItem.m_probeParameterKeys.front(), "full name");
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 4c295db..e76677f 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -83,7 +83,7 @@
BOOST_CHECK(security::verifySignature(response, cert));
auto contentBlock = response.getContent();
contentBlock.parse();
- auto caItem = infoEncoder::decodeDataContent(contentBlock);
+ auto caItem = infotlv::decodeDataContent(contentBlock);
BOOST_CHECK_EQUAL(caItem.m_caPrefix, "/ndn");
BOOST_CHECK_EQUAL(caItem.m_probeParameterKeys.size(), 1);
BOOST_CHECK_EQUAL(caItem.m_probeParameterKeys.front(), "full name");
diff --git a/tests/unit-tests/protocol-encoders.t.cpp b/tests/unit-tests/protocol-encoders.t.cpp
index 47e65f5..92e0e4d 100644
--- a/tests/unit-tests/protocol-encoders.t.cpp
+++ b/tests/unit-tests/protocol-encoders.t.cpp
@@ -42,8 +42,8 @@
caCache.load("tests/unit-tests/config-files/config-client-1");
auto& cert = caCache.getCaItems().front().m_cert;
- auto b = infoEncoder::encodeDataContent(config.m_caItem, *cert);
- auto item = infoEncoder::decodeDataContent(b);
+ auto b = infotlv::encodeDataContent(config.m_caItem, *cert);
+ auto item = infotlv::decodeDataContent(b);
BOOST_CHECK_EQUAL(*item.m_cert, *cert);
BOOST_CHECK_EQUAL(item.m_caInfo, config.m_caItem.m_caInfo);
@@ -56,8 +56,8 @@
BOOST_AUTO_TEST_CASE(ErrorEncoding)
{
std::string msg = "Just to test";
- auto b = errorEncoder::encodeDataContent(ErrorCode::NAME_NOT_ALLOWED, msg);
- auto item = errorEncoder::decodefromDataContent(b);
+ auto b = errortlv::encodeDataContent(ErrorCode::NAME_NOT_ALLOWED, msg);
+ auto item = errortlv::decodefromDataContent(b);
BOOST_CHECK_EQUAL(std::get<0>(item), ErrorCode::NAME_NOT_ALLOWED);
BOOST_CHECK_EQUAL(std::get<1>(item), msg);
}
@@ -67,8 +67,8 @@
std::multimap<std::string, std::string> parameters;
parameters.emplace("key1", "value1");
parameters.emplace("key2", "value2");
- auto appParam = probeEncoder::encodeApplicationParameters(std::move(parameters));
- auto param1 = probeEncoder::decodeApplicationParameters(appParam);
+ auto appParam = probetlv::encodeApplicationParameters(std::move(parameters));
+ auto param1 = probetlv::decodeApplicationParameters(appParam);
BOOST_CHECK_EQUAL(param1.size(), 2);
BOOST_CHECK_EQUAL(param1.find("key1")->second, "value1");
BOOST_CHECK_EQUAL(param1.find("key2")->second, "value2");
@@ -81,10 +81,10 @@
std::vector<Name> names;
names.emplace_back("/ndn/1");
names.emplace_back("/ndn/2");
- auto b = probeEncoder::encodeDataContent(names, 2, config.m_redirection);
+ auto b = probetlv::encodeDataContent(names, 2, config.m_redirection);
std::vector<std::pair<Name, int>> retNames;
std::vector<Name> redirection;
- probeEncoder::decodeDataContent(b, retNames, redirection);
+ probetlv::decodeDataContent(b, retNames, redirection);
BOOST_CHECK_EQUAL(retNames.size(), names.size());
auto it1 = retNames.begin();
auto it2 = names.begin();
@@ -106,10 +106,10 @@
caCache.load("tests/unit-tests/config-files/config-client-1");
auto& certRequest = caCache.getCaItems().front().m_cert;
std::vector<uint8_t> pub = ECDHState().getSelfPubKey();
- auto b = newRenewRevokeEncoder::encodeApplicationParameters(RequestType::REVOKE, pub, *certRequest);
+ auto b = requesttlv::encodeApplicationParameters(RequestType::REVOKE, pub, *certRequest);
std::vector<uint8_t> returnedPub;
std::shared_ptr<security::Certificate> returnedCert;
- newRenewRevokeEncoder::decodeApplicationParameters(b, RequestType::REVOKE, returnedPub, returnedCert);
+ requesttlv::decodeApplicationParameters(b, RequestType::REVOKE, returnedPub, returnedCert);
BOOST_CHECK_EQUAL(returnedPub.size(), pub.size());
for (auto it1 = returnedPub.begin(), it2 = pub.begin();
@@ -127,12 +127,12 @@
std::list<std::string> list;
list.emplace_back("abc");
list.emplace_back("def");
- auto b = newRenewRevokeEncoder::encodeDataContent(pub, salt, id, Status::BEFORE_CHALLENGE, list);
+ auto b = requesttlv::encodeDataContent(pub, salt, id, Status::BEFORE_CHALLENGE, list);
std::vector<uint8_t> returnedPub;
std::array<uint8_t, 32> returnedSalt;
RequestId returnedId;
Status s;
- auto retlist = newRenewRevokeEncoder::decodeDataContent(b, returnedPub, returnedSalt, returnedId, s);
+ auto retlist = requesttlv::decodeDataContent(b, returnedPub, returnedSalt, returnedId, s);
BOOST_CHECK_EQUAL_COLLECTIONS(returnedPub.begin(), returnedPub.end(), pub.begin(), pub.end());
BOOST_CHECK_EQUAL_COLLECTIONS(returnedSalt.begin(), returnedSalt.end(), salt.begin(), salt.end());
BOOST_CHECK_EQUAL_COLLECTIONS(returnedId.begin(), returnedId.end(), id.begin(), id.end());
@@ -152,12 +152,12 @@
ca::RequestState state(Name("/ndn/ucla"), id, RequestType::NEW, Status::PENDING,
certRequest, "pin", "test", time::system_clock::now(), 3, time::seconds(321), JsonSection(),
std::move(aesKey), 0);
- auto contentBlock = challengeEncoder::encodeDataContent(state, Name("/ndn/ucla/a/b/c"));
+ auto contentBlock = challengetlv::encodeDataContent(state, Name("/ndn/ucla/a/b/c"));
requester::RequestState context(m_keyChain, caCache.getCaItems().front(), RequestType::NEW);
context.m_requestId = id;
std::memcpy(context.m_aesKey.data(), key, sizeof(key));
- challengeEncoder::decodeDataContent(contentBlock, context);
+ challengetlv::decodeDataContent(contentBlock, context);
BOOST_CHECK_EQUAL(static_cast<size_t>(context.m_status), static_cast<size_t>(Status::PENDING));
BOOST_CHECK_EQUAL(context.m_challengeStatus, "test");
diff --git a/tests/unit-tests/requester.t.cpp b/tests/unit-tests/requester.t.cpp
index c9a1d1d..4f2c8be 100644
--- a/tests/unit-tests/requester.t.cpp
+++ b/tests/unit-tests/requester.t.cpp
@@ -81,7 +81,7 @@
Data reply;
reply.setName(Name("/site/CA/PROBE"));
reply.setFreshnessPeriod(time::seconds(100));
- reply.setContent(probeEncoder::encodeDataContent(availableNames, 3, ca.m_config.m_redirection));
+ reply.setContent(probetlv::encodeDataContent(availableNames, 3, ca.m_config.m_redirection));
m_keyChain.sign(reply, signingByIdentity(identity));
std::vector<std::pair<Name, int>> names;
@@ -114,7 +114,7 @@
Data errorPacket;
errorPacket.setName(Name("/site/pretend/this/is/error/packet"));
errorPacket.setFreshnessPeriod(time::seconds(100));
- errorPacket.setContent(errorEncoder::encodeDataContent(ErrorCode::INVALID_PARAMETER, "This is a test."));
+ errorPacket.setContent(errortlv::encodeDataContent(ErrorCode::INVALID_PARAMETER, "This is a test."));
m_keyChain.sign(errorPacket, signingByIdentity(identity));
std::vector<std::pair<Name, int>> ids;