diff options
author | Jim Posen <jim.posen@gmail.com> | 2018-08-27 15:42:35 -0700 |
---|---|---|
committer | Jim Posen <jim.posen@gmail.com> | 2019-04-06 12:03:21 -0700 |
commit | ba6ff9a6f70139594362b4b4a6b816707bb165c8 (patch) | |
tree | bfd72dd218f42fd57a402cb9dece4d56ab1e9659 /src/test | |
parent | 62b7a4f09409f60a35fc99ddb70f9199ac511a53 (diff) |
blockfilter: Functions to translate filter types to/from names.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/blockfilter_tests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/blockfilter_tests.cpp b/src/test/blockfilter_tests.cpp index cd0c36d802..92f9de78e7 100644 --- a/src/test/blockfilter_tests.cpp +++ b/src/test/blockfilter_tests.cpp @@ -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() |