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')
-rw-r--r--tests/gtests/blenlib/BLI_map_test.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/gtests/blenlib/BLI_map_test.cc b/tests/gtests/blenlib/BLI_map_test.cc
index 3acb76e09f0..61e7a603d13 100644
--- a/tests/gtests/blenlib/BLI_map_test.cc
+++ b/tests/gtests/blenlib/BLI_map_test.cc
@@ -180,11 +180,17 @@ TEST(map, LookupOrAdd_Lambdas)
EXPECT_EQ(map.lookup_or_add(1, lambda1), 20.0f);
}
-TEST(map, InsertOrModify)
+TEST(map, AddOrModify)
{
IntFloatMap map;
- auto create_func = []() { return 10.0f; };
- auto modify_func = [](float &value) { value += 5; };
+ auto create_func = [](float *value) {
+ *value = 10.0f;
+ return true;
+ };
+ auto modify_func = [](float *value) {
+ *value += 5;
+ return false;
+ };
EXPECT_TRUE(map.add_or_modify(1, create_func, modify_func));
EXPECT_EQ(map.lookup(1), 10.0f);
EXPECT_FALSE(map.add_or_modify(1, create_func, modify_func));