mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 16:53:52 +02:00
blockfilter: Functions to translate filter types to/from names.
This commit is contained in:
@@ -174,4 +174,16 @@ BOOST_AUTO_TEST_CASE(blockfilters_json_test)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(blockfilter_type_names)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(BlockFilterTypeName(BlockFilterType::BASIC), "basic");
|
||||
BOOST_CHECK_EQUAL(BlockFilterTypeName(static_cast<BlockFilterType>(255)), "");
|
||||
|
||||
BlockFilterType filter_type;
|
||||
BOOST_CHECK(BlockFilterTypeByName("basic", filter_type));
|
||||
BOOST_CHECK_EQUAL(filter_type, BlockFilterType::BASIC);
|
||||
|
||||
BOOST_CHECK(!BlockFilterTypeByName("unknown", filter_type));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user