From 08539312b24b7f0a9a5334e85b9d5c5b532b6453 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 13 Sep 2019 12:09:06 +0200 Subject: BLI: add some missing methods to Map and SetVector --- tests/gtests/blenlib/BLI_map_test.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/gtests') 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)); +} -- cgit v1.2.3