[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - include/test include/unotest sw/qa test/source unotest/source vcl/qa
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 6 14:47:26 UTC 2021
include/test/bootstrapfixture.hxx | 3
include/unotest/bootstrapfixturebase.hxx | 2
sw/qa/extras/uiwriter/uiwriter3.cxx | 2
test/source/bootstrapfixture.cxx | 9 ++
unotest/source/cpp/bootstrapfixturebase.cxx | 13 ---
vcl/qa/cppunit/BackendTest.cxx | 88 +++++++++++------------
vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 2
7 files changed, 58 insertions(+), 61 deletions(-)
New commits:
commit e2fa68f26318da6c7027b71b7f7f79a0c55b7fde
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Apr 1 16:54:44 2021 +0300
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Apr 6 16:46:54 2021 +0200
Exclude tests based on device color depth, not RDP
After 5c9ba1f47d00ed10960b59928befd68f6c020b15, the failures on Jenkins
(see 21191d0d8953a3ca6eac6022c0a14a87fe9c5e2a) made it apparent that
(at least some of) Jenkins builds also run in RDP sessions. Since the
tests excluded in commit 9c6142ec26a0ba61b1cf58d1e6bf0b5376394bcd never
failed in Jenkins builds before, it is wrong to exclude all those tests
in all RDP sessions: our CI would not test those on Windows.
In the meanwhile, I discovered that the system that failed the tests
actually had 16-bit color depth, despite RDP being configured to use
32-bit colors; that was the reason why the colors were modified on
roundtrip. So it is better to test the actual problem to exclude tests.
This reimplements the check that was introduced in commit
9c6142ec26a0ba61b1cf58d1e6bf0b5376394bcd to test default virtual device
color depth.
Change-Id: I329a3e2d8eca21732c77dcacf15394d1246b2e18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113466
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 7f2c6fff796f86d685aa20018ae72375011b1367)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113639
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/include/test/bootstrapfixture.hxx b/include/test/bootstrapfixture.hxx
index 052e3a8e229d..aa3cd1b99fcc 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -57,6 +57,9 @@ public:
virtual void setUp() override;
void validate(const OUString& rURL, ValidationFormat) const;
+
+ // Allows to exclude tests dependent on color depth of the default virtual device
+ static sal_uInt16 getDefaultDeviceBitCount();
};
}
diff --git a/include/unotest/bootstrapfixturebase.hxx b/include/unotest/bootstrapfixturebase.hxx
index ac0e1166f8a6..1a25e25d4ca0 100644
--- a/include/unotest/bootstrapfixturebase.hxx
+++ b/include/unotest/bootstrapfixturebase.hxx
@@ -65,8 +65,6 @@ public:
virtual void setUp() override;
virtual void tearDown() override;
-
- bool isWindowsRDP() const;
};
}
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index f0444d3f3c7a..eedba24768a7 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -2099,7 +2099,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135661)
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477)
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
load(DATA_DIRECTORY, "tdf133477.fodt");
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 4d6b54a8f879..4048858c77be 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -24,7 +24,9 @@
#include <osl/file.hxx>
#include <osl/process.h>
#include <unotools/tempfile.hxx>
+#include <vcl/salgtype.hxx>
#include <vcl/scheduler.hxx>
+#include <vcl/virdev.hxx>
#include <memory>
#include <cstring>
@@ -237,4 +239,11 @@ IMPL_STATIC_LINK(
return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( rData );
}
+sal_uInt16 test::BootstrapFixture::getDefaultDeviceBitCount()
+{
+ ScopedVclPtr<VirtualDevice> device
+ = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ return device->GetBitCount();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotest/source/cpp/bootstrapfixturebase.cxx b/unotest/source/cpp/bootstrapfixturebase.cxx
index 5eb5b91dcaf0..5c5b3bcc3a9c 100644
--- a/unotest/source/cpp/bootstrapfixturebase.cxx
+++ b/unotest/source/cpp/bootstrapfixturebase.cxx
@@ -13,10 +13,6 @@
#include <comphelper/processfactory.hxx>
#include <basic/sbstar.hxx>
-#if defined _WIN32
-#include <systools/win32/uwinapi.h>
-#endif
-
using namespace ::com::sun::star;
// NB. this constructor is called before any tests are run, once for each
@@ -36,13 +32,4 @@ void test::BootstrapFixtureBase::setUp()
void test::BootstrapFixtureBase::tearDown() { StarBASIC::DetachAllDocBasicItems(); }
-bool test::BootstrapFixtureBase::isWindowsRDP() const
-{
-#if defined _WIN32
- return GetSystemMetrics(SM_REMOTESESSION);
-#else
- return false;
-#endif
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 0f34dc65ecc1..6e426b4df6b2 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -95,7 +95,7 @@ public:
void testDrawRectWithRectangle()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestRect aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -108,7 +108,7 @@ public:
void testDrawRectWithPixel()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPixel aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -121,7 +121,7 @@ public:
void testDrawRectWithLine()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestLine aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -134,7 +134,7 @@ public:
void testDrawRectWithPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -146,7 +146,7 @@ public:
void testDrawRectWithPolyLine()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyLine aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -158,7 +158,7 @@ public:
void testDrawRectWithPolyLineB2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -170,7 +170,7 @@ public:
void testDrawRectWithPolyPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -182,7 +182,7 @@ public:
void testDrawRectWithPolyPolygonB2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(false);
@@ -194,7 +194,7 @@ public:
void testDrawRectAAWithRectangle()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestRect aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -206,7 +206,7 @@ public:
void testDrawRectAAWithPixel()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPixel aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -218,7 +218,7 @@ public:
void testDrawRectAAWithLine()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestLine aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -230,7 +230,7 @@ public:
void testDrawRectAAWithPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -242,7 +242,7 @@ public:
void testDrawRectAAWithPolyLine()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyLine aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -254,7 +254,7 @@ public:
void testDrawRectAAWithPolyLineB2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -266,7 +266,7 @@ public:
void testDrawRectAAWithPolyPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -278,7 +278,7 @@ public:
void testDrawRectAAWithPolyPolygonB2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRectangle(true);
@@ -290,7 +290,7 @@ public:
void testDrawFilledRectWithRectangle()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestRect aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
@@ -307,7 +307,7 @@ public:
void testDrawFilledRectWithPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
@@ -324,7 +324,7 @@ public:
void testDrawFilledRectWithPolyPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyPolygon aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
@@ -341,7 +341,7 @@ public:
void testDrawFilledRectWithPolyPolygon2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyPolygonB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupFilledRectangle(false);
@@ -428,7 +428,7 @@ public:
void testDrawBezierWithPolylineB2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupBezier();
@@ -440,7 +440,7 @@ public:
void testDrawBezierAAWithPolylineB2D()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestPolyLineB2D aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupAABezier();
@@ -452,7 +452,7 @@ public:
void testDrawBitmap()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestBitmap aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDrawBitmap();
@@ -464,7 +464,7 @@ public:
void testDrawTransformedBitmap()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestBitmap aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDrawTransformedBitmap();
@@ -476,7 +476,7 @@ public:
void testDrawBitmapExWithAlpha()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestBitmap aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDrawBitmapExWithAlpha();
@@ -488,7 +488,7 @@ public:
void testDrawMask()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestBitmap aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDrawMask();
@@ -500,7 +500,7 @@ public:
void testDrawBlend()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestBitmap aOutDevTest;
BitmapEx aBitmapEx = aOutDevTest.setupDrawBlend();
@@ -512,7 +512,7 @@ public:
void testDrawXor()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupXOR();
@@ -524,7 +524,7 @@ public:
void testClipRectangle()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestClip aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupClipRectangle();
@@ -536,7 +536,7 @@ public:
void testClipPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestClip aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupClipPolygon();
@@ -548,7 +548,7 @@ public:
void testClipPolyPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestClip aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupClipPolyPolygon();
@@ -560,7 +560,7 @@ public:
void testClipB2DPolyPolygon()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestClip aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupClipB2DPolyPolygon();
@@ -572,7 +572,7 @@ public:
void testDrawOutDev()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDrawOutDev();
@@ -584,7 +584,7 @@ public:
void testDashedLine()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestLine aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupDashedLine();
@@ -596,7 +596,7 @@ public:
void testErase()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
{
// Create normal virtual device (no alpha).
@@ -663,7 +663,7 @@ public:
void testLinearGradient()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestGradient aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupLinearGradient();
@@ -675,7 +675,7 @@ public:
void testLinearGradientAngled()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestGradient aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupLinearGradientAngled();
@@ -697,7 +697,7 @@ public:
void testLinearGradientIntensity()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestGradient aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupLinearGradientIntensity();
@@ -709,7 +709,7 @@ public:
void testLinearGradientSteps()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestGradient aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupLinearGradientSteps();
@@ -721,7 +721,7 @@ public:
void testAxialGradient()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestGradient aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupAxialGradient();
@@ -733,7 +733,7 @@ public:
void testRadialGradient()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
vcl::test::OutputDeviceTestGradient aOutDevTest;
Bitmap aBitmap = aOutDevTest.setupRadialGradient();
@@ -758,7 +758,7 @@ public:
{
// TODO: This unit test is not executed for macOS unless bitmap scaling is implemented
#ifndef MACOSX
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
// Create virtual device with alpha.
ScopedVclPtr<VirtualDevice> device
@@ -812,7 +812,7 @@ public:
{
// TODO: This unit test is not executed for macOS unless bitmap scaling is implemented
#ifndef MACOSX
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
// Normal virtual device.
ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
@@ -908,7 +908,7 @@ public:
void testTdf136171()
{
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
// Create virtual device with alpha.
ScopedVclPtr<VirtualDevice> device
diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
index e416ba35e38b..809976754200 100644
--- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
+++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
@@ -122,7 +122,7 @@ void BitmapRenderTest::testDrawAlphaBitmapEx()
{
// TODO: This unit test is not executed for macOS unless bitmap scaling is implemented
#ifndef MACOSX
- if (isWindowsRDP())
+ if (getDefaultDeviceBitCount() < 24)
return;
ScopedVclPtrInstance<VirtualDevice> pVDev;
pVDev->SetOutputSizePixel(Size(8, 8));
More information about the Libreoffice-commits
mailing list