Skip to content

Commit bc6ebc1

Browse files
hjmjohnsonclaude
andcommitted
STYLE: Use ITK_EXPECT_VECTOR_NEAR for array comparisons in BresenhamLine
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 144cc73 commit bc6ebc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/Core/Common/test/itkBresenhamLineGTest.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ TEST(BresenhamLine, BuildLineFromVector)
3535

3636
for (int i = 0; i < 4; ++i)
3737
{
38-
EXPECT_EQ(offsets[i][0], i) << "offsets[" << i << "][0] mismatch";
39-
EXPECT_EQ(offsets[i][1], i) << "offsets[" << i << "][1] mismatch";
38+
const itk::Offset<2> expectedOffset{ { i, i } };
39+
ITK_EXPECT_VECTOR_NEAR(offsets[i], expectedOffset, 0);
4040
}
4141
}
4242

@@ -58,8 +58,8 @@ TEST(BresenhamLine, BuildLineFromIndices)
5858

5959
for (int i = 0; i < 40; ++i)
6060
{
61-
EXPECT_EQ(indices[i][0], i) << "indices[" << i << "][0] mismatch";
62-
EXPECT_EQ(indices[i][1], i) << "indices[" << i << "][1] mismatch";
61+
const itk::Index<2> expectedIndex{ { i, i } };
62+
ITK_EXPECT_VECTOR_NEAR(indices[i], expectedIndex, 0);
6363
}
6464

6565
std::cout << "Test Passed !" << std::endl;

0 commit comments

Comments
 (0)