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 <jacques@blender.org>2020-07-13 11:51:46 +0300
committerJacques Lucke <jacques@blender.org>2020-07-13 11:51:46 +0300
commita19584a4715444721f8f625f0b5481e67c0d97ae (patch)
tree02e4d3d1ceb16c76448d2b2889a656d6807aabbe /tests
parent644a915b1b096be816ddc50050a70d90a2787191 (diff)
BLI: fix constructor regression for Vector and Array
This was introduced in rB403384998a6bb5f428e15ced5.
Diffstat (limited to 'tests')
-rw-r--r--tests/gtests/blenlib/BLI_span_test.cc10
-rw-r--r--tests/gtests/blenlib/BLI_vector_test.cc9
-rw-r--r--tests/gtests/functions/FN_attributes_ref_test.cc3
-rw-r--r--tests/gtests/functions/FN_multi_function_test.cc2
4 files changed, 21 insertions, 3 deletions
diff --git a/tests/gtests/blenlib/BLI_span_test.cc b/tests/gtests/blenlib/BLI_span_test.cc
index ed3cce6d2cf..cb1a8b9b6f9 100644
--- a/tests/gtests/blenlib/BLI_span_test.cc
+++ b/tests/gtests/blenlib/BLI_span_test.cc
@@ -285,4 +285,14 @@ TEST(span, CastLargerSize)
EXPECT_EQ(new_a_span.size(), 2u);
}
+TEST(span, VoidPointerSpan)
+{
+ int a;
+ float b;
+ double c;
+
+ auto func1 = [](Span<void *> span) { EXPECT_EQ(span.size(), 3); };
+ func1({&a, &b, &c});
+}
+
} // namespace blender
diff --git a/tests/gtests/blenlib/BLI_vector_test.cc b/tests/gtests/blenlib/BLI_vector_test.cc
index 92fb12fb4e5..a020611aed6 100644
--- a/tests/gtests/blenlib/BLI_vector_test.cc
+++ b/tests/gtests/blenlib/BLI_vector_test.cc
@@ -651,4 +651,13 @@ TEST(vector, OveralignedValues)
}
}
+TEST(vector, ConstructVoidPointerVector)
+{
+ int a;
+ float b;
+ double c;
+ Vector<void *> vec = {&a, &b, &c};
+ EXPECT_EQ(vec.size(), 3);
+}
+
} // namespace blender
diff --git a/tests/gtests/functions/FN_attributes_ref_test.cc b/tests/gtests/functions/FN_attributes_ref_test.cc
index fee8c5dc058..1c05bb930db 100644
--- a/tests/gtests/functions/FN_attributes_ref_test.cc
+++ b/tests/gtests/functions/FN_attributes_ref_test.cc
@@ -65,8 +65,7 @@ TEST(mutable_attributes_ref, ComplexTest)
Array<float> sizes(amount);
Array<std::string> names(amount);
- Array<void *> buffers = {
- (void *)positions.data(), (void *)ids.data(), (void *)sizes.data(), (void *)names.data()};
+ Array<void *> buffers = {positions.data(), ids.data(), sizes.data(), names.data()};
MutableAttributesRef attributes{info, buffers, IndexRange(1, 3)};
EXPECT_EQ(attributes.size(), 3);
EXPECT_EQ(attributes.info().size(), 4);
diff --git a/tests/gtests/functions/FN_multi_function_test.cc b/tests/gtests/functions/FN_multi_function_test.cc
index 2544f1c63b0..8cc8f91a300 100644
--- a/tests/gtests/functions/FN_multi_function_test.cc
+++ b/tests/gtests/functions/FN_multi_function_test.cc
@@ -369,7 +369,7 @@ TEST(multi_function, CustomMF_Convert)
CustomMF_Convert<float, int> fn;
Array<float> inputs = {5.4f, 7.1f, 9.0f};
- Array<int> outputs{inputs.size(), 0};
+ Array<int> outputs(inputs.size(), 0);
MFParamsBuilder params(fn, inputs.size());
params.add_readonly_single_input(inputs.as_span());