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:
authorAnkit Meel <ankitjmeel@gmail.com>2020-11-09 16:36:10 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2020-11-09 17:02:16 +0300
commit6507449e54a167c63a72229e4d0119dd2af68ae5 (patch)
treebe324f570d53a2d2982a5fee626c166dddfd1f27 /source/blender/blenlib/tests/BLI_map_test.cc
parent021c40167dea0fae056775f979a6e94c8fcc2a37 (diff)
Cleanup: fix wrong merge, remove extra unique_ptr.
Mistakes added in 3cb4c513080ebeead7c5629a7f0503fae9513803 and bec1765340c3c13f002882ce147762e4c38ed2c6 Reviewed By: sergey Differential Revision: https://developer.blender.org/D9514
Diffstat (limited to 'source/blender/blenlib/tests/BLI_map_test.cc')
-rw-r--r--source/blender/blenlib/tests/BLI_map_test.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/blenlib/tests/BLI_map_test.cc b/source/blender/blenlib/tests/BLI_map_test.cc
index ecdf2627520..323ced87d9e 100644
--- a/source/blender/blenlib/tests/BLI_map_test.cc
+++ b/source/blender/blenlib/tests/BLI_map_test.cc
@@ -8,6 +8,7 @@
#include "BLI_timeit.hh"
#include "BLI_vector.hh"
#include "testing/testing.h"
+#include <memory>
namespace blender::tests {
@@ -419,9 +420,9 @@ TEST(map, Clear)
TEST(map, UniquePtrValue)
{
- 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>());
+ auto value1 = std::make_unique<int>();
+ auto value2 = std::make_unique<int>();
+ auto value3 = std::make_unique<int>();
int *value1_ptr = value1.get();
@@ -429,12 +430,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>(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>()));
+ map.lookup_or_add_cb(4, []() { return std::make_unique<int>(); });
+ map.add_new(5, std::make_unique<int>());
+ map.add(6, std::make_unique<int>());
+ map.add_overwrite(7, std::make_unique<int>());
+ map.lookup_or_add(8, std::make_unique<int>());
+ map.pop_default(9, std::make_unique<int>());
EXPECT_EQ(map.lookup(1).get(), value1_ptr);
EXPECT_EQ(map.lookup_ptr(100), nullptr);