summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-08 22:30:28 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-11 09:22:02 +0100
commit21f64d97a68c16b331a7b61f286c8e7668aa0119 (patch)
tree6603076d1a2cb177426ec6d8a712e4dc00fbe6be
parent05e0256ad304bafaadc8670eaa1c88b5b15f0535 (diff)
Make check_one_frame more verbose when it fails.
-rw-r--r--test/test.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test.cc b/test/test.cc
index b1d4fa158..57f4ae203 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -840,9 +840,12 @@ check_one_frame (boost::filesystem::path dcp_dir, int64_t index, boost::filesyst
int off = 0;
for (int y = 0; y < ref_image->size().height; ++y) {
for (int x = 0; x < ref_image->size().width; ++x) {
- BOOST_REQUIRE_EQUAL (ref_image->data(0)[off], image->data(0)[off]);
- BOOST_REQUIRE_EQUAL (ref_image->data(1)[off], image->data(1)[off]);
- BOOST_REQUIRE_EQUAL (ref_image->data(2)[off], image->data(2)[off]);
+ auto x_error = std::abs(ref_image->data(0)[off] - image->data(0)[off]);
+ BOOST_REQUIRE_MESSAGE(x_error == 0, "x component at " << x << "," << y << " differs by " << x_error);
+ auto y_error = std::abs(ref_image->data(1)[off] - image->data(1)[off]);
+ BOOST_REQUIRE_MESSAGE(y_error == 0, "y component at " << x << "," << y << " differs by " << y_error);
+ auto z_error = std::abs(ref_image->data(2)[off] - image->data(2)[off]);
+ BOOST_REQUIRE_MESSAGE(z_error == 0, "z component at " << x << "," << y << " differs by " << z_error);
++off;
}
}