From db44b570f72a649e22c428da944c52149ead4db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Feb 2019 22:29:41 +0100 Subject: [PATCH] DebugTools: make CommpareImage usable with CORRADE_COMPARE_AS(). --- doc/changelog.dox | 7 +++++++ src/Magnum/DebugTools/CompareImage.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/doc/changelog.dox b/doc/changelog.dox index c1564d628..28aecf506 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -59,6 +59,13 @@ See also: recognizes also uppercase file extensions (see [mosra/magnum#312](https://github.com/mosra/magnum/pull/312)) +@subsubsection changelog-latest-changes-debugtools DebugTools library + +- @ref DebugTools::CompareImage, @ref DebugTools::CompareImageToFile and + other variants are now usable directly through @ref CORRADE_COMPARE_AS(), + no need to pass an explicit instance to @ref CORRADE_COMPARE_WITH() when + just the default parameters are needed + @subsubsection changelog-latest-changes-platform Platform libraries - On OpenGL ES builds, @ref Platform::Sdl2Application now tells SDL whether diff --git a/src/Magnum/DebugTools/CompareImage.h b/src/Magnum/DebugTools/CompareImage.h index 517f4e944..f43818025 100644 --- a/src/Magnum/DebugTools/CompareImage.h +++ b/src/Magnum/DebugTools/CompareImage.h @@ -100,6 +100,8 @@ template<> class MAGNUM_DEBUGTOOLS_EXPORT Comparator class MAGNUM_DEBUGTOOLS_EXPORT Comparator* manager, Magnum::Float maxThreshold, Magnum::Float meanThreshold): Magnum::DebugTools::Implementation::ImageComparatorBase{manager, maxThreshold, meanThreshold} {} + /*implicit*/ Comparator(): Comparator{nullptr, 0.0f, 0.0f} {} + bool operator()(const Magnum::ImageView2D& actual, const std::string& expected) { return Magnum::DebugTools::Implementation::ImageComparatorBase::operator()(actual, expected); } @@ -129,6 +133,8 @@ template<> class MAGNUM_DEBUGTOOLS_EXPORT Comparator* manager, Magnum::Float maxThreshold, Magnum::Float meanThreshold): Magnum::DebugTools::Implementation::ImageComparatorBase{manager, maxThreshold, meanThreshold} {} + /*implicit*/ Comparator(): Comparator{nullptr, 0.0f, 0.0f} {} + bool operator()(const std::string& actual, const Magnum::ImageView2D& expected) { return Magnum::DebugTools::Implementation::ImageComparatorBase::operator()(actual, expected); }