Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | |||||
// FIXME A std::tuple can be used instead of boost::mpl::list after boost 1.67 | // FIXME A std::tuple can be used instead of boost::mpl::list after boost 1.67 | ||||
using VoteItemProviders = boost::mpl::list<BlockProvider, ProofProvider>; | using VoteItemProviders = boost::mpl::list<BlockProvider, ProofProvider>; | ||||
BOOST_AUTO_TEST_CASE(block_update) { | BOOST_AUTO_TEST_CASE(block_update) { | ||||
CBlockIndex index; | CBlockIndex index; | ||||
CBlockIndex *pindex = &index; | CBlockIndex *pindex = &index; | ||||
std::set<VoteStatus> status{ | std::set<VoteStatus> status{ | ||||
VoteStatus::Invalid, | VoteStatus::Invalid, VoteStatus::Rejected, VoteStatus::Accepted, | ||||
VoteStatus::Rejected, | VoteStatus::Finalized, VoteStatus::Stale, | ||||
VoteStatus::Accepted, | |||||
VoteStatus::Finalized, | |||||
}; | }; | ||||
for (auto s : status) { | for (auto s : status) { | ||||
BlockUpdate abu(pindex, s); | BlockUpdate abu(pindex, s); | ||||
// The use of BOOST_CHECK instead of BOOST_CHECK_EQUAL prevents from | // The use of BOOST_CHECK instead of BOOST_CHECK_EQUAL prevents from | ||||
// having to define operator<<() for each argument type. | // having to define operator<<() for each argument type. | ||||
BOOST_CHECK(abu.getVoteItem() == pindex); | BOOST_CHECK(abu.getVoteItem() == pindex); | ||||
BOOST_CHECK(abu.getStatus() == s); | BOOST_CHECK(abu.getStatus() == s); | ||||
▲ Show 20 Lines • Show All 964 Lines • Show Last 20 Lines |