Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/test/processor_tests.cpp
Show First 20 Lines • Show All 1,103 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(destructor) { | ||||
s.StopWhenDrained(); | s.StopWhenDrained(); | ||||
schedulerThread.join(); | schedulerThread.join(); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(add_proof_to_reconcile) { | BOOST_AUTO_TEST_CASE(add_proof_to_reconcile) { | ||||
uint32_t score = MIN_VALID_PROOF_SCORE; | uint32_t score = MIN_VALID_PROOF_SCORE; | ||||
auto addProofToReconcile = [&](uint32_t proofScore) { | auto addProofToReconcile = [&](uint32_t proofScore) { | ||||
auto proof = std::make_shared<Proof>(buildRandomProof(proofScore)); | auto proof = buildRandomProof(proofScore); | ||||
m_processor->addProofToReconcile(proof, GetRandInt(1)); | m_processor->addProofToReconcile(proof, GetRandInt(1)); | ||||
return proof; | return proof; | ||||
}; | }; | ||||
for (size_t i = 0; i < AVALANCHE_MAX_ELEMENT_POLL - 1; i++) { | for (size_t i = 0; i < AVALANCHE_MAX_ELEMENT_POLL - 1; i++) { | ||||
auto proof = addProofToReconcile(++score); | auto proof = addProofToReconcile(++score); | ||||
auto invs = AvalancheTest::getInvsForNextPoll(*m_processor); | auto invs = AvalancheTest::getInvsForNextPoll(*m_processor); | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |