diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2020-08-11 10:37:57 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2020-09-02 17:18:22 -0700 |
commit | da3a0be61b025224231206cb4656e420453bfdeb (patch) | |
tree | 333e860115ece0255deae72562da72cb8a868cc7 /src/test/net_tests.cpp | |
parent | 1d74fc7df621b31d1b8adc9d7f53e7478d6e40b5 (diff) | |
download | bitcoin-da3a0be61b025224231206cb4656e420453bfdeb.tar.xz |
[test] Add explicit tests that connection types get set correctly
Diffstat (limited to 'src/test/net_tests.cpp')
-rw-r--r-- | src/test/net_tests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 1ac1d975d6..85ebc89673 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -184,9 +184,19 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test) std::string pszDest; std::unique_ptr<CNode> pnode1 = MakeUnique<CNode>(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, CAddress(), pszDest, ConnectionType::OUTBOUND_FULL_RELAY); + BOOST_CHECK(pnode1->IsFullOutboundConn() == true); + BOOST_CHECK(pnode1->IsManualConn() == false); + BOOST_CHECK(pnode1->IsBlockOnlyConn() == false); + BOOST_CHECK(pnode1->IsFeelerConn() == false); + BOOST_CHECK(pnode1->IsAddrFetchConn() == false); BOOST_CHECK(pnode1->IsInboundConn() == false); std::unique_ptr<CNode> pnode2 = MakeUnique<CNode>(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, CAddress(), pszDest, ConnectionType::INBOUND); + BOOST_CHECK(pnode2->IsFullOutboundConn() == false); + BOOST_CHECK(pnode2->IsManualConn() == false); + BOOST_CHECK(pnode2->IsBlockOnlyConn() == false); + BOOST_CHECK(pnode2->IsFeelerConn() == false); + BOOST_CHECK(pnode2->IsAddrFetchConn() == false); BOOST_CHECK(pnode2->IsInboundConn() == true); } |