diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-08-16 23:00:13 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-08-16 23:00:13 (GMT) |
commit | fb934f2a8d7398a3ff39a107093f9da6ceda59a7 (patch) | |
tree | 6c7964a0fbae7d2495aa7f51fad6f74c952ac184 /tests/auto | |
parent | 69bd07dd091d43049fa8dafa8ec063ab6c90a1fa (diff) | |
parent | 023f6408358b3caba02e7a88accbfb64b261e21e (diff) | |
download | Qt-fb934f2a8d7398a3ff39a107093f9da6ceda59a7.zip Qt-fb934f2a8d7398a3ff39a107093f9da6ceda59a7.tar.gz Qt-fb934f2a8d7398a3ff39a107093f9da6ceda59a7.tar.bz2 |
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtextcursor/tst_qtextcursor.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qtextcursor/tst_qtextcursor.cpp b/tests/auto/qtextcursor/tst_qtextcursor.cpp index 2b0ba42..cc3b1dc 100644 --- a/tests/auto/qtextcursor/tst_qtextcursor.cpp +++ b/tests/auto/qtextcursor/tst_qtextcursor.cpp @@ -50,6 +50,7 @@ #include <qabstracttextdocumentlayout.h> #include <qtextlayout.h> #include <qtextcursor.h> +#include <qtextobject.h> #include <qdebug.h> //TESTED_FILES=gui/text/qtextcursor.cpp gui/text/qtextcursor_p.h @@ -154,6 +155,8 @@ private slots: void cursorPositionWithBlockUndoAndRedo2(); void cursorPositionWithBlockUndoAndRedo3(); + void joinNonEmptyRemovedBlockUserState(); + private: int blockCount(); @@ -1858,5 +1861,20 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo3() QCOMPARE(cursor.position(), cursorPositionBefore); } +void tst_QTextCursor::joinNonEmptyRemovedBlockUserState() +{ + cursor.insertText("Hello"); + cursor.insertBlock(); + cursor.insertText("World"); + cursor.block().setUserState(10); + + cursor.movePosition(QTextCursor::EndOfBlock); + cursor.movePosition(QTextCursor::PreviousBlock, QTextCursor::KeepAnchor); + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + cursor.removeSelectedText(); + + QCOMPARE(cursor.block().userState(), 10); +} + QTEST_MAIN(tst_QTextCursor) #include "tst_qtextcursor.moc" |