diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-03-30 18:36:08 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-03-31 14:55:46 +0200 |
commit | dd473f1d82f2533530534e22072a9cb976b01a4d (patch) | |
tree | 1c1848655f842178ce82655aef618de9fd71f8d4 /vcl | |
parent | 542146ef51d21ef9d5eae64c1820a80b8b41fcad (diff) |
Exclude some tests in Windows RDP session
It seems that RDP may change (limit?) color space (even configured
to use 32-bit colors), and then some tests start failing like this:
Test name: BackendTest::testDrawAlphaBitmapMirrored
equality assertion failed
- Expected: c[80000000]
- Actual : c[84000000]
Debugging ImplDrawBitmap in vcl/win/gdi/gdiimpl.cxx, and adding a
call to GetPixel immediately after the call to StretchDIBits, shows
that the resulting color on the device is different from the color
in the bitmap data: e.g., for original color {128, 0, 0} the result
is {132, 0, 0}.
Calling GetColorAdjustment shows that there's no color adjustments
set for the device, so I can't detect or modify the behavior this
way. So just disable the tests for now when running in RDP sessions.
Change-Id: Ie89d07f18f53e56bed6f7fa58432b8575b4d9f12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113388
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 9c6142ec26a0ba61b1cf58d1e6bf0b5376394bcd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113355
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 95b51c5792a8d71b079eac42d6439abaa15e44e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113403
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/BackendTest.cxx | 88 | ||||
-rw-r--r-- | vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 2 |
2 files changed, 90 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx index 29d7268445e1..0f34dc65ecc1 100644 --- a/vcl/qa/cppunit/BackendTest.cxx +++ b/vcl/qa/cppunit/BackendTest.cxx @@ -95,6 +95,8 @@ public: void testDrawRectWithRectangle() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -106,6 +108,8 @@ public: void testDrawRectWithPixel() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPixel aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -117,6 +121,8 @@ public: void testDrawRectWithLine() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -128,6 +134,8 @@ public: void testDrawRectWithPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -138,6 +146,8 @@ public: void testDrawRectWithPolyLine() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -148,6 +158,8 @@ public: void testDrawRectWithPolyLineB2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -158,6 +170,8 @@ public: void testDrawRectWithPolyPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -168,6 +182,8 @@ public: void testDrawRectWithPolyPolygonB2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap); @@ -178,6 +194,8 @@ public: void testDrawRectAAWithRectangle() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -188,6 +206,8 @@ public: void testDrawRectAAWithPixel() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPixel aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -198,6 +218,8 @@ public: void testDrawRectAAWithLine() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -208,6 +230,8 @@ public: void testDrawRectAAWithPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -218,6 +242,8 @@ public: void testDrawRectAAWithPolyLine() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -228,6 +254,8 @@ public: void testDrawRectAAWithPolyLineB2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -238,6 +266,8 @@ public: void testDrawRectAAWithPolyPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -248,6 +278,8 @@ public: void testDrawRectAAWithPolyPolygonB2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRectangle(true); auto eResult = vcl::test::OutputDeviceTestCommon::checkRectangleAA(aBitmap); @@ -258,6 +290,8 @@ public: void testDrawFilledRectWithRectangle() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestRect aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); @@ -273,6 +307,8 @@ public: void testDrawFilledRectWithPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); @@ -288,6 +324,8 @@ public: void testDrawFilledRectWithPolyPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyPolygon aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); @@ -303,6 +341,8 @@ public: void testDrawFilledRectWithPolyPolygon2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false); auto eResult = vcl::test::OutputDeviceTestCommon::checkFilledRectangle(aBitmap, false); @@ -388,6 +428,8 @@ public: void testDrawBezierWithPolylineB2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupBezier(); auto eResult = vcl::test::OutputDeviceTestCommon::checkBezier(aBitmap); @@ -398,6 +440,8 @@ public: void testDrawBezierAAWithPolylineB2D() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest; Bitmap aBitmap = aOutDevTest.setupAABezier(); auto eResult = vcl::test::OutputDeviceTestCommon::checkBezier(aBitmap); @@ -408,6 +452,8 @@ public: void testDrawBitmap() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmap(); exportImage("08-01_bitmap_test.png", aBitmap); @@ -418,6 +464,8 @@ public: void testDrawTransformedBitmap() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawTransformedBitmap(); auto eResult = vcl::test::OutputDeviceTestBitmap::checkTransformedBitmap(aBitmap); @@ -428,6 +476,8 @@ public: void testDrawBitmapExWithAlpha() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawBitmapExWithAlpha(); auto eResult = vcl::test::OutputDeviceTestBitmap::checkBitmapExWithAlpha(aBitmap); @@ -438,6 +488,8 @@ public: void testDrawMask() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestBitmap aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawMask(); auto eResult = vcl::test::OutputDeviceTestBitmap::checkMask(aBitmap); @@ -448,6 +500,8 @@ public: void testDrawBlend() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestBitmap aOutDevTest; BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend(); auto eResult = vcl::test::OutputDeviceTestBitmap::checkBlend(aBitmapEx); @@ -458,6 +512,8 @@ public: void testDrawXor() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest; Bitmap aBitmap = aOutDevTest.setupXOR(); auto eResult = vcl::test::OutputDeviceTestAnotherOutDev::checkXOR(aBitmap); @@ -468,6 +524,8 @@ public: void testClipRectangle() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipRectangle(); auto eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); @@ -478,6 +536,8 @@ public: void testClipPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipPolygon(); auto eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); @@ -488,6 +548,8 @@ public: void testClipPolyPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipPolyPolygon(); auto eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); @@ -498,6 +560,8 @@ public: void testClipB2DPolyPolygon() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestClip aOutDevTest; Bitmap aBitmap = aOutDevTest.setupClipB2DPolyPolygon(); auto eResult = vcl::test::OutputDeviceTestClip::checkClip(aBitmap); @@ -508,6 +572,8 @@ public: void testDrawOutDev() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDrawOutDev(); auto eResult = vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDev(aBitmap); @@ -518,6 +584,8 @@ public: void testDashedLine() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestLine aOutDevTest; Bitmap aBitmap = aOutDevTest.setupDashedLine(); auto eResult = vcl::test::OutputDeviceTestLine::checkDashedLine(aBitmap); @@ -528,6 +596,8 @@ public: void testErase() { + if (isWindowsRDP()) + return; { // Create normal virtual device (no alpha). ScopedVclPtr<VirtualDevice> device @@ -593,6 +663,8 @@ public: void testLinearGradient() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradient(); auto eResult = vcl::test::OutputDeviceTestGradient::checkLinearGradient(aBitmap); @@ -603,6 +675,8 @@ public: void testLinearGradientAngled() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientAngled(); auto eResult = vcl::test::OutputDeviceTestGradient::checkLinearGradientAngled(aBitmap); @@ -623,6 +697,8 @@ public: void testLinearGradientIntensity() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientIntensity(); auto eResult = vcl::test::OutputDeviceTestGradient::checkLinearGradientIntensity(aBitmap); @@ -633,6 +709,8 @@ public: void testLinearGradientSteps() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupLinearGradientSteps(); auto eResult = vcl::test::OutputDeviceTestGradient::checkLinearGradientSteps(aBitmap); @@ -643,6 +721,8 @@ public: void testAxialGradient() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupAxialGradient(); auto eResult = vcl::test::OutputDeviceTestGradient::checkAxialGradient(aBitmap); @@ -653,6 +733,8 @@ public: void testRadialGradient() { + if (isWindowsRDP()) + return; vcl::test::OutputDeviceTestGradient aOutDevTest; Bitmap aBitmap = aOutDevTest.setupRadialGradient(); auto eResult = vcl::test::OutputDeviceTestGradient::checkRadialGradient(aBitmap); @@ -676,6 +758,8 @@ public: { // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented #ifndef MACOSX + if (isWindowsRDP()) + return; // Create virtual device with alpha. ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); @@ -728,6 +812,8 @@ public: { // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented #ifndef MACOSX + if (isWindowsRDP()) + return; // Normal virtual device. ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT); // Virtual device with alpha. @@ -822,6 +908,8 @@ public: void testTdf136171() { + if (isWindowsRDP()) + return; // Create virtual device with alpha. ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx index 8a60eebbc44c..e416ba35e38b 100644 --- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx +++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx @@ -122,6 +122,8 @@ void BitmapRenderTest::testDrawAlphaBitmapEx() { // TODO: This unit test is not executed for macOS unless bitmap scaling is implemented #ifndef MACOSX + if (isWindowsRDP()) + return; ScopedVclPtrInstance<VirtualDevice> pVDev; pVDev->SetOutputSizePixel(Size(8, 8)); pVDev->SetBackground(Wallpaper(COL_WHITE)); |