From 3afa29ed5b446c0d5f67aa0d9ef5f1318107add7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Oct 2019 14:24:18 +0200 Subject: [PATCH] DebugTools: XFAIL a screenshot() test if the format is not R8. It gets read as RGBA on Intel Windows. --- .../DebugTools/Test/ScreenshotGLTest.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp b/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp index bc12c8e11..d2e92801c 100644 --- a/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp +++ b/src/Magnum/DebugTools/Test/ScreenshotGLTest.cpp @@ -200,14 +200,20 @@ void ScreenshotGLTest::r8() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(succeeded); - CORRADE_COMPARE(out.str(), - Utility::formatString("DebugTools::screenshot(): saved a PixelFormat::R8Unorm image of size Vector(4, 3) to {}\n", file)); - if(!(_importerManager.loadState("AnyImageImporter") & PluginManager::LoadState::Loaded) || - !(_importerManager.loadState("TgaImporter") & PluginManager::LoadState::Loaded)) - CORRADE_SKIP("AnyImageImporter / TgaImporter plugins not found."); + { + CORRADE_EXPECT_FAIL_IF(framebuffer.implementationColorReadFormat() != GL::PixelFormat::Red, + "Implementation-defined color read format is not single-channel."); + + CORRADE_COMPARE(out.str(), + Utility::formatString("DebugTools::screenshot(): saved a PixelFormat::R8Unorm image of size Vector(4, 3) to {}\n", file)); - CORRADE_COMPARE_WITH(file, r, CompareFileToImage{_importerManager}); + if(!(_importerManager.loadState("AnyImageImporter") & PluginManager::LoadState::Loaded) || + !(_importerManager.loadState("TgaImporter") & PluginManager::LoadState::Loaded)) + CORRADE_SKIP("AnyImageImporter / TgaImporter plugins not found."); + + CORRADE_COMPARE_WITH(file, r, CompareFileToImage{_importerManager}); + } #endif }