diff options
Diffstat (limited to 'source/blender/blenlib/tests/BLI_array_test.cc')
-rw-r--r-- | source/blender/blenlib/tests/BLI_array_test.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenlib/tests/BLI_array_test.cc b/source/blender/blenlib/tests/BLI_array_test.cc index 3d45a9f5277..7d967eca87e 100644 --- a/source/blender/blenlib/tests/BLI_array_test.cc +++ b/source/blender/blenlib/tests/BLI_array_test.cc @@ -236,4 +236,18 @@ TEST(array, Last) EXPECT_EQ(const_cast<const Array<int> &>(array).last(), 1); } +TEST(array, Reinitialize) +{ + Array<std::string> array = {"hello", "world"}; + EXPECT_EQ(array.size(), 2); + EXPECT_EQ(array[1], "world"); + array.reinitialize(3); + EXPECT_EQ(array.size(), 3); + EXPECT_EQ(array[0], ""); + EXPECT_EQ(array[1], ""); + EXPECT_EQ(array[2], ""); + array.reinitialize(0); + EXPECT_EQ(array.size(), 0); +} + } // namespace blender::tests |