Changeset View
Changeset View
Standalone View
Standalone View
src/test/avalanche_tests.cpp
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(vote_record) { | ||||
} | } | ||||
// The next vote will finalize the decision. | // The next vote will finalize the decision. | ||||
REGISTER_VOTE_AND_CHECK(vr, 0, false, true, AVALANCHE_FINALIZATION_SCORE); | REGISTER_VOTE_AND_CHECK(vr, 0, false, true, AVALANCHE_FINALIZATION_SCORE); | ||||
// Check that inflight accounting work as expected. | // Check that inflight accounting work as expected. | ||||
VoteRecord vrinflight(false); | VoteRecord vrinflight(false); | ||||
for (int i = 0; i < 2 * AVALANCHE_MAX_INFLIGHT_POLL; i++) { | for (int i = 0; i < 2 * AVALANCHE_MAX_INFLIGHT_POLL; i++) { | ||||
BOOST_CHECK_EQUAL(vrinflight.shouldPoll(), | bool shouldPoll = vrinflight.shouldPoll(); | ||||
i < AVALANCHE_MAX_INFLIGHT_POLL); | BOOST_CHECK_EQUAL(shouldPoll, i < AVALANCHE_MAX_INFLIGHT_POLL); | ||||
BOOST_CHECK_EQUAL(vrinflight.registerPoll(), vrinflight.shouldPoll()); | BOOST_CHECK_EQUAL(vrinflight.registerPoll(), shouldPoll); | ||||
} | } | ||||
// Clear various number of inflight requests and check everything behaves as | // Clear various number of inflight requests and check everything behaves as | ||||
// expected. | // expected. | ||||
for (int i = 1; i < AVALANCHE_MAX_INFLIGHT_POLL; i++) { | for (int i = 1; i < AVALANCHE_MAX_INFLIGHT_POLL; i++) { | ||||
vrinflight.clearInflightRequest(i); | vrinflight.clearInflightRequest(i); | ||||
BOOST_CHECK(vrinflight.shouldPoll()); | BOOST_CHECK(vrinflight.shouldPoll()); | ||||
▲ Show 20 Lines • Show All 673 Lines • Show Last 20 Lines |