diff --git a/src/test/skiplist_tests.cpp b/src/test/skiplist_tests.cpp --- a/src/test/skiplist_tests.cpp +++ b/src/test/skiplist_tests.cpp @@ -48,7 +48,7 @@ // Build a main chain 100000 blocks long. std::vector vHashMain(100000); std::vector vBlocksMain(100000); - for (unsigned int i = 0; i < vBlocksMain.size(); i++) { + for (size_t i = 0; i < vBlocksMain.size(); i++) { // Set the hash equal to the height, so we can quickly check the // distances. vHashMain[i] = ArithToUint256(i); @@ -67,7 +67,7 @@ // Build a branch that splits off at block 49999, 50000 blocks long. std::vector vHashSide(50000); std::vector vBlocksSide(50000); - for (unsigned int i = 0; i < vBlocksSide.size(); i++) { + for (size_t i = 0; i < vBlocksSide.size(); i++) { // Add 1<<128 to the hashes, so GetLow64() still returns the height. vHashSide[i] = ArithToUint256(i + 50000 + (arith_uint256(1) << 128)); vBlocksSide[i].nHeight = i + 50000; @@ -108,7 +108,7 @@ // The further ones (excluding the last one) go back with exponential // steps. unsigned int dist = 2; - for (unsigned int i = 12; i < locator.vHave.size() - 1; i++) { + for (size_t i = 12; i < locator.vHave.size() - 1; i++) { BOOST_CHECK_EQUAL(UintToArith256(locator.vHave[i - 1]).GetLow64() - UintToArith256(locator.vHave[i]).GetLow64(), dist); @@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(findearliestatleast_test) { std::vector vHashMain(100000); std::vector vBlocksMain(100000); - for (unsigned int i = 0; i < vBlocksMain.size(); i++) { + for (size_t i = 0; i < vBlocksMain.size(); i++) { // Set the hash equal to the height vHashMain[i] = ArithToUint256(i); vBlocksMain[i].nHeight = i; @@ -141,7 +141,7 @@ } // Check that we set nTimeMax up correctly. unsigned int curTimeMax = 0; - for (unsigned int i = 0; i < vBlocksMain.size(); ++i) { + for (size_t i = 0; i < vBlocksMain.size(); ++i) { curTimeMax = std::max(curTimeMax, vBlocksMain[i].nTime); BOOST_CHECK(curTimeMax == vBlocksMain[i].nTimeMax); }