diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-11 17:16:44 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-11 17:16:44 +0300 |
commit | 3d18bd5c5160b7ee8543558053cad9126804dbd6 (patch) | |
tree | e79146b5df833228347212b655da625db559e74c /tests/gtests | |
parent | 49af2f85c3f1cfee4e2344a9eef5a2cb8bb5905f (diff) |
BLI: define default hash function for const types
Diffstat (limited to 'tests/gtests')
-rw-r--r-- | tests/gtests/blenlib/BLI_map_test.cc | 9 |
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. */ |