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:
authorJacques Lucke <jacques@blender.org>2020-06-11 17:16:44 +0300
committerJacques Lucke <jacques@blender.org>2020-06-11 17:16:44 +0300
commit3d18bd5c5160b7ee8543558053cad9126804dbd6 (patch)
treee79146b5df833228347212b655da625db559e74c /tests/gtests/blenlib/BLI_map_test.cc
parent49af2f85c3f1cfee4e2344a9eef5a2cb8bb5905f (diff)
BLI: define default hash function for const types
Diffstat (limited to 'tests/gtests/blenlib/BLI_map_test.cc')
-rw-r--r--tests/gtests/blenlib/BLI_map_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/gtests/blenlib/BLI_map_test.cc b/tests/gtests/blenlib/BLI_map_test.cc
index 623055d5032..96e9879abe7 100644
--- a/tests/gtests/blenlib/BLI_map_test.cc
+++ b/tests/gtests/blenlib/BLI_map_test.cc
@@ -449,6 +449,15 @@ TEST(map, PointerKeys)
EXPECT_TRUE(map.is_empty());
}
+TEST(map, ConstKeysAndValues)
+{
+ Map<const std::string, const std::string> map;
+ map.reserve(10);
+ map.add("45", "643");
+ EXPECT_TRUE(map.contains("45"));
+ EXPECT_FALSE(map.contains("54"));
+}
+
/**
* Set this to 1 to activate the benchmark. It is disabled by default, because it prints a lot.
*/