diff options
Diffstat (limited to 'tests/gtests/blenlib')
-rw-r--r-- | tests/gtests/blenlib/BLI_span_test.cc | 10 | ||||
-rw-r--r-- | tests/gtests/blenlib/BLI_vector_test.cc | 9 |
2 files changed, 19 insertions, 0 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 |