Skip to content

Commit

Permalink
[Tests] Fix chain ordering in budget tests
Browse files Browse the repository at this point in the history
check testnet params first, then check mainnet so as to not interfere
with subsequent unit tests that rely on mainnet params.

Also clean up include ordering.
  • Loading branch information
Fuzzbawls committed May 3, 2018
1 parent 3943099 commit 3a6b152
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/test/budget_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <boost/test/unit_test.hpp>
#include <tinyformat.h>
#include <utilmoneystr.h>
#include "masternode-budget.h"
#include "tinyformat.h"
#include "utilmoneystr.h"

#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_SUITE(budget_tests)

Expand All @@ -19,13 +20,13 @@ void CheckBudgetValue(int nHeight, std::string strNetwork, CAmount nExpectedValu

BOOST_AUTO_TEST_CASE(budget_value)
{
SelectParams(CBaseChainParams::MAIN);
SelectParams(CBaseChainParams::TESTNET);
int nHeightTest = Params().Zerocoin_Block_V2_Start() + 1;
CheckBudgetValue(nHeightTest, "mainnet", 43200*COIN);
CheckBudgetValue(nHeightTest, "testnet", 7300*COIN);

SelectParams(CBaseChainParams::TESTNET);
SelectParams(CBaseChainParams::MAIN);
nHeightTest = Params().Zerocoin_Block_V2_Start() + 1;
CheckBudgetValue(nHeightTest, "testnet", 7300*COIN);
CheckBudgetValue(nHeightTest, "mainnet", 43200*COIN);
}

BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 3a6b152

Please sign in to comment.