summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextdocument/tst_qtextdocument.cpp
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2009-11-16 10:16:47 (GMT)
committerThomas Zander <thomas.zander@trolltech.com>2009-11-16 12:02:13 (GMT)
commit7e1f19c3e3036f166a84dbaa916ec1da1cc818c6 (patch)
tree8b1a7128a7e0549c4c734a0748643c007ad04bf2 /tests/auto/qtextdocument/tst_qtextdocument.cpp
parentdbaea6fa5a90742d89691685baa44a1a34598f21 (diff)
downloadQt-7e1f19c3e3036f166a84dbaa916ec1da1cc818c6.zip
Qt-7e1f19c3e3036f166a84dbaa916ec1da1cc818c6.tar.gz
Qt-7e1f19c3e3036f166a84dbaa916ec1da1cc818c6.tar.bz2
Fix regression in emitting of QTextDocument::undoCommandAdded()
The test I wrote was not testing if calling undo/redo had any effect on emitting undoCommandAdded(), added these test cases and fixed the QTextDocumentPrivate::endEditBlock so we now again emit only when an undo command is added, not also on calling undo or redo. Reviewed-by: mae Reviewed-by: Samuel Rødal
Diffstat (limited to 'tests/auto/qtextdocument/tst_qtextdocument.cpp')
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index 1d54409..11e32b0 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -2615,6 +2615,17 @@ void tst_QTextDocument::testUndoCommandAdded()
cf.setFontItalic(true);
cursor.mergeCharFormat(cf);
QCOMPARE(spy.count(), 1);
+
+ spy.clear();
+ doc->undo();
+ QCOMPARE(spy.count(), 0);
+ doc->undo();
+ QCOMPARE(spy.count(), 0);
+ spy.clear();
+ doc->redo();
+ QCOMPARE(spy.count(), 0);
+ doc->redo();
+ QCOMPARE(spy.count(), 0);
}
void tst_QTextDocument::testUndoBlocks()