summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextdocument/tst_qtextdocument.cpp
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-09-28 15:09:29 +0200
committermae <qt-info@nokia.com>2009-09-28 15:25:19 +0200
commite131a4653ec13e9a680a4b41094e78f2cc929f4d (patch)
treeb13c0d91ec7289e42861f5ef4350e80fcb4198f1 /tests/auto/qtextdocument/tst_qtextdocument.cpp
parent6e5c9afdb16e44d55683794442e66681f60d373b (diff)
Fix tst_QTextDocument::cursorPositionChangedOnSetText
The test was introduced to make sure that the cursor position changed signal was not emitted excessively on setPlainText or on setHtml. The original fix however still included one superfluous emission for a temporary QTextCursor object. This was fixed by change 930ba91ec1e630, this change adjusts the auto test accordingly. Reviewed-by: Simon Hausmann
Diffstat (limited to 'tests/auto/qtextdocument/tst_qtextdocument.cpp')
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index c0d7ed39a8..f393393e62 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -1787,21 +1787,17 @@ void tst_QTextDocument::cursorPositionChangedOnSetText()
{
CursorPosSignalSpy spy(doc);
- cursor = QTextCursor();
+ // doc has one QTextCursor stored in the
+ // cursor member variable, thus the signal
+ // gets emitted once.
doc->setPlainText("Foo\nBar\nBaz\nBlub\nBlah");
- // the signal should still be emitted once for the QTextCursor that
- // QTextDocument::setPlainText creates temporarily. But the signal
- // should not be emitted more often.
QCOMPARE(spy.calls, 1);
spy.calls = 0;
doc->setHtml("<p>Foo<p>Bar<p>Baz<p>Blah");
- // the signal should still be emitted once for the QTextCursor that
- // QTextDocument::setPlainText creates temporarily. But the signal
- // should not be emitted more often.
QCOMPARE(spy.calls, 1);
}