mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
test: add unit test for CConnman::AddedNodesContain()
This commit is contained in:
parent
cc62716920
commit
5e7cc4144b
1 changed files with 7 additions and 0 deletions
|
|
@ -122,6 +122,13 @@ BOOST_AUTO_TEST_CASE(test_addnode_getaddednodeinfo_and_connection_detection)
|
|||
BOOST_CHECK_EQUAL(connman->GetAddedNodeInfo(/*include_connected=*/true).size(), nodes.size());
|
||||
BOOST_CHECK(connman->GetAddedNodeInfo(/*include_connected=*/false).empty());
|
||||
|
||||
// Test AddedNodesContain()
|
||||
for (auto node : connman->TestNodes()) {
|
||||
BOOST_CHECK(connman->AddedNodesContain(node->addr));
|
||||
}
|
||||
AddPeer(id, nodes, *peerman, *connman, ConnectionType::OUTBOUND_FULL_RELAY);
|
||||
BOOST_CHECK(!connman->AddedNodesContain(nodes.back()->addr));
|
||||
|
||||
BOOST_TEST_MESSAGE("\nPrint GetAddedNodeInfo contents:");
|
||||
for (const auto& info : connman->GetAddedNodeInfo(/*include_connected=*/true)) {
|
||||
BOOST_TEST_MESSAGE(strprintf("\nadded node: %s", info.m_params.m_added_node));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue