Skip to content

Commit

Permalink
Fix -Wsign-compare warning in pixelmatch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jwmcglynn committed Feb 8, 2024
1 parent 9d91981 commit 7f4c75b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/pixelmatch_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ std::string escapeFilename(std::string filename) {

template <size_t kBytes>
void setPixel(std::array<uint8_t, kBytes>& destination, int offsetInPixels, Color color) {
ASSERT_TRUE(offsetInPixels >= 0 && offsetInPixels < kBytes / 4)
<< "offsetInPixels=" << offsetInPixels;
ASSERT_GE(offsetInPixels, 0);
ASSERT_LT(static_cast<size_t>(offsetInPixels), kBytes / 4);

const int offset = offsetInPixels * 4;

destination[offset + 0] = color.r;
Expand Down

0 comments on commit 7f4c75b

Please sign in to comment.