tests: Do not use ``using namespace ndn'' and defining all tests in ndn namespace
Change-Id: I3299e6255e4067b142ad0c8f87bebe1892505d0d
diff --git a/tests/test-certificate-cache.cpp b/tests/test-certificate-cache.cpp
index 29a45fc..3718170 100644
--- a/tests/test-certificate-cache.cpp
+++ b/tests/test-certificate-cache.cpp
@@ -10,8 +10,8 @@
#include "face.hpp"
using namespace std;
-using namespace ndn;
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestCertificateCache)
@@ -55,3 +55,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-encode-decode-block.cpp b/tests/test-encode-decode-block.cpp
index 301f9c3..fe433a4 100644
--- a/tests/test-encode-decode-block.cpp
+++ b/tests/test-encode-decode-block.cpp
@@ -9,7 +9,8 @@
#include "interest.hpp"
using namespace std;
-using namespace ndn;
+
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestBlock)
@@ -64,3 +65,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-encode-decode-certificate.cpp b/tests/test-encode-decode-certificate.cpp
index 8a66d41..409e757 100644
--- a/tests/test-encode-decode-certificate.cpp
+++ b/tests/test-encode-decode-certificate.cpp
@@ -21,7 +21,7 @@
#include <boost/test/output_test_stream.hpp>
using namespace std;
-using namespace ndn;
+namespace ndn {
using namespace CryptoPP;
@@ -181,3 +181,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index 98685a7..0e13d75 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -22,7 +22,7 @@
#include <cryptopp/files.h>
using namespace std;
-using namespace ndn;
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestData)
@@ -201,3 +201,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-encode-decode-forwarding-entry.cpp b/tests/test-encode-decode-forwarding-entry.cpp
index 087b363..89c0d46 100644
--- a/tests/test-encode-decode-forwarding-entry.cpp
+++ b/tests/test-encode-decode-forwarding-entry.cpp
@@ -17,7 +17,7 @@
#include <boost/test/output_test_stream.hpp>
using namespace std;
-using namespace ndn;
+namespace ndn {
const uint8_t FORWARDING_ENTRY[] = {0x81, 0x19, 0x83, 0x07, 0x73, 0x65, 0x6c, 0x66, 0x72, 0x65, 0x67, 0x03, 0x0b, 0x04, 0x01, 0x61, 0x04, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x8a, 0x01, 0x03};
@@ -53,3 +53,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-encode-decode-interest.cpp b/tests/test-encode-decode-interest.cpp
index 6c2a40e..db193e8 100644
--- a/tests/test-encode-decode-interest.cpp
+++ b/tests/test-encode-decode-interest.cpp
@@ -9,7 +9,7 @@
#include "interest.hpp"
using namespace std;
-using namespace ndn;
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestInterest)
@@ -79,3 +79,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-faces.cpp b/tests/test-faces.cpp
index a8d6135..67c5add 100644
--- a/tests/test-faces.cpp
+++ b/tests/test-faces.cpp
@@ -8,7 +8,7 @@
#include "face.hpp"
using namespace std;
-using namespace ndn;
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestFaces)
@@ -93,3 +93,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-regex.cpp b/tests/test-regex.cpp
index 75ca0fe..b5d5903 100644
--- a/tests/test-regex.cpp
+++ b/tests/test-regex.cpp
@@ -18,8 +18,8 @@
#include <iostream>
-using namespace ndn;
using namespace std;
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestRegex)
@@ -447,3 +447,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-sec-public-info-sqlite3.cpp b/tests/test-sec-public-info-sqlite3.cpp
index 233109c..6e684e9 100644
--- a/tests/test-sec-public-info-sqlite3.cpp
+++ b/tests/test-sec-public-info-sqlite3.cpp
@@ -13,8 +13,7 @@
#include "security/key-chain.hpp"
using namespace std;
-using namespace ndn;
-
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestSecPublicInfoSqlite3)
@@ -73,3 +72,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-sec-tpm-file.cpp b/tests/test-sec-tpm-file.cpp
index fd27ae8..a81b794 100644
--- a/tests/test-sec-tpm-file.cpp
+++ b/tests/test-sec-tpm-file.cpp
@@ -14,8 +14,7 @@
#include <cryptopp/rsa.h>
using namespace std;
-using namespace ndn;
-
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestSecTpmFile)
@@ -67,3 +66,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-sec-tpm-osx.cpp b/tests/test-sec-tpm-osx.cpp
index 8c57dc0..9e0f29f 100644
--- a/tests/test-sec-tpm-osx.cpp
+++ b/tests/test-sec-tpm-osx.cpp
@@ -14,8 +14,7 @@
#include <cryptopp/rsa.h>
using namespace std;
-using namespace ndn;
-
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestSecTpmOsx)
@@ -67,3 +66,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-signed-interest.cpp b/tests/test-signed-interest.cpp
index c321057..2d03097 100644
--- a/tests/test-signed-interest.cpp
+++ b/tests/test-signed-interest.cpp
@@ -11,8 +11,7 @@
#include <iostream>
using namespace std;
-using namespace ndn;
-
+namespace ndn {
BOOST_AUTO_TEST_SUITE(TestSignedInterest)
@@ -38,3 +37,5 @@
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn
diff --git a/tests/test-time.cpp b/tests/test-time.cpp
index d59400e..be4cc77 100644
--- a/tests/test-time.cpp
+++ b/tests/test-time.cpp
@@ -7,17 +7,21 @@
#include "util/time.hpp"
+namespace ndn {
+
BOOST_AUTO_TEST_SUITE(TestTime)
BOOST_AUTO_TEST_CASE (Simple)
{
- ndn::MillisecondsSince1970 value = ndn::getNowMilliseconds();
+ MillisecondsSince1970 value = getNowMilliseconds();
BOOST_CHECK_GT(value, 1390966967032);
- BOOST_CHECK_EQUAL(ndn::toIsoString(1390966967032), "20140129T034247.032000");
- BOOST_CHECK_EQUAL(ndn::fromIsoString("20140129T034247.032000"), 1390966967032);
+ BOOST_CHECK_EQUAL(toIsoString(1390966967032), "20140129T034247.032000");
+ BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000"), 1390966967032);
- BOOST_CHECK_EQUAL(ndn::fromIsoString("20140129T034247.032000Z"), 1390966967032);
+ BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000Z"), 1390966967032);
}
BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace ndn