diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2011-12-20 16:52:59 -0500 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2011-12-20 16:52:59 -0500 |
commit | 21d9f36781604e4ca9fc35dc65265593423b73e9 (patch) | |
tree | 223bf70418e43a0b9c8366c65db214780f77d61a /src/test | |
parent | 781c06c0f534913321a415a4fb64a60734e43101 (diff) |
Use standard C99 (and Qt) types for 64-bit integers
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/DoS_tests.cpp | 10 | ||||
-rw-r--r-- | src/test/base58_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/script_op_eval_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/uint160_tests.cpp | 4 | ||||
-rw-r--r-- | src/test/uint256_tests.cpp | 4 | ||||
-rw-r--r-- | src/test/util_tests.cpp | 4 |
6 files changed, 19 insertions, 7 deletions
diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index e9b7b4517a..bea671c311 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -1,6 +1,8 @@ // // Unit tests for denial-of-service detection/prevention code // +#include <stdint.h> + #include <boost/assign/list_of.hpp> // for 'map_list_of()' #include <boost/test/unit_test.hpp> #include <boost/foreach.hpp> @@ -50,7 +52,7 @@ BOOST_AUTO_TEST_CASE(DoS_banscore) BOOST_AUTO_TEST_CASE(DoS_bantime) { CNode::ClearBanned(); - int64 nStartTime = GetTime(); + int64_t nStartTime = GetTime(); SetMockTime(nStartTime); // Overrides future calls to GetTime() CAddress addr(0xa0b0c001); @@ -66,11 +68,11 @@ BOOST_AUTO_TEST_CASE(DoS_bantime) BOOST_CHECK(!CNode::IsBanned(addr.ip)); } -static bool CheckNBits(unsigned int nbits1, int64 time1, unsigned int nbits2, int64 time2) +static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2, int64_t time2) { if (time1 > time2) return CheckNBits(nbits2, time2, nbits1, time1); - int64 deltaTime = time2-time1; + int64_t deltaTime = time2-time1; CBigNum required; required.SetCompact(ComputeMinWork(nbits1, deltaTime)); @@ -85,7 +87,7 @@ BOOST_AUTO_TEST_CASE(DoS_checknbits) // Timestamps,nBits from the bitcoin blockchain. // These are the block-chain checkpoint blocks - typedef std::map<int64, unsigned int> BlockData; + typedef std::map<int64_t, unsigned int> BlockData; BlockData chainData = map_list_of(1239852051,486604799)(1262749024,486594666) (1279305360,469854461)(1280200847,469830746)(1281678674,469809688) diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index d52ac74982..0ceff9f28f 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -1,3 +1,5 @@ +#include <stdint.h> + #include <boost/test/unit_test.hpp> #include "main.h" diff --git a/src/test/script_op_eval_tests.cpp b/src/test/script_op_eval_tests.cpp index c44642c6e9..14c025b425 100644 --- a/src/test/script_op_eval_tests.cpp +++ b/src/test/script_op_eval_tests.cpp @@ -1,3 +1,5 @@ +#include <stdint.h> + #include <boost/assert.hpp> #include <boost/assign/list_of.hpp> #include <boost/assign/list_inserter.hpp> diff --git a/src/test/uint160_tests.cpp b/src/test/uint160_tests.cpp index 35cb35b25a..d986c30870 100644 --- a/src/test/uint160_tests.cpp +++ b/src/test/uint160_tests.cpp @@ -1,3 +1,5 @@ +#include <stdint.h> + #include <boost/test/unit_test.hpp> #include "uint256.h" @@ -10,7 +12,7 @@ BOOST_AUTO_TEST_CASE(uint160_equality) uint160 num2 = 11; BOOST_CHECK(num1+1 == num2); - uint64 num3 = 10; + uint64_t num3 = 10; BOOST_CHECK(num1 == num3); BOOST_CHECK(num1+num2 == num3+num2); } diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index efdc8a6aeb..d7e1e51379 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -1,3 +1,5 @@ +#include <stdint.h> + #include <boost/test/unit_test.hpp> #include "uint256.h" @@ -10,7 +12,7 @@ BOOST_AUTO_TEST_CASE(uint256_equality) uint256 num2 = 11; BOOST_CHECK(num1+1 == num2); - uint64 num3 = 10; + uint64_t num3 = 10; BOOST_CHECK(num1 == num3); BOOST_CHECK(num1+num2 == num3+num2); } diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 9571c47382..08d243751e 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1,3 +1,5 @@ +#include <stdint.h> + #include <vector> #include <boost/test/unit_test.hpp> #include <boost/foreach.hpp> @@ -186,7 +188,7 @@ BOOST_AUTO_TEST_CASE(util_FormatMoney) BOOST_AUTO_TEST_CASE(util_ParseMoney) { - int64 ret = 0; + int64_t ret = 0; BOOST_CHECK(ParseMoney("0.0", ret)); BOOST_CHECK_EQUAL(ret, 0); |