all: rename Tlv namespace to tlv for consistency
This commit renames the Tlv namespace defined in
tlv.hpp to tlv to be more consistent with tlv::security
and tlv::nfd. A Tlv namespace alias is provided for
backwards compatibility.
Change-Id: I21278d6a077afe7776802c3296997d4c1c44c6c6
diff --git a/tests/unit-tests/security/test-conf-checker.cpp b/tests/unit-tests/security/test-conf-checker.cpp
index 9135a50..23df0cd 100644
--- a/tests/unit-tests/security/test-conf-checker.cpp
+++ b/tests/unit-tests/security/test-conf-checker.cpp
@@ -115,7 +115,7 @@
shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerEqual1 =
make_shared<RelationKeyLocatorNameChecker>(certName.getPrefix(-1),
KeyLocatorChecker::RELATION_EQUAL);
- CustomizedChecker checker1(Tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual1);
+ CustomizedChecker checker1(tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual1);
result = checker1.check(*data1,
bind(dataChecked, _1),
@@ -141,7 +141,7 @@
shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerEqual2 =
make_shared<RelationKeyLocatorNameChecker>(identity,
KeyLocatorChecker::RELATION_EQUAL);
- CustomizedChecker checker2(Tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual2);
+ CustomizedChecker checker2(tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual2);
result = checker2.check(*data1,
bind(dataCheckedFalse, _1),
@@ -157,7 +157,7 @@
shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerPrefix1 =
make_shared<RelationKeyLocatorNameChecker>(certName.getPrefix(-1),
KeyLocatorChecker::RELATION_IS_PREFIX_OF);
- CustomizedChecker checker3(Tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix1);
+ CustomizedChecker checker3(tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix1);
result = checker3.check(*data1,
bind(dataChecked, _1),
@@ -173,7 +173,7 @@
shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerPrefix2 =
make_shared<RelationKeyLocatorNameChecker>(identity,
KeyLocatorChecker::RELATION_IS_PREFIX_OF);
- CustomizedChecker checker4(Tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix2);
+ CustomizedChecker checker4(tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix2);
result = checker4.check(*data1,
bind(dataChecked, _1),
@@ -189,7 +189,7 @@
shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerStrict1 =
make_shared<RelationKeyLocatorNameChecker>(certName.getPrefix(-1),
KeyLocatorChecker::RELATION_IS_STRICT_PREFIX_OF);
- CustomizedChecker checker5(Tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict1);
+ CustomizedChecker checker5(tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict1);
result = checker5.check(*data1,
bind(dataCheckedFalse, _1),
@@ -204,7 +204,7 @@
shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerStrict2 =
make_shared<RelationKeyLocatorNameChecker>(identity,
KeyLocatorChecker::RELATION_IS_STRICT_PREFIX_OF);
- CustomizedChecker checker6(Tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict2);
+ CustomizedChecker checker6(tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict2);
result = checker6.check(*data1,
bind(dataCheckedFalse, _1),
@@ -254,7 +254,7 @@
shared_ptr<RegexKeyLocatorNameChecker> keyLocatorCheckerRegex1 =
make_shared<RegexKeyLocatorNameChecker>(
Regex("^<SecurityTestConfChecker><CustomizedCheckerTest2>"));
- CustomizedChecker checker1(Tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
+ CustomizedChecker checker1(tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
result = checker1.check(*data1,
bind(dataChecked, _1),
@@ -315,7 +315,7 @@
shared_ptr<RegexKeyLocatorNameChecker> keyLocatorCheckerRegex1 =
make_shared<RegexKeyLocatorNameChecker>(
Regex("^<SecurityTestConfChecker><CustomizedCheckerTest3>"));
- CustomizedChecker checker1(Tlv::SignatureSha256WithEcdsa, keyLocatorCheckerRegex1);
+ CustomizedChecker checker1(tlv::SignatureSha256WithEcdsa, keyLocatorCheckerRegex1);
result = checker1.check(*data1,
bind(dataChecked, _1),
@@ -338,7 +338,7 @@
BOOST_CHECK_EQUAL(result, -1);
- CustomizedChecker checker2(Tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
+ CustomizedChecker checker2(tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
result = checker2.check(*data1,
bind(dataCheckedFalse, _1),
@@ -388,7 +388,7 @@
int8_t result = 0;
- HierarchicalChecker checker1(Tlv::SignatureSha256WithEcdsa);
+ HierarchicalChecker checker1(tlv::SignatureSha256WithEcdsa);
result = checker1.check(*data1,
bind(dataChecked, _1),
@@ -421,7 +421,7 @@
BOOST_CHECK_EQUAL(result, -1);
- HierarchicalChecker checker2(Tlv::SignatureSha256WithRsa);
+ HierarchicalChecker checker2(tlv::SignatureSha256WithRsa);
result = checker2.check(*data1,
bind(dataCheckedFalse, _1),
@@ -491,7 +491,7 @@
int8_t result = 0;
- FixedSignerChecker checker1(Tlv::SignatureSha256WithEcdsa, certSet1);
+ FixedSignerChecker checker1(tlv::SignatureSha256WithEcdsa, certSet1);
result = checker1.check(*data1,
bind(dataChecked, _1),
@@ -504,7 +504,7 @@
BOOST_CHECK_EQUAL(result, -1);
- FixedSignerChecker checker2(Tlv::SignatureSha256WithRsa, certSet1);
+ FixedSignerChecker checker2(tlv::SignatureSha256WithRsa, certSet1);
result = checker2.check(*data1,
bind(dataCheckedFalse, _1),
@@ -517,7 +517,7 @@
BOOST_CHECK_EQUAL(result, -1);
- FixedSignerChecker checker3(Tlv::SignatureSha256WithEcdsa, certSet2);
+ FixedSignerChecker checker3(tlv::SignatureSha256WithEcdsa, certSet2);
result = checker3.check(*data1,
bind(dataCheckedFalse, _1),
@@ -530,7 +530,7 @@
BOOST_CHECK_EQUAL(result, -1);
- FixedSignerChecker checker4(Tlv::SignatureSha256WithRsa, certSet2);
+ FixedSignerChecker checker4(tlv::SignatureSha256WithRsa, certSet2);
result = checker4.check(*data1,
bind(dataCheckedFalse, _1),
diff --git a/tests/unit-tests/test-block.cpp b/tests/unit-tests/test-block.cpp
index c653177..cc860b7 100644
--- a/tests/unit-tests/test-block.cpp
+++ b/tests/unit-tests/test-block.cpp
@@ -40,7 +40,7 @@
0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 // == 4294967296LL
};
- using namespace Tlv;
+ using namespace tlv;
const uint8_t* begin;
uint64_t value;
@@ -117,7 +117,7 @@
0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 // == 4294967296LL
};
- using namespace Tlv;
+ using namespace tlv;
typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
typedef std::istream_iterator<uint8_t> Iterator;
@@ -257,7 +257,7 @@
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
};
- using namespace Tlv;
+ using namespace tlv;
const uint8_t* begin;
uint64_t value;
@@ -292,7 +292,7 @@
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
};
- using namespace Tlv;
+ using namespace tlv;
typedef boost::iostreams::stream<boost::iostreams::array_source> ArrayStream;
typedef std::istream_iterator<uint8_t> Iterator;
@@ -579,7 +579,7 @@
BOOST_CHECK_EQUAL(*testBlock.wire(), 0x01);
BOOST_CHECK_EQUAL(*testBlock.value(), 0xfb);
- BOOST_CHECK_THROW(Block::fromStream(stream), Tlv::Error);
+ BOOST_CHECK_THROW(Block::fromStream(stream), tlv::Error);
}
BOOST_AUTO_TEST_CASE(Equality)
diff --git a/tests/unit-tests/test-data.cpp b/tests/unit-tests/test-data.cpp
index 5ce434e..8de7a42 100644
--- a/tests/unit-tests/test-data.cpp
+++ b/tests/unit-tests/test-data.cpp
@@ -223,7 +223,7 @@
b = SignatureSha256WithRsa();
static const uint8_t someData[256] = {};
- Block signatureValue = dataBlock(Tlv::SignatureValue, someData, sizeof(someData));
+ Block signatureValue = dataBlock(tlv::SignatureValue, someData, sizeof(someData));
b.setValue(signatureValue);
BOOST_CHECK_EQUAL(a == b, false);
BOOST_CHECK_EQUAL(a != b, true);
@@ -277,7 +277,7 @@
ndn::Block block = d.getSignature().getInfo();
block.parse();
KeyLocator keyLocator;
- BOOST_REQUIRE_NO_THROW(keyLocator.wireDecode(block.get(Tlv::KeyLocator)));
+ BOOST_REQUIRE_NO_THROW(keyLocator.wireDecode(block.get(tlv::KeyLocator)));
BOOST_REQUIRE_EQUAL(keyLocator.getName().toUri(), "/test/key/locator");
@@ -301,11 +301,11 @@
d.setContent(Content1, sizeof(Content1));
- Block signatureInfo(Tlv::SignatureInfo);
+ Block signatureInfo(tlv::SignatureInfo);
// SignatureType
{
signatureInfo.push_back
- (nonNegativeIntegerBlock(Tlv::SignatureType, Signature::Sha256WithRsa));
+ (nonNegativeIntegerBlock(tlv::SignatureType, Signature::Sha256WithRsa));
}
// KeyLocator
{
@@ -318,7 +318,7 @@
// SignatureValue
OBufferStream os;
- Tlv::writeVarNumber(os, Tlv::SignatureValue);
+ tlv::writeVarNumber(os, tlv::SignatureValue);
using namespace CryptoPP;
@@ -334,7 +334,7 @@
SecByteBlock buf(length);
signer.Sign(rng_, hash, buf);
- Tlv::writeVarNumber(os, buf.size());
+ tlv::writeVarNumber(os, buf.size());
os.write(reinterpret_cast<const char *>(buf.BytePtr()), buf.size());
ndn::Block signatureValue(Block(os.buf()));
diff --git a/tests/unit-tests/test-interest.cpp b/tests/unit-tests/test-interest.cpp
index 82bf8bd..5430bbd 100644
--- a/tests/unit-tests/test-interest.cpp
+++ b/tests/unit-tests/test-interest.cpp
@@ -425,7 +425,7 @@
const Block& payload = nfd::LocalControlHeader::getPayload(wireBlock);
BOOST_REQUIRE_NE(&payload, &wireBlock);
- BOOST_CHECK_EQUAL(payload.type(), static_cast<uint32_t>(Tlv::Interest));
+ BOOST_CHECK_EQUAL(payload.type(), static_cast<uint32_t>(tlv::Interest));
BOOST_CHECK_EQUAL(wireBlock.type(), static_cast<uint32_t>(tlv::nfd::LocalControlHeader));
Interest interest(payload);
diff --git a/tests/unit-tests/test-signature-info.cpp b/tests/unit-tests/test-signature-info.cpp
index ad7d8f9..fc2cb52 100644
--- a/tests/unit-tests/test-signature-info.cpp
+++ b/tests/unit-tests/test-signature-info.cpp
@@ -48,14 +48,14 @@
BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
BOOST_CHECK_THROW(info.getKeyLocator(), SignatureInfo::Error);
- SignatureInfo sha256Info(Tlv::DigestSha256);
- BOOST_CHECK_EQUAL(sha256Info.getSignatureType(), Tlv::DigestSha256);
+ SignatureInfo sha256Info(tlv::DigestSha256);
+ BOOST_CHECK_EQUAL(sha256Info.getSignatureType(), tlv::DigestSha256);
BOOST_CHECK_EQUAL(sha256Info.hasKeyLocator(), false);
BOOST_CHECK_THROW(sha256Info.getKeyLocator(), SignatureInfo::Error);
KeyLocator keyLocator("/test/key/locator");
- SignatureInfo sha256RsaInfo(Tlv::SignatureSha256WithRsa, keyLocator);
- BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), Tlv::SignatureSha256WithRsa);
+ SignatureInfo sha256RsaInfo(tlv::SignatureSha256WithRsa, keyLocator);
+ BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), tlv::SignatureSha256WithRsa);
BOOST_CHECK_EQUAL(sha256RsaInfo.hasKeyLocator(), true);
BOOST_CHECK_NO_THROW(sha256RsaInfo.getKeyLocator());
BOOST_CHECK_EQUAL(sha256RsaInfo.getKeyLocator().getName(), Name("/test/key/locator"));
@@ -69,7 +69,7 @@
encoded.wire() + encoded.size());
sha256RsaInfo = SignatureInfo(sigInfoBlock);
- BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), Tlv::SignatureSha256WithRsa);
+ BOOST_CHECK_EQUAL(sha256RsaInfo.getSignatureType(), tlv::SignatureSha256WithRsa);
BOOST_CHECK_EQUAL(sha256RsaInfo.hasKeyLocator(), true);
BOOST_CHECK_NO_THROW(sha256RsaInfo.getKeyLocator());
BOOST_CHECK_EQUAL(sha256RsaInfo.getKeyLocator().getName(), Name("/test/key/locator"));
@@ -91,14 +91,14 @@
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
};
Block errorBlock1(error1, sizeof(error1));
- BOOST_CHECK_THROW(SignatureInfo info(errorBlock1), Tlv::Error);
+ BOOST_CHECK_THROW(SignatureInfo info(errorBlock1), tlv::Error);
const uint8_t error2[] = {
0x16, 0x01, // SignatureInfo
0x01 // Wrong SignatureInfo value
};
Block errorBlock2(error2, sizeof(error2));
- BOOST_CHECK_THROW(SignatureInfo info(errorBlock2), Tlv::Error);
+ BOOST_CHECK_THROW(SignatureInfo info(errorBlock2), tlv::Error);
const uint8_t error3[] = {
0x16, 0x01, // SignatureInfo
@@ -114,13 +114,13 @@
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72
};
Block errorBlock3(error3, sizeof(error3));
- BOOST_CHECK_THROW(SignatureInfo info(errorBlock3), Tlv::Error);
+ BOOST_CHECK_THROW(SignatureInfo info(errorBlock3), tlv::Error);
const uint8_t error4[] = {
0x16, 0x00 // Empty SignatureInfo
};
Block errorBlock4(error4, sizeof(error4));
- BOOST_CHECK_THROW(SignatureInfo info(errorBlock4), Tlv::Error);
+ BOOST_CHECK_THROW(SignatureInfo info(errorBlock4), tlv::Error);
}
@@ -131,8 +131,8 @@
BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
BOOST_CHECK_THROW(info.getKeyLocator(), SignatureInfo::Error);
- info.setSignatureType(Tlv::SignatureSha256WithRsa);
- BOOST_CHECK_EQUAL(info.getSignatureType(), Tlv::SignatureSha256WithRsa);
+ info.setSignatureType(tlv::SignatureSha256WithRsa);
+ BOOST_CHECK_EQUAL(info.getSignatureType(), tlv::SignatureSha256WithRsa);
BOOST_CHECK_EQUAL(info.hasKeyLocator(), false);
KeyLocator keyLocator("/test/key/locator");
diff --git a/tests/unit-tests/transport/dummy-face.hpp b/tests/unit-tests/transport/dummy-face.hpp
index fd724b0..faeae55 100644
--- a/tests/unit-tests/transport/dummy-face.hpp
+++ b/tests/unit-tests/transport/dummy-face.hpp
@@ -54,10 +54,10 @@
virtual void
send(const Block& wire)
{
- if (wire.type() == Tlv::Interest) {
+ if (wire.type() == tlv::Interest) {
m_sentInterests->push_back(Interest(wire));
}
- else if (wire.type() == Tlv::Data) {
+ else if (wire.type() == tlv::Data) {
m_sentDatas->push_back(Data(wire));
}
}