diff --git a/test/framework/array.h b/test/framework/array.h index 1b392ad652ad1c700c85b6673d34d52537519da2..4a566053a2bed828c86bfe67320d73eec98228e1 100644 --- a/test/framework/array.h +++ b/test/framework/array.h @@ -309,21 +309,23 @@ class Array2D : public TwoDimensional { }; // end of class Array2D /// Compares two \ref Array2D objects for equality. -#define EXPECT_EQ_ARRAY2D(lhs, rhs) \ - do { \ - ASSERT_EQ((lhs).width(), (rhs).width()) \ - << "Mismatch in width." << std::endl; \ - ASSERT_EQ((lhs).height(), (rhs).height()) \ - << "Mismatch in height." << std::endl; \ - ASSERT_EQ((lhs).channels(), (rhs).channels()) \ - << "Mismatch in channels." << std::endl; \ - auto mismatch = (lhs).compare_to((rhs)); \ - if (mismatch) { \ - auto [row, col] = *mismatch; \ - GTEST_FAIL() << "Mismatch at (row=" << row << ", col=" << col \ - << "): " << (lhs).at(row, col)[0] << " vs " \ - << (rhs).at(row, col)[0] << "." << std::endl; \ - } \ +#define EXPECT_EQ_ARRAY2D(lhs, rhs) \ + do { \ + ASSERT_EQ((lhs).width(), (rhs).width()) \ + << "Mismatch in width." << std::endl; \ + ASSERT_EQ((lhs).height(), (rhs).height()) \ + << "Mismatch in height." << std::endl; \ + ASSERT_EQ((lhs).channels(), (rhs).channels()) \ + << "Mismatch in channels." << std::endl; \ + auto mismatch = (lhs).compare_to((rhs)); \ + if (mismatch) { \ + auto [row, col] = *mismatch; \ + GTEST_FAIL() << "Mismatch at (row=" << row << ", col=" << col \ + << "): " << std::hex << std::showbase \ + << static_cast((lhs).at(row, col)[0]) << " vs " \ + << static_cast((rhs).at(row, col)[0]) << "." \ + << std::endl; \ + } \ } while (0 != 0) /// Compares two \ref Array2D objects for inequality. diff --git a/test/framework/test_array2d.cpp b/test/framework/test_array2d.cpp index a26c25bd19de5b0c651cd2a0a34b76303df2c6a9..adbeaa7cdeaf120b2aff9625b7ad4222bbc00b6c 100644 --- a/test/framework/test_array2d.cpp +++ b/test/framework/test_array2d.cpp @@ -296,7 +296,7 @@ TEST(Array2D, ExpectEq_NotEqual_Data) { } }; - EXPECT_FATAL_FAILURE(Test::test(), "Mismatch at (row=0, col=0): 0 vs 42."); + EXPECT_FATAL_FAILURE(Test::test(), "Mismatch at (row=0, col=0): 0 vs 0x2a."); } /// Tests that EXPECT_NE_ARRAY2D() macro works for equal objects.