Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2020-11-06 18:05:40 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-06 18:47:16 +0300
commit3cb4c513080ebeead7c5629a7f0503fae9513803 (patch)
tree624947fc61a48c3c4bd681814a56456e093184e8 /source/blender/blenlib/tests/BLI_map_test.cc
parentce70f2e1e0960c8b28dfbe3b9f5b4eeb7a49d317 (diff)
Cleanup: Clang-Tidy, modernize-make-unique
Diffstat (limited to 'source/blender/blenlib/tests/BLI_map_test.cc')
-rw-r--r--source/blender/blenlib/tests/BLI_map_test.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenlib/tests/BLI_map_test.cc b/source/blender/blenlib/tests/BLI_map_test.cc
index e61d638c681..ecdf2627520 100644
--- a/source/blender/blenlib/tests/BLI_map_test.cc
+++ b/source/blender/blenlib/tests/BLI_map_test.cc
@@ -419,9 +419,9 @@ TEST(map, Clear)
TEST(map, UniquePtrValue)
{
- auto value1 = std::unique_ptr<int>(new int());
- auto value2 = std::unique_ptr<int>(new int());
- auto value3 = std::unique_ptr<int>(new int());
+ auto value1 = std::unique_ptr<int>(std::make_unique<int>());
+ auto value2 = std::unique_ptr<int>(std::make_unique<int>());
+ auto value3 = std::unique_ptr<int>(std::make_unique<int>());
int *value1_ptr = value1.get();
@@ -429,12 +429,12 @@ TEST(map, UniquePtrValue)
map.add_new(1, std::move(value1));
map.add(2, std::move(value2));
map.add_overwrite(3, std::move(value3));
- map.lookup_or_add_cb(4, []() { return std::unique_ptr<int>(new int()); });
- map.add_new(5, std::unique_ptr<int>(new int()));
- map.add(6, std::unique_ptr<int>(new int()));
- map.add_overwrite(7, std::unique_ptr<int>(new int()));
- map.lookup_or_add(8, std::unique_ptr<int>(new int()));
- map.pop_default(9, std::unique_ptr<int>(new int()));
+ map.lookup_or_add_cb(4, []() { return std::unique_ptr<int>(std::make_unique<int>()); });
+ map.add_new(5, std::unique_ptr<int>(std::make_unique<int>()));
+ map.add(6, std::unique_ptr<int>(std::make_unique<int>()));
+ map.add_overwrite(7, std::unique_ptr<int>(std::make_unique<int>()));
+ map.lookup_or_add(8, std::unique_ptr<int>(std::make_unique<int>()));
+ map.pop_default(9, std::unique_ptr<int>(std::make_unique<int>()));
EXPECT_EQ(map.lookup(1).get(), value1_ptr);
EXPECT_EQ(map.lookup_ptr(100), nullptr);