vcl/qa/cppunit/complextext.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
New commits: commit 8ca13426ca50a9466f552ac1e2f062920003d5ea Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Aug 30 16:28:38 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Aug 30 20:04:33 2022 +0200 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.kagan...@collabora.com> 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); }