| 401 | |
| 402 | template <size_t N> |
| 403 | void CheckMove(bool expect_overflow) { |
| 404 | IntVectorType<N> ints = MakeVector<N>({4, 5, 6, 7, 8}); |
| 405 | |
| 406 | IntVectorType<N> moved_ints(std::move(ints)); |
| 407 | ASSERT_EQ(moved_ints.size(), 5); |
| 408 | EXPECT_THAT(moved_ints, ElementsAre(4, 5, 6, 7, 8)); |
| 409 | ASSERT_EQ(UsesStaticStorage(moved_ints), !expect_overflow); |
| 410 | ASSERT_TRUE(UsesStaticStorage(ints)); |
| 411 | |
| 412 | IntVectorType<N> moved_moved_ints = std::move(moved_ints); |
| 413 | ASSERT_EQ(moved_moved_ints.size(), 5); |
| 414 | EXPECT_THAT(moved_moved_ints, ElementsAre(4, 5, 6, 7, 8)); |
| 415 | |
| 416 | // Move into itself |
| 417 | moved_moved_ints = std::move(moved_moved_ints); |
| 418 | ASSERT_EQ(moved_moved_ints.size(), 5); |
| 419 | EXPECT_THAT(moved_moved_ints, ElementsAre(4, 5, 6, 7, 8)); |
| 420 | } |
| 421 | |
| 422 | void TestMove() { |
| 423 | CheckMove<Traits::TestSizeFor(5)>(/*expect_overflow=*/Traits::CanOverflow()); |
nothing calls this directly
no test coverage detected