Updated tests

This commit is contained in:
SChernykh 2023-05-26 15:21:40 +02:00
parent 9e439044de
commit a7496dbc02
3 changed files with 6 additions and 1 deletions

View file

@ -92,6 +92,7 @@ TEST(block_template, update)
tpl.update(data, mempool, &wallet);
ASSERT_EQ(b->m_sidechainId, H("272a7eea0b804cf24427528977d221850d0ee06c26e935219a75f180cfbfc7f3"));
ASSERT_EQ(b->m_transactions.size(), 203);
for (size_t i = 1; i < b->m_transactions.size(); ++i) {

View file

@ -160,7 +160,7 @@ TEST(pool_block, verify)
ASSERT_EQ(b.deserialize(p, n, sidechain, nullptr, false), 0);
p += n;
sidechain.add_block(b);
ASSERT_TRUE(sidechain.add_block(b));
ASSERT_TRUE(sidechain.find_block(b.m_sidechainId) != nullptr);
}

View file

@ -87,6 +87,10 @@ TEST(util, bsr)
for (uint64_t i = 0, x = 1; i <= 63; ++i, x <<= 1) {
ASSERT_EQ(bsr(x), i);
ASSERT_EQ(bsr_reference(x), i);
const uint64_t y = x | (x - 1);
ASSERT_EQ(bsr(y), i);
ASSERT_EQ(bsr_reference(y), i);
}
}