Remove Q_ASSERT's from QTextEdit autotest
authorJason McDonald <jason.mcdonald@nokia.com>
Tue, 3 May 2011 05:32:28 +0000 (15:32 +1000)
committerRohan McGovern <rohan.mcgovern@nokia.com>
Wed, 18 May 2011 00:46:45 +0000 (10:46 +1000)
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
(cherry picked from commit 3290dd0d3563310f6bdbabf74105367bd8c611d3)

tests/auto/qtextedit/tst_qtextedit.cpp

index 992d2f2..6b9a541 100644 (file)
@@ -317,7 +317,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
 
@@ -327,7 +327,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);
@@ -2064,7 +2064,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();