build: Warnings correction for gcc 4.2
Also in this commit some code style corrections.
Change-Id: Idf2b5b96b328fb3dbea7440362c84d7759a10ec5
Refs: #1429
diff --git a/tests/test-name.cpp b/tests/test-name.cpp
index 32e3a10..ba8aa96 100644
--- a/tests/test-name.cpp
+++ b/tests/test-name.cpp
@@ -4,10 +4,10 @@
* See COPYING for copyright and distribution information.
*/
-#include <boost/test/unit_test.hpp>
-
#include "name.hpp"
+#include "boost-test.hpp"
+
namespace ndn {
BOOST_AUTO_TEST_SUITE(TestName)
@@ -25,7 +25,7 @@
const uint8_t Name1[] = {0x7, 0x7, // Name
0x8, 0x5, // NameComponent
0x6c, 0x6f, 0x63, 0x61, 0x6c};
-
+
const uint8_t Name2[] = {0x7, 0xc, // Name
0x8, 0x5, // NameComponent
0x6c, 0x6f, 0x63, 0x61, 0x6c,
@@ -61,11 +61,11 @@
// if (i != wire.begin())
// std::cout << ", ";
// std::cout << "0x" << static_cast<uint32_t>(*i);
-
+
// std::cout.flags(saveFlags);
// }
// std::cout << std::endl;
-
+
BOOST_CHECK_EQUAL_COLLECTIONS(TestName, TestName+sizeof(TestName),
wire.begin(), wire.end());
}
@@ -83,12 +83,12 @@
BOOST_AUTO_TEST_CASE(AppendsAndMultiEncode)
{
Name name("/local");
-
+
BOOST_CHECK_EQUAL_COLLECTIONS(name.wireEncode().begin(), name.wireEncode().end(),
Name1, Name1 + sizeof(Name1));
name.append("ndn");
-
+
BOOST_CHECK_EQUAL_COLLECTIONS(name.wireEncode().begin(), name.wireEncode().end(),
Name2, Name2 + sizeof(Name2));
@@ -100,14 +100,14 @@
BOOST_AUTO_TEST_CASE(AppendNumber)
{
Name name;
- for (int i = 0; i < 10; i++)
+ for (uint32_t i = 0; i < 10; i++)
{
name.appendNumber(i);
}
BOOST_CHECK_EQUAL(name.size(), 10);
- for (int i = 0; i < 10; i++)
+ for (uint32_t i = 0; i < 10; i++)
{
BOOST_CHECK_EQUAL(name[i].toNumber(), i);
}