diff options
author | Jim Posen <jim.posen@gmail.com> | 2018-08-27 15:04:43 -0700 |
---|---|---|
committer | Jim Posen <jim.posen@gmail.com> | 2018-11-06 09:12:54 -0800 |
commit | 20b812993ae584e4a4b12faa5c8751aa04dfde81 (patch) | |
tree | a7fb1808f9b0b3b01dea63e1e1073d962710e9b8 /src/test | |
parent | 6af27b81572b7b8e08ebcfe7eb533f40c66be4af (diff) |
blockfilter: Refactor GCS params into struct.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/blockfilter_tests.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/test/blockfilter_tests.cpp b/src/test/blockfilter_tests.cpp index 2144202b8d..69149fad4f 100644 --- a/src/test/blockfilter_tests.cpp +++ b/src/test/blockfilter_tests.cpp @@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(gcsfilter_test) excluded_elements.insert(std::move(element2)); } - GCSFilter filter(0, 0, 10, 1 << 10, included_elements); + GCSFilter filter({0, 0, 10, 1 << 10}, included_elements); for (const auto& element : included_elements) { BOOST_CHECK(filter.Match(element)); @@ -39,6 +39,19 @@ BOOST_AUTO_TEST_CASE(gcsfilter_test) } } +BOOST_AUTO_TEST_CASE(gcsfilter_default_constructor) +{ + GCSFilter filter; + BOOST_CHECK_EQUAL(filter.GetN(), 0); + BOOST_CHECK_EQUAL(filter.GetEncoded().size(), 1); + + const GCSFilter::Params& params = filter.GetParams(); + BOOST_CHECK_EQUAL(params.m_siphash_k0, 0); + BOOST_CHECK_EQUAL(params.m_siphash_k1, 0); + BOOST_CHECK_EQUAL(params.m_P, 0); + BOOST_CHECK_EQUAL(params.m_M, 1); +} + BOOST_AUTO_TEST_CASE(blockfilter_basic_test) { CScript included_scripts[5], excluded_scripts[3]; |