diff options
Diffstat (limited to 'tests/gtests/blenlib/BLI_vector_set_test.cc')
-rw-r--r-- | tests/gtests/blenlib/BLI_vector_set_test.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/gtests/blenlib/BLI_vector_set_test.cc b/tests/gtests/blenlib/BLI_vector_set_test.cc index 410e7a1b319..816d5d653a5 100644 --- a/tests/gtests/blenlib/BLI_vector_set_test.cc +++ b/tests/gtests/blenlib/BLI_vector_set_test.cc @@ -39,6 +39,17 @@ TEST(vector_set, Copy) EXPECT_EQ(set2.index(2), 1); } +TEST(vector_set, CopyAssignment) +{ + IntVectorSet set1 = {1, 2, 3}; + IntVectorSet set2 = {}; + set2 = set1; + EXPECT_EQ(set1.size(), 3); + EXPECT_EQ(set2.size(), 3); + EXPECT_EQ(set1.index(2), 1); + EXPECT_EQ(set2.index(2), 1); +} + TEST(vector_set, Move) { IntVectorSet set1 = {1, 2, 3}; @@ -47,6 +58,15 @@ TEST(vector_set, Move) EXPECT_EQ(set2.size(), 3); } +TEST(vector_set, MoveAssignment) +{ + IntVectorSet set1 = {1, 2, 3}; + IntVectorSet set2 = {}; + set2 = std::move(set1); + EXPECT_EQ(set1.size(), 0); + EXPECT_EQ(set2.size(), 3); +} + TEST(vector_set, AddNewIncreasesSize) { IntVectorSet set; |