| 407 | } |
| 408 | |
| 409 | void iterateOverSingleRowReversely(IPatch& patch, std::size_t rowToTest) |
| 410 | { |
| 411 | std::vector<Vector3> expectedValues; |
| 412 | |
| 413 | // Fill the vector with the expected values |
| 414 | for (auto col = static_cast<int>(patch.getWidth()) - 1; col >= 0; --col) |
| 415 | { |
| 416 | expectedValues.push_back(patch.ctrlAt(rowToTest, col).vertex); |
| 417 | } |
| 418 | |
| 419 | patch::SinglePatchRowReverseIterator it(patch, rowToTest); |
| 420 | auto expected = expectedValues.begin(); |
| 421 | |
| 422 | while (it.isValid()) |
| 423 | { |
| 424 | EXPECT_EQ((it++)->vertex, *(expected++)); |
| 425 | } |
| 426 | |
| 427 | EXPECT_EQ(expected, expectedValues.end()); // assume no underflow |
| 428 | } |
| 429 | |
| 430 | TEST_F(PatchIteratorTest, IterateOverSingleRow) |
| 431 | { |