summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/complextext.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-03-06 16:43:57 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-06 17:51:17 +0000
commit9af45ef67824f3ec6e95c16e7deb005a73532d65 (patch)
treead77c140937a1a186e0d64e43cf4bc7d573b2675 /vcl/qa/cppunit/complextext.cxx
parentc7637cf6df213a6fd620b5250e4e3875c9251aa4 (diff)
Try harder to debug the random TB failures here
Change-Id: I490302e56e6dcc222fc9b65755f16272bb53af56 Reviewed-on: https://gerrit.libreoffice.org/34930 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.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index fd6a72f2efa6..f785b4a60591 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));