summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/complextext.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-03-01 01:38:58 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-01 00:19:09 +0000
commit62592cf1ebcc8ef381fe53855684342d963e6138 (patch)
tree3fc3f7bf59c535156b9090f92b0528e2b3b23ed9 /vcl/qa/cppunit/complextext.cxx
parent10077a06d8f6d08f276f99024528ee31a57390a9 (diff)
Add a test for GetTextArray()
Might help showing the source of differences causing random Windows failures. Change-Id: I435d1d4f7a016b057af30661b1c7016231426149 Reviewed-on: https://gerrit.libreoffice.org/34731 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/qa/cppunit/complextext.cxx')
-rw-r--r--vcl/qa/cppunit/complextext.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index 4b0d243a6d1d..fd6a72f2efa6 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -54,6 +54,16 @@ void VclComplexTextTest::testArabic()
OutputDevice *pOutDev = pWin.get();
pOutDev->SetFont( aFont );
+ // absolute character widths AKA text array.
+ std::vector<long> aCharWidths(aOneTwoThree.getLength(), 0);
+ long nTextWidth = pOutDev->GetTextArray(aOneTwoThree, aCharWidths.data());
+ 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));
CPPUNIT_ASSERT_EQUAL(13L, pOutDev->GetTextHeight());