diff options
| author | Olivier Langlois <[email protected]> | 2013-10-10 12:35:51 -0400 |
|---|---|---|
| committer | Olivier Langlois <[email protected]> | 2013-10-27 23:04:52 -0400 |
| commit | f171ec0c7d084b6bb163d1466edd814cf4dcbc93 (patch) | |
| tree | cb0708afc624eeb68a0b0b5db0aca19e9cc58984 /src/test/uint256_tests.cpp | |
| parent | Merge pull request #3047 from Diapolo/misbehave (diff) | |
| download | discoin-f171ec0c7d084b6bb163d1466edd814cf4dcbc93.tar.xz discoin-f171ec0c7d084b6bb163d1466edd814cf4dcbc93.zip | |
Make util phexdigit array reusable
class template base_uint had its own private lookup table.
This is saving 256 bytes per instantiation.
The result is not spectacular as bitcoin-qt has only shrinked of
about 1Kb but it is still valid improvement.
Also, I have replaced a for loop with a memset() call.
Made CBigNum::SetHex() use the new HexDigit() function.
Signed-off-by: Olivier Langlois <[email protected]>
Diffstat (limited to 'src/test/uint256_tests.cpp')
| -rw-r--r-- | src/test/uint256_tests.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index efdc8a6ae..e34efcc47 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -1,6 +1,7 @@ #include <boost/test/unit_test.hpp> #include "uint256.h" +#include <string> BOOST_AUTO_TEST_SUITE(uint256_tests) @@ -15,4 +16,12 @@ BOOST_AUTO_TEST_CASE(uint256_equality) BOOST_CHECK(num1+num2 == num3+num2); } +BOOST_AUTO_TEST_CASE(uint256_hex) +{ + std::string hexStr = "d35583ed493a5eee756931353144f558e6a9ab3ad6024a63ced7f10daf7faad9"; + uint256 num1; + num1.SetHex(hexStr); + BOOST_CHECK(num1.GetHex() == hexStr); +} + BOOST_AUTO_TEST_SUITE_END() |