diff options
| author | practicalswift <[email protected]> | 2018-09-21 11:03:21 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-09-21 11:03:21 +0200 |
| commit | b6718e373ed425fa2440ddd8f1b05c76b782dc2b (patch) | |
| tree | 4e710e94ee3946bac22b1932d3b982102a24155f /src/test/net_tests.cpp | |
| parent | Merge #14204: build: Move interfaces/* to libbitcoin_server (diff) | |
| download | discoin-b6718e373ed425fa2440ddd8f1b05c76b782dc2b.tar.xz discoin-b6718e373ed425fa2440ddd8f1b05c76b782dc2b.zip | |
tests: Use MakeUnique to construct objects owned by unique_ptrs
Diffstat (limited to 'src/test/net_tests.cpp')
| -rw-r--r-- | src/test/net_tests.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index eaa8b1618..35a143957 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -179,12 +179,12 @@ BOOST_AUTO_TEST_CASE(cnode_simple_test) bool fInboundIn = false; // Test that fFeeler is false by default. - std::unique_ptr<CNode> pnode1(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, CAddress(), pszDest, fInboundIn)); + std::unique_ptr<CNode> pnode1 = MakeUnique<CNode>(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, CAddress(), pszDest, fInboundIn); BOOST_CHECK(pnode1->fInbound == false); BOOST_CHECK(pnode1->fFeeler == false); fInboundIn = true; - std::unique_ptr<CNode> pnode2(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, CAddress(), pszDest, fInboundIn)); + std::unique_ptr<CNode> pnode2 = MakeUnique<CNode>(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, CAddress(), pszDest, fInboundIn); BOOST_CHECK(pnode2->fInbound == true); BOOST_CHECK(pnode2->fFeeler == false); } |