diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-08-30 16:28:38 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-08-30 20:04:33 +0200 |
commit | 8ca13426ca50a9466f552ac1e2f062920003d5ea (patch) | |
tree | baf9c3c1ae1efd24ec80ba0296c09c1dc8fb2c3e /vcl/qa | |
parent | cb38ff2ea917c5f7440f3d421a707cb53c1aa068 (diff) |
Workaround interdependency of tests
CppunitTest_vcl_text failed for me on Windows:
[_RUN_____] VclTextTest::testSimpleText
C:/lo/src/core/vcl/qa/cppunit/text.cxx:198:VclTextTest::testSimpleText
double equality assertion failed
- Expected: 28
- Actual : -1
- Delta : 4
This turned out to depend on test order; the minimal failing command was
make CppunitTest_vcl_text CPPUNIT_TEST_NAME="testArabic testSimpleText"
and running testArabic before testSimpleText made the latter to render
white text on white background, and thus being unable to get resulting
height of the painted text.
Changing how the complex tests obtain their virtusl devices fixes this
for me. I have no idea how and why the previous complex test code
affected following tests. Windows buildbots were unaffected maybe
because they had HAVE_MORE_FONTS undefined.
Change-Id: If079e21e6b986fed5407295a71f9b121cf8de0b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139047
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/complextext.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index ff85b14e33ef..6c35fd740b33 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -65,12 +65,10 @@ void VclComplexTextTest::testArabic() { #if HAVE_MORE_FONTS OUString aOneTwoThree(u"واحِدْ إثٍنين ثلاثةٌ"); - ScopedVclPtrInstance<WorkWindow> pWin(static_cast<vcl::Window *>(nullptr)); - CPPUNIT_ASSERT( pWin ); vcl::Font aFont("DejaVu Sans", "Book", Size(0, 12)); - OutputDevice *pOutDev = pWin->GetOutDev(); + ScopedVclPtrInstance<VirtualDevice> pOutDev; pOutDev->SetFont( aFont ); // absolute character widths AKA text array. @@ -120,10 +118,7 @@ void VclComplexTextTest::testTdf95650() "\u0D11\u1312\u0105\u020A\u0512\u1403\u030C\u1528" "\u2931\u632E\u7074\u0D20\u0E0A\u100A\uF00D\u0D20" "\u030A\u0C0B\u20E0\u0A0D"; - ScopedVclPtrInstance<WorkWindow> pWin(static_cast<vcl::Window *>(nullptr)); - CPPUNIT_ASSERT(pWin); - - OutputDevice *pOutDev = pWin->GetOutDev(); + ScopedVclPtrInstance<VirtualDevice> pOutDev; // Check that the following executes without failing assertion pOutDev->ImplLayout(aTxt, 9, 1, Point(), 0, {}, {}, SalLayoutFlags::BiDiRtl); } |