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
path: root/tests
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-13 13:09:06 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-13 13:10:40 +0300
commit08539312b24b7f0a9a5334e85b9d5c5b532b6453 (patch)
treef0b95d38410fea37cbf2c5761da3a9d75f206d5f /tests
parent592a3d7b4771c8d329d586e8bfa776b25666921b (diff)
BLI: add some missing methods to Map and SetVector
Diffstat (limited to 'tests')
-rw-r--r--tests/gtests/blenlib/BLI_map_test.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/gtests/blenlib/BLI_map_test.cc b/tests/gtests/blenlib/BLI_map_test.cc
index a7711fb3985..8d5b178aea6 100644
--- a/tests/gtests/blenlib/BLI_map_test.cc
+++ b/tests/gtests/blenlib/BLI_map_test.cc
@@ -241,3 +241,20 @@ TEST(map, MoveAssignment)
EXPECT_EQ(map1.size(), 0);
EXPECT_EQ(map1.lookup_ptr(4), nullptr);
}
+
+TEST(map, Clear)
+{
+ IntFloatMap map;
+ map.add(1, 1.0f);
+ map.add(2, 5.0f);
+
+ EXPECT_EQ(map.size(), 2);
+ EXPECT_TRUE(map.contains(1));
+ EXPECT_TRUE(map.contains(2));
+
+ map.clear();
+
+ EXPECT_EQ(map.size(), 0);
+ EXPECT_FALSE(map.contains(1));
+ EXPECT_FALSE(map.contains(2));
+}