From 3290dd0d3563310f6bdbabf74105367bd8c611d3 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 3 May 2011 15:32:28 +1000 Subject: Remove Q_ASSERT's from QTextEdit autotest Convert Q_ASSERT to QCOMPARE and remove mention of Q_ASSERT in comments to make it easier to check for unwanted Q_ASSERT's in the future. Change-Id: I7ae250428d4d5682806e724a7207523e65cd9851 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern --- tests/auto/qtextedit/tst_qtextedit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/auto/qtextedit/tst_qtextedit.cpp') diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 9ca17b9f5f..4a79e38ee2 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -312,7 +312,7 @@ void tst_QTextEdit::getSetCheck() // void QTextEdit::setFontPointSize(qreal) obj1.setFontPointSize(qreal(1.1)); QCOMPARE(qreal(1.1), obj1.fontPointSize()); - // we currently Q_ASSERT_X in QFont::setPointSizeF for that + // we currently assert in QFont::setPointSizeF for that //obj1.setFontPointSize(0.0); //QCOMPARE(1.1, obj1.fontPointSize()); // Should not accept 0.0 => keep old @@ -322,7 +322,7 @@ void tst_QTextEdit::getSetCheck() QCOMPARE(1, obj1.fontWeight()); // Range<1, 99> obj1.setFontWeight(99); QCOMPARE(99, obj1.fontWeight()); // Range<1, 99> - /* Q_ASSERT_X in qfont.cpp + /* assertion in qfont.cpp obj1.setFontWeight(INT_MIN); QCOMPARE(1, obj1.fontWeight()); // Range<1, 99> obj1.setFontWeight(INT_MAX); @@ -2059,7 +2059,7 @@ void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imag QCOMPARE(original.isNull(), false); QCOMPARE(original.size(), image.size()); - Q_ASSERT(image.depth() == 32); + QCOMPARE(image.depth(), 32); QCOMPARE(original.depth(), image.depth()); const int bytesPerLine = image.bytesPerLine(); -- cgit v1.2.3 From 5eba82b752e85a5d6cb3a893214ed2646d75f362 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 11 May 2011 12:13:01 +0200 Subject: Move QTextCursor::MoveStyle to Qt namespace We cannot use QTextCursor::MoveStyle enums in QTextLine because QTextCursor is not a QObject, while referring to that enum in Q_PROPERTY requires it to be. That's why we need to move the enums in Qt namespace. Reviewed-by: David Boddie --- tests/auto/qtextedit/tst_qtextedit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/qtextedit/tst_qtextedit.cpp') diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 5a645937d7..992d2f2682 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -2292,7 +2292,7 @@ void tst_QTextEdit::bidiVisualMovement() option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); ed->document()->setDefaultTextOption(option); - ed->document()->setDefaultCursorMoveStyle(QTextCursor::Visual); + ed->document()->setDefaultCursorMoveStyle(Qt::VisualMoveStyle); ed->moveCursor(QTextCursor::Start); ed->show(); @@ -2346,7 +2346,7 @@ void tst_QTextEdit::bidiLogicalMovement() option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); ed->document()->setDefaultTextOption(option); - ed->document()->setDefaultCursorMoveStyle(QTextCursor::Logical); + ed->document()->setDefaultCursorMoveStyle(Qt::LogicalMoveStyle); ed->moveCursor(QTextCursor::Start); ed->show(); -- cgit v1.2.3