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

Khaled Hosny khaledhosny at eglug.org
Mon Mar 6 17:51:56 UTC 2017


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

New commits:
commit 9af45ef67824f3ec6e95c16e7deb005a73532d65
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Mon Mar 6 16:43:57 2017 +0200

    Try harder to debug the random TB failures here
    
    Change-Id: I490302e56e6dcc222fc9b65755f16272bb53af56
    Reviewed-on: https://gerrit.libreoffice.org/34930
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index fd6a72f..f785b4a 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <ostream>
+#include <vector>
+std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec);
+
 #include <unotest/filters-test.hxx>
 #include <test/bootstrapfixture.hxx>
 
@@ -15,6 +19,16 @@
 #include <osl/file.hxx>
 #include <osl/process.h>
 
+std::ostream& operator<<(std::ostream& rStream, const std::vector<long>& rVec)
+{
+    rStream << "{ ";
+    for (size_t i = 0; i < rVec.size() - 1; i++)
+        rStream << rVec[i] << ", ";
+    rStream << rVec.back();
+    rStream << " }";
+    return rStream;
+}
+
 class VclComplexTextTest : public test::BootstrapFixture
 {
 public:
@@ -55,14 +69,14 @@ void VclComplexTextTest::testArabic()
     pOutDev->SetFont( aFont );
 
     // absolute character widths AKA text array.
+    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);
     CPPUNIT_ASSERT_EQUAL(72L, nTextWidth);
     CPPUNIT_ASSERT_EQUAL(nTextWidth, aCharWidths.back());
-    std::vector<long> aRefCharWidths {6,  9,  16, 16, 22, 22, 26, 29, 32, 32,
-                                      36, 40, 49, 53, 56, 63, 63, 66, 72, 72};
-    for (size_t i = 0; i < aCharWidths.size(); i++)
-        CPPUNIT_ASSERT_EQUAL(aRefCharWidths[i], aCharWidths[i]);
 
     // text advance width and line height
     CPPUNIT_ASSERT_EQUAL(72L, pOutDev->GetTextWidth(aOneTwoThree));


More information about the Libreoffice-commits mailing list