File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ test_bitcoin_SOURCES = \
45
45
DoS_tests.cpp \
46
46
getarg_tests.cpp \
47
47
key_tests.cpp \
48
+ main_tests.cpp \
48
49
miner_tests.cpp \
49
50
mruset_tests.cpp \
50
51
multisig_tests.cpp \
Original file line number Diff line number Diff line change
1
+ #include " core.h"
2
+ #include " main.h"
3
+
4
+ #include < boost/test/unit_test.hpp>
5
+
6
+ BOOST_AUTO_TEST_SUITE (main_tests)
7
+
8
+ BOOST_AUTO_TEST_CASE(subsidy_limit_test)
9
+ {
10
+ uint64_t nSum = 0 ;
11
+ for (int nHeight = 0 ; nHeight < 7000000 ; nHeight += 1000 ) {
12
+ uint64_t nSubsidy = GetBlockValue (nHeight, 0 );
13
+ BOOST_CHECK (nSubsidy <= 50 * COIN);
14
+ nSum += nSubsidy * 1000 ;
15
+ BOOST_CHECK (MoneyRange (nSum));
16
+ }
17
+ BOOST_CHECK (nSum == 2099999997690000ULL );
18
+ }
19
+
20
+ BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments