Fabcoin Core  0.16.2
P2P Digital Currency
boost.cpp
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16 */
23 #include <boost/test/unit_test.hpp>
24 #include <libdevcore/Common.h>
26 
27 using namespace dev::test;
28 
30 
31 // test that reproduces issue https://github.com/ethereum/cpp-ethereum/issues/1977
32 BOOST_AUTO_TEST_CASE(u256_overflow_test)
33 {
34  dev::u256 a = 14;
35  dev::bigint b = dev::bigint("115792089237316195423570985008687907853269984665640564039457584007913129639948");
36  // to fix cast `a` to dev::bigint
37  BOOST_CHECK(a < b);
38 }
39 
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<>> bigint
Definition: Common.h:121
#define a(i)
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
Definition: Common.h:125
#define b(i, j)
BOOST_AUTO_TEST_CASE(rndCode)
Definition: fuzzHelper.cpp:409
#define BOOST_FIXTURE_TEST_SUITE(a, b)
Definition: object.cpp:14
#define BOOST_AUTO_TEST_SUITE_END()
Definition: object.cpp:16
Helper functions to work with json::spirit and test files.
#define BOOST_CHECK(expr)
Definition: object.cpp:17