aboutsummaryrefslogtreecommitdiff
path: root/src/test/allocator_tests.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-09-19 13:26:43 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-09-19 13:26:47 -0400
commit920c090f63f4990bf0f3b3d1a6d3d8a8bcd14ba0 (patch)
treeadb2d00ea06ac90008d158124f816d7f54d5d35c /src/test/allocator_tests.cpp
parent2796c6e5ec9055545e987023b04eb5ebe64d5320 (diff)
parentb6718e373ed425fa2440ddd8f1b05c76b782dc2b (diff)
Merge #14287: tests: Use MakeUnique to construct objects owned by unique_ptrs
b6718e373e tests: Use MakeUnique to construct objects owned by unique_ptrs (practicalswift) Pull request description: A subset of #14211 ("Use MakeUnique to construct objects owned by unique_ptrs") as suggested by @MarcoFalke in https://github.com/bitcoin/bitcoin/pull/14211#issuecomment-423324019. Use `MakeUnique` to construct objects owned by `unique_ptr`s. Rationale: * `MakeUnique` ensures exception safety in complex expressions. * `MakeUnique` gives a more concise statement of the construction. Tree-SHA512: 1228ae6ce7beb178d79142c4e936b728178ccaa8aa35c6d8feeb33d1a667abfdd010c59996a9d833594611e913877ce5794e75953d11d9b1fdbac04aa491d9cf
Diffstat (limited to 'src/test/allocator_tests.cpp')
-rw-r--r--src/test/allocator_tests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp
index 1052ada232..c72c062b81 100644
--- a/src/test/allocator_tests.cpp
+++ b/src/test/allocator_tests.cpp
@@ -163,7 +163,7 @@ private:
BOOST_AUTO_TEST_CASE(lockedpool_tests_mock)
{
// Test over three virtual arenas, of which one will succeed being locked
- std::unique_ptr<LockedPageAllocator> x(new TestLockedPageAllocator(3, 1));
+ std::unique_ptr<LockedPageAllocator> x = MakeUnique<TestLockedPageAllocator>(3, 1);
LockedPool pool(std::move(x));
BOOST_CHECK(pool.stats().total == 0);
BOOST_CHECK(pool.stats().locked == 0);