From 37c5f079f1a1f3b6e45152128dec2729ba7e9dc3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 24 Aug 2021 00:44:49 +0200 Subject: [PATCH] Disable Direct2D checks failing under Wine Now that these Direct2D tests are compiled, disable those of them that fail under Wine due to missing support for Direct2D functionality we use in Wine implementation. Don't even give a warning message because there would be too many of them in these tests, just skip them silently. --- tests/graphics/graphbitmap.cpp | 18 ++++++++++++++++++ tests/graphics/graphpath.cpp | 3 +++ 2 files changed, 21 insertions(+) diff --git a/tests/graphics/graphbitmap.cpp b/tests/graphics/graphbitmap.cpp index 1e63e40b47..f1574491ab 100644 --- a/tests/graphics/graphbitmap.cpp +++ b/tests/graphics/graphbitmap.cpp @@ -338,6 +338,9 @@ TEST_CASE("GraphicsBitmapTestCase::Create", "[graphbitmap][create]") #if wxUSE_GRAPHICS_DIRECT2D SECTION("Direct2D GC") { + if ( wxIsRunningUnderWine() ) + return; + wxGraphicsRenderer* gr = wxGraphicsRenderer::GetDirect2DRenderer(); REQUIRE(gr != NULL); CheckCreateGraphBitmap(gr, bmp, image); @@ -445,6 +448,9 @@ TEST_CASE("GraphicsBitmapTestCase::Create", "[graphbitmap][create]") #if wxUSE_GRAPHICS_DIRECT2D SECTION("Direct2D GC") { + if ( wxIsRunningUnderWine() ) + return; + wxGraphicsRenderer* gr = wxGraphicsRenderer::GetDirect2DRenderer(); REQUIRE(gr != NULL); CheckCreateGraphBitmap(gr, bmp, image); @@ -550,6 +556,9 @@ TEST_CASE("GraphicsBitmapTestCase::Create", "[graphbitmap][create]") #if wxUSE_GRAPHICS_DIRECT2D SECTION("Direct2D GC") { + if ( wxIsRunningUnderWine() ) + return; + wxGraphicsRenderer* gr = wxGraphicsRenderer::GetDirect2DRenderer(); REQUIRE(gr != NULL); CheckCreateGraphBitmap(gr, bmp, image); @@ -665,6 +674,9 @@ TEST_CASE("GraphicsBitmapTestCase::SubBitmap", "[graphbitmap][subbitmap][create] #if wxUSE_GRAPHICS_DIRECT2D SECTION("Direct2D GC") { + if ( wxIsRunningUnderWine() ) + return; + wxGraphicsRenderer* gr = wxGraphicsRenderer::GetDirect2DRenderer(); REQUIRE(gr != NULL); CheckCreateGraphSubBitmap(gr, bmp, subX, subY, subW, subH, image); @@ -796,6 +808,9 @@ TEST_CASE("GraphicsBitmapTestCase::SubBitmap", "[graphbitmap][subbitmap][create] #if wxUSE_GRAPHICS_DIRECT2D SECTION("Direct2D GC") { + if ( wxIsRunningUnderWine() ) + return; + wxGraphicsRenderer* gr = wxGraphicsRenderer::GetDirect2DRenderer(); REQUIRE(gr != NULL); CheckCreateGraphSubBitmap(gr, bmp, subX, subY, subW, subH, image); @@ -909,6 +924,9 @@ TEST_CASE("GraphicsBitmapTestCase::SubBitmap", "[graphbitmap][subbitmap][create] #if wxUSE_GRAPHICS_DIRECT2D SECTION("Direct2D GC") { + if ( wxIsRunningUnderWine() ) + return; + wxGraphicsRenderer* gr = wxGraphicsRenderer::GetDirect2DRenderer(); REQUIRE(gr != NULL); CheckCreateGraphSubBitmap(gr, bmp, subX, subY, subW, subH, image); diff --git a/tests/graphics/graphpath.cpp b/tests/graphics/graphpath.cpp index 26fd0377be..723ffd65fb 100644 --- a/tests/graphics/graphpath.cpp +++ b/tests/graphics/graphpath.cpp @@ -51,6 +51,9 @@ TEST_CASE("GraphicsPathTestCaseGDIPlus", "[path][gdi+]") #if wxUSE_GRAPHICS_DIRECT2D TEST_CASE("GraphicsPathTestCaseDirect2D", "[path][d2d]") { + if ( wxIsRunningUnderWine() ) + return; + wxBitmap bmp(500, 500); wxMemoryDC mdc(bmp); wxScopedPtr gc(wxGraphicsRenderer::GetDirect2DRenderer()->CreateContext(mdc));