tst_qtextcocumentlayout::blockVisibility - make the test more robust

The test inserts strings "0" ... "9" into the text document,
takes the half of resulting document's size, makes half of
lines invisible and compares sizes. On OS X 10.11 after inserting
"4" the width changes, so making "4" invisible also reduces the width
and QCOMPARE(currentSize, previosHalfSize) fails. Instead of digits,
insert the same string "A" 10 times.

Change-Id: Ie88a0442703f98949cea9bcdb694cecee59695f3
Task-number: QTBUG-49848
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
bb10
Timur Pocheptsov 2016-01-07 09:03:09 +01:00
parent 3d82b74c3a
commit b530ca770f
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ void tst_QTextDocumentLayout::blockVisibility()
for (int i = 0; i < 10; ++i) {
if (!doc->isEmpty())
cursor.insertBlock();
cursor.insertText(QString::number(i));
cursor.insertText("A");
}
qreal margin = doc->documentMargin();