]>
Commit | Line | Data |
---|---|---|
3fc68461 WL |
1 | // Copyright (c) 2014 The Bitcoin Core developers |
2 | // Distributed under the MIT/X11 software license, see the accompanying | |
3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
4 | ||
fecba4e2 PW |
5 | #include "core.h" |
6 | #include "main.h" | |
7 | ||
8 | #include <boost/test/unit_test.hpp> | |
9 | ||
10 | BOOST_AUTO_TEST_SUITE(main_tests) | |
11 | ||
12 | BOOST_AUTO_TEST_CASE(subsidy_limit_test) | |
13 | { | |
a372168e | 14 | CAmount nSum = 0; |
5cfd3a70 | 15 | for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) { |
a372168e | 16 | CAmount nSubsidy = GetBlockValue(nHeight, 0); |
fecba4e2 PW |
17 | BOOST_CHECK(nSubsidy <= 50 * COIN); |
18 | nSum += nSubsidy * 1000; | |
19 | BOOST_CHECK(MoneyRange(nSum)); | |
20 | } | |
21 | BOOST_CHECK(nSum == 2099999997690000ULL); | |
22 | } | |
23 | ||
24 | BOOST_AUTO_TEST_SUITE_END() |