File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11
11
#include " net.h"
12
12
#include " netbase.h"
13
13
#include " chainparams.h"
14
+ #include " util.h"
14
15
15
16
class CAddrManSerializationMock : public CAddrMan
16
17
{
@@ -72,6 +73,18 @@ CDataStream AddrmanToStream(CAddrManSerializationMock& _addrman)
72
73
73
74
BOOST_FIXTURE_TEST_SUITE (net_tests, BasicTestingSetup)
74
75
76
+ BOOST_AUTO_TEST_CASE(cnode_listen_port)
77
+ {
78
+ // test default
79
+ unsigned short port = GetListenPort ();
80
+ BOOST_CHECK (port == Params ().GetDefaultPort ());
81
+ // test set port
82
+ unsigned short altPort = 12345 ;
83
+ SoftSetArg (" -port" , std::to_string (altPort));
84
+ port = GetListenPort ();
85
+ BOOST_CHECK (port == altPort);
86
+ }
87
+
75
88
BOOST_AUTO_TEST_CASE (caddrdb_read)
76
89
{
77
90
CAddrManUncorrupted addrmanUncorrupted;
You can’t perform that action at this time.
0 commit comments