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

Function comparePatches

test/Patch.cpp:180–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180inline void comparePatches(const IPatch& patch, const IPatch& expected, const std::string& infoText)
181{
182 EXPECT_EQ(patch.getWidth(), expected.getWidth()) << infoText << ": Width mismatch";
183 EXPECT_EQ(patch.getHeight(), expected.getHeight()) << infoText << ": Height mismatch";
184
185 // Check the whole control point matrix
186 for (auto row = 0; row < patch.getHeight(); ++row)
187 {
188 for (auto col = 0; col < patch.getWidth(); ++col)
189 {
190 const auto& expectedCtrl = expected.ctrlAt(row, col);
191 const auto& ctrl = patch.ctrlAt(row, col);
192
193 EXPECT_TRUE(math::isNear(ctrl.vertex, expectedCtrl.vertex, 0.01)) << infoText << ": Vertex mismatch at " << row << "," << col;
194 }
195 }
196}
197
198TEST_F(PatchTest, CapPatch)
199{

Callers 1

TEST_FFunction · 0.85

Calls 3

isNearFunction · 0.50
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected