diff options
author | Brandon Dahler <brandon.dahler@gmail.com> | 2013-04-13 00:13:08 -0500 |
---|---|---|
committer | Brandon Dahler <brandon.dahler@gmail.com> | 2013-11-10 09:36:28 -0600 |
commit | 51ed9ec971614aebdbfbd9527aba365dd0afd437 (patch) | |
tree | d2f910390e55aef857023812fbdaefdd66cd99ff /src/test/bignum_tests.cpp | |
parent | 7c4c207be8420d394a5abc4368d1bb69ad4f8067 (diff) |
Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
Diffstat (limited to 'src/test/bignum_tests.cpp')
-rw-r--r-- | src/test/bignum_tests.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp index f16c26fd18..9d67324c76 100644 --- a/src/test/bignum_tests.cpp +++ b/src/test/bignum_tests.cpp @@ -1,8 +1,9 @@ -#include <boost/test/unit_test.hpp> +#include "bignum.h" + #include <limits> +#include <stdint.h> -#include "bignum.h" -#include "util.h" +#include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(bignum_tests) @@ -46,7 +47,7 @@ BOOST_AUTO_TEST_SUITE(bignum_tests) // Let's force this code not to be inlined, in order to actually // test a generic version of the function. This increases the chance // that -ftrapv will detect overflows. -NOINLINE void mysetint64(CBigNum& num, int64 n) +NOINLINE void mysetint64(CBigNum& num, int64_t n) { num.setint64(n); } @@ -55,7 +56,7 @@ NOINLINE void mysetint64(CBigNum& num, int64 n) // value to 0, then the second one with a non-inlined function. BOOST_AUTO_TEST_CASE(bignum_setint64) { - int64 n; + int64_t n; { n = 0; @@ -103,7 +104,7 @@ BOOST_AUTO_TEST_CASE(bignum_setint64) BOOST_CHECK(num.ToString() == "-5"); } { - n = std::numeric_limits<int64>::min(); + n = std::numeric_limits<int64_t>::min(); CBigNum num(n); BOOST_CHECK(num.ToString() == "-9223372036854775808"); num.setulong(0); @@ -112,7 +113,7 @@ BOOST_AUTO_TEST_CASE(bignum_setint64) BOOST_CHECK(num.ToString() == "-9223372036854775808"); } { - n = std::numeric_limits<int64>::max(); + n = std::numeric_limits<int64_t>::max(); CBigNum num(n); BOOST_CHECK(num.ToString() == "9223372036854775807"); num.setulong(0); |