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:
Diffstat (limited to 'tests/gtests/blenlib/BLI_string_map_test.cc')
-rw-r--r--tests/gtests/blenlib/BLI_string_map_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/gtests/blenlib/BLI_string_map_test.cc b/tests/gtests/blenlib/BLI_string_map_test.cc
index e5e32352161..cc02a54e0c8 100644
--- a/tests/gtests/blenlib/BLI_string_map_test.cc
+++ b/tests/gtests/blenlib/BLI_string_map_test.cc
@@ -199,3 +199,12 @@ TEST(string_map, WithVectors)
EXPECT_EQ(map.lookup("A").size(), 3);
EXPECT_EQ(map.lookup("B").size(), 7);
}
+
+TEST(string_map, UniquePtrValues)
+{
+ StringMap<std::unique_ptr<int>> map;
+ map.add_new("A", std::unique_ptr<int>(new int()));
+ std::unique_ptr<int> &a = map.lookup("A");
+ std::unique_ptr<int> *b = map.lookup_ptr("A");
+ EXPECT_EQ(a.get(), b->get());
+}