[Libreoffice-commits] core.git: vcl/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 25 10:41:37 UTC 2018


 vcl/qa/cppunit/complextext.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 68259f3663ba61a5f15f04793ac32a200100a8a5
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Dec 24 12:26:45 2018 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Dec 25 11:41:16 2018 +0100

    Try fixing VclComplexTextTest::testArabic by rescheduling
    
    The test keeps sporadically falling on Windows; it just has failed twice
    in a row for me at line 98, with actual values 90 and 76, instead of 72.
    Unfortunately, in subsequent testing, the test keeps working OK, so no
    reliable reproducing.
    
    I suspect some problem with initialization possibly missing; so try to
    fix it by inserting an Application::Reschedule(). I am not an expert in
    this code, so this change could of course make no sense.
    
    I reenable tests that were skipped because of the instability; if the
    fix is wrong, hopefully this will make it apparent sooner to revert it.
    
    Change-Id: I939375de6046e3698574be019f6ea512af53dacd
    Reviewed-on: https://gerrit.libreoffice.org/65594
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index 96332585673b..fdc9064c858d 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -18,6 +18,7 @@ static std::ostream& operator<<(std::ostream& rStream, const std::vector<long>&
 #include <unotest/filters-test.hxx>
 #include <test/bootstrapfixture.hxx>
 
+#include <vcl/svapp.hxx>
 #include <vcl/wrkwin.hxx>
 // workaround MSVC2015 issue with std::unique_ptr
 #include <sallayout.hxx>
@@ -25,7 +26,7 @@ static std::ostream& operator<<(std::ostream& rStream, const std::vector<long>&
 #include <osl/file.hxx>
 #include <osl/process.h>
 
-#if !defined(_WIN32) && HAVE_MORE_FONTS
+#if HAVE_MORE_FONTS
 static std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec)
 {
     rStream << "{ ";
@@ -80,19 +81,17 @@ void VclComplexTextTest::testArabic()
 
     OutputDevice *pOutDev = pWin.get();
     pOutDev->SetFont( aFont );
+    Application::Reschedule(true); // FIXME: workaround for a threading/event-handling (?) problem
 
     // absolute character widths AKA text array.
-#if !defined(_WIN32)
     std::vector<long> aRefCharWidths {6,  9,  16, 16, 22, 22, 26, 29, 32, 32,
                                       36, 40, 49, 53, 56, 63, 63, 66, 72, 72};
     std::vector<long> aCharWidths(aOneTwoThree.getLength(), 0);
     long nTextWidth = pOutDev->GetTextArray(aOneTwoThree, aCharWidths.data());
 
     CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
-    // this sporadically returns 75 or 74 on some of the windows tinderboxes eg. tb73
     CPPUNIT_ASSERT_EQUAL(72L, nTextWidth);
     CPPUNIT_ASSERT_EQUAL(nTextWidth, aCharWidths.back());
-#endif
 
     // text advance width and line height
     CPPUNIT_ASSERT_EQUAL(72L, pOutDev->GetTextWidth(aOneTwoThree));


More information about the Libreoffice-commits mailing list