MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / iterateOverSingleRowReversely

Function iterateOverSingleRowReversely

test/PatchIterators.cpp:409–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409void 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
430TEST_F(PatchIteratorTest, IterateOverSingleRow)
431{

Callers 1

TEST_FFunction · 0.85

Calls 5

getWidthMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
isValidMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected