Skip to content

Commit

Permalink
[共通] update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Nov 13, 2023
1 parent e13310e commit 9bf5dd4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Test/Siv3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@ std::tuple<std::string, std::string> CaptureStandardOutput(const std::function<v

void AssertImagesAreEqual(const Image& target, const Image& checked)
{
Image clonedTarget = target;
Image clonedChecked = checked;

auto targetMat = OpenCV_Bridge::GetMatView(clonedTarget);
auto targetChecked = OpenCV_Bridge::GetMatView(clonedChecked);
cv::Mat diff { cv::Size{ clonedTarget.width(), clonedTarget.height() }, CV_8UC4 };

cv::absdiff(targetMat, targetChecked, diff);
cv::checkRange(diff, false, nullptr, -1.0, 1.0);
if (target != checked)
{
throw std::runtime_error{ "AssertImagesAreEqual: target != checked" };
}
}

0 comments on commit 9bf5dd4

Please sign in to comment.