Adds some unit tests for the CSeederNode class by using a test class wrapper
for CSeederNode.
Depends on D4449
Differential D4436
Add unit tests for CSeederNode::ProcessMessage() nakihito on Nov 13 2019, 01:13. Authored by Tags None Subscribers None
Details
Adds some unit tests for the CSeederNode class by using a test class wrapper Depends on D4449 ../configure make check cmake -GNinja .. ninja check-bitcoin-seeder ../configure CXX=clang++ CC=clang --with-gui=no make check cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -GNinja .. ninja check-bitcoin-seeder
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes
Comment Actions Looking at the test cases exhibits a common and repetitive initialization pattern.
Comment Actions Changed BOOST_AUTO_TEST_SUITE to BOOST_FIXTURE_TEST_SUITE and BOOST_AUTO_TEST_CASE to BOOST_FIXTURE_TEST_CASE. Added SeederTestingSetup struct for the fixture test suite. Changed user_agent type to std::string. Comment Actions Since I completely failed to understand what the ProcessMessage() is supposed to do/return by looking at the test, I looked at the code and my understanding is that false is not a status output here (it doesn't indicate a failure).
Comment Actions Changed FIXTURE test cases to AUTO, renamed some variables and constants, added testNode to the fixture setup, increased the functionality of the wrapper class. Comment Actions There are 2 remaining things to fix:
Comment Actions Adjusted comments related to ADDR_SOFT_CAP, removed verack message test, and added additional check for the version test.
Comment Actions Adjusted ADDR_SOFT_CAP comments, refined addr message test with advice from Fabien, removed smurf naming of AddrCapacity enum values.
Comment Actions Discussed with Jason offline, changed enum to better reflect the return value's purpose. |