435 static const uint8_t block_versions[] = { 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 };
436 static const uint8_t expected_versions[] = { 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4 };
437 static const uint8_t expected_thresholds[] = { 0, 1, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 2, 2, 2, 2 };
439 for (
uint64_t h = 0; h <
sizeof(block_versions) /
sizeof(block_versions[0]); ++h) {
445 ASSERT_EQ(std::min<uint64_t>(h, 4), votes);
448 ASSERT_EQ(hf.get_current_version() >= 2, hf.get_voting_info(2, window, votes,
threshold, earliest_height, voting));
449 ASSERT_EQ(std::min<uint64_t>(h <= 3 ? 0 : h - 3, 4), votes);
452 ASSERT_EQ(hf.get_current_version() >= 3, hf.get_voting_info(3, window, votes,
threshold, earliest_height, voting));
453 ASSERT_EQ(std::min<uint64_t>(h <= 8 ? 0 : h - 8, 4), votes);
456 ASSERT_EQ(hf.get_current_version() == 4, hf.get_voting_info(4, window, votes,
threshold, earliest_height, voting));
457 ASSERT_EQ(std::min<uint64_t>(h <= 14 ? 0 : h - 14, 4), votes);
460 ASSERT_EQ(std::min<uint64_t>(h, 4), window);
464 db.add_block(mkblock(hf, h, block_versions[h]), 0, 0, 0, 0, 0,
crypto::hash());
465 ASSERT_TRUE(hf.add(db.get_block_from_height(h), h));
#define ASSERT_EQ(val1, val2)
unsigned __int64 uint64_t
#define ASSERT_TRUE(condition)