diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-24 15:51:48 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-28 13:18:55 +0000 |
commit | 569785cb00588b0e56d4a4900b46f9751f0d3d44 (patch) | |
tree | 7546ffb3c731a13e410004b29a14d67da6e47e0f /tests/auto | |
parent | 3b04cc6a4a476cb6f7a0a3f3458b7d3be1d6d84a (diff) |
Various tests: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer).
- Replace Q[TRY]_VERIFY(smartPointer == 0) by
Q[TRY]_VERIFY(smartPointer.isNull()).
- Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and
add casts where necessary. The values will then be logged
should a test fail.
in tests/auto/other, tests/auto/printsupport and tests/auto/xml.
Change-Id: I28cbdc89d36791f179425f17f90b697c60660938
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/other/compiler/tst_compiler.cpp | 4 | ||||
-rw-r--r-- | tests/auto/other/gestures/tst_gestures.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/macnativeevents/tst_macnativeevents.cpp | 8 | ||||
-rw-r--r-- | tests/auto/other/modeltest/modeltest.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/networkselftest/tst_networkselftest.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 22 | ||||
-rw-r--r-- | tests/auto/other/qcomplextext/tst_qcomplextext.cpp | 2 | ||||
-rw-r--r-- | tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp | 2 | ||||
-rw-r--r-- | tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp | 6 | ||||
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 64 | ||||
-rw-r--r-- | tests/auto/xml/dom/qdom/tst_qdom.cpp | 10 | ||||
-rw-r--r-- | tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp | 2 |
12 files changed, 63 insertions, 63 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp index 705149bd6b..5ef247483d 100644 --- a/tests/auto/other/compiler/tst_compiler.cpp +++ b/tests/auto/other/compiler/tst_compiler.cpp @@ -354,7 +354,7 @@ void tst_Compiler::detectDataStream() QVERIFY(QtTestInternal::getSaveOperator<double>() != 0); QVERIFY(QtTestInternal::getSaveOperator<QString>() != 0); QVERIFY(QtTestInternal::getSaveOperator<MyString>() != 0); - QVERIFY(QtTestInternal::getSaveOperator<Qxxx>() == 0); + QVERIFY(!QtTestInternal::getSaveOperator<Qxxx>()); } #else void tst_Compiler::detectDataStream() @@ -637,7 +637,7 @@ void tst_Compiler::cxx11_alignas() QSKIP("Compiler does not support C++11 feature"); #else alignas(double) char c; - QVERIFY(Q_ALIGNOF(c) == Q_ALIGNOF(double)); + QCOMPARE(Q_ALIGNOF(c), Q_ALIGNOF(double)); #endif } diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp index 43ce6b2d72..2a4f88c627 100644 --- a/tests/auto/other/gestures/tst_gestures.cpp +++ b/tests/auto/other/gestures/tst_gestures.cpp @@ -1461,7 +1461,7 @@ void tst_Gestures::ungrabGesture() // a method on QWidget QPointer<QGesture> customGestureB; customGestureB = *(b->gestures.begin()); QVERIFY(!customGestureB.isNull()); - QVERIFY(customGestureA.data() == customGestureB.data()); + QCOMPARE(customGestureA.data(), customGestureB.data()); QCOMPARE(customGestureB->gestureType(), CustomGesture::GestureType); a->gestures.clear(); diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp index 5d24655144..d1c5e4a35e 100644 --- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp +++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp @@ -457,8 +457,8 @@ void tst_MacNativeEvents::testModifierCtrl() QWidget w; w.show(); - QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]); - QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]); + QCOMPARE(ushort(kControlUnicode), QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText).at(0).unicode()); + QCOMPARE(ushort(kCommandUnicode), QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText).at(0).unicode()); NativeEventList native; native.append(new QNativeModifierEvent(Qt::ControlModifier)); @@ -490,8 +490,8 @@ void tst_MacNativeEvents::testModifierCtrlWithDontSwapCtrlAndMeta() QWidget w; w.show(); - QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]); - QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]); + QCOMPARE(ushort(kCommandUnicode), QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText).at(0).unicode()); + QCOMPARE(ushort(kControlUnicode), QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText).at(0).unicode()); NativeEventList native; native.append(new QNativeModifierEvent(Qt::ControlModifier)); diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp index 72a4a0ad29..c119fdaa4e 100644 --- a/tests/auto/other/modeltest/modeltest.cpp +++ b/tests/auto/other/modeltest/modeltest.cpp @@ -569,7 +569,7 @@ void ModelTest::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto QVERIFY(topLeft.isValid()); QVERIFY(bottomRight.isValid()); QModelIndex commonParent = bottomRight.parent(); - QVERIFY(topLeft.parent() == commonParent); + QCOMPARE(topLeft.parent(), commonParent); QVERIFY(topLeft.row() <= bottomRight.row()); QVERIFY(topLeft.column() <= bottomRight.column()); int rowCount = model->rowCount(commonParent); diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp index 84996ad768..7ce385121c 100644 --- a/tests/auto/other/networkselftest/tst_networkselftest.cpp +++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp @@ -462,7 +462,7 @@ void tst_NetworkSelfTest::remotePortsOpen() else QFAIL(QString("Error connecting to server on port %1: %2").arg(portNumber).arg(socket.errorString()).toLocal8Bit()); } - QVERIFY(socket.state() == QAbstractSocket::ConnectedState); + QCOMPARE(socket.state(), QAbstractSocket::ConnectedState); } static QList<Chat> ftpChat(const QByteArray &userSuffix = QByteArray()) diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 4a8709f709..69007bd250 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -452,15 +452,15 @@ void tst_QAccessibility::statesStructTest() QVERIFY(s1.modal == 0); QAccessible::State s2; - QVERIFY(s2 == s1); + QCOMPARE(s2, s1); s2.busy = true; QVERIFY(!(s2 == s1)); s1.busy = true; - QVERIFY(s2 == s1); + QCOMPARE(s2, s1); s1 = QAccessible::State(); QVERIFY(!(s2 == s1)); s1 = s2; - QVERIFY(s2 == s1); + QCOMPARE(s2, s1); QVERIFY(s1.busy == 1); } @@ -523,9 +523,9 @@ void tst_QAccessibility::navigateHierarchy() QVERIFY(ifaceW->isValid()); QAccessibleInterface *target = ifaceW->child(14); - QVERIFY(target == 0); + QVERIFY(!target); target = ifaceW->child(-1); - QVERIFY(target == 0); + QVERIFY(!target); target = ifaceW->child(0); QAccessibleInterface *interfaceW1(ifaceW->child(0)); QVERIFY(target); @@ -541,7 +541,7 @@ void tst_QAccessibility::navigateHierarchy() QCOMPARE(target->object(), (QObject*)w3); QAccessibleInterface *child = target->child(1); - QVERIFY(child == 0); + QVERIFY(!child); child = target->child(0); QVERIFY(child != 0); QVERIFY(child->isValid()); @@ -959,7 +959,7 @@ void tst_QAccessibility::mainWindowTest() QWindow window; window.setGeometry(80, 80, 40, 40); window.show(); - QTRY_VERIFY(QGuiApplication::focusWindow() == &window); + QTRY_COMPARE(QGuiApplication::focusWindow(), &window); // We currently don't have an accessible interface for QWindow // the active state is either in the QMainWindow or QQuickView @@ -1650,7 +1650,7 @@ void tst_QAccessibility::spinBoxTest() // make sure that the line edit is not there const int numChildren = interface->childCount(); QCOMPARE(numChildren, 0); - QVERIFY(interface->child(0) == Q_NULLPTR); + QVERIFY(!interface->child(0)); QVERIFY(interface->valueInterface()); QCOMPARE(interface->valueInterface()->currentValue().toInt(), 3); @@ -2486,7 +2486,7 @@ void tst_QAccessibility::groupBoxTest() QCOMPARE(iface->text(QAccessible::Name), QLatin1String("Test QGroupBox")); QCOMPARE(iface->text(QAccessible::Description), QLatin1String("This group box will be used to test accessibility")); QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations = rButtonIface->relations(); - QVERIFY(relations.size() == 1); + QCOMPARE(relations.size(), 1); QPair<QAccessibleInterface*, QAccessible::Relation> relation = relations.first(); QCOMPARE(relation.first->object(), groupBox); QCOMPARE(relation.second, QAccessible::Label); @@ -3531,13 +3531,13 @@ void tst_QAccessibility::dockWidgetTest() QPoint buttonPoint = pb2->mapToGlobal(QPoint(pb2->width()/2, pb2->height()/2)); QAccessibleInterface *childAt = accDock2->childAt(buttonPoint.x(), buttonPoint.y()); QVERIFY(childAt); - QVERIFY(childAt->object() == pb2); + QCOMPARE(childAt->object(), pb2); QWidget *close1 = qobject_cast<QWidget*>(dock1Close->object()); QPoint close1ButtonPoint = close1->mapToGlobal(QPoint(close1->width()/2, close1->height()/2)); QAccessibleInterface *childAt2 = accDock1->childAt(close1ButtonPoint.x(), close1ButtonPoint.y()); QVERIFY(childAt2); - QVERIFY(childAt2->object() == close1); + QCOMPARE(childAt2->object(), close1); // custom title bar widget QDockWidget *dock3 = new QDockWidget(mw); diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp index a9234b7060..1428a63123 100644 --- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp +++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp @@ -173,7 +173,7 @@ void tst_QComplexText::bidiCursor_qtbug2795() qreal x2 = line2.cursorToX(0) - line2.cursorToX(str.size()); // The cursor should remain at the same position after a digit is appended - QVERIFY(x1 == x2); + QCOMPARE(x1, x2); } void tst_QComplexText::bidiCursorMovement_data() diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp index b161dccb88..acb0d28c6b 100644 --- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp +++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp @@ -132,7 +132,7 @@ void compareScreenshots(const QString &image1, const QString &image2) //screenShot.save("scr2.png", "PNG"); //original.save("orig1.png", "PNG"); - QVERIFY(original == screenShot); + QCOMPARE(original, screenShot); } void takeScreenShot(const QString filename) diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index c256d9ba82..318f87467c 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -425,12 +425,12 @@ void tst_QPrinter::outputFormatFromSuffix() if (QPrinterInfo::availablePrinters().size() == 0) QSKIP("No printers available."); QPrinter p; - QVERIFY(p.outputFormat() == QPrinter::NativeFormat); + QCOMPARE(p.outputFormat(), QPrinter::NativeFormat); p.setOutputFileName("test.pdf"); TempFileCleanup tmpFile("test.pdf"); - QVERIFY(p.outputFormat() == QPrinter::PdfFormat); + QCOMPARE(p.outputFormat(), QPrinter::PdfFormat); p.setOutputFileName(QString()); - QVERIFY(p.outputFormat() == QPrinter::NativeFormat); + QCOMPARE(p.outputFormat(), QPrinter::NativeFormat); } void tst_QPrinter::testPageMargins_data() diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 350c6142d2..fa1b68b4f9 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -880,7 +880,7 @@ void tst_Moc::preprocessorConditionals() QVERIFY(mobj->indexOfSignal("signalInIf1()") != -1); QVERIFY(mobj->indexOfSignal("signalInIf2()") != -1); QVERIFY(mobj->indexOfSignal("signalInIf3()") != -1); - QVERIFY(mobj->indexOfSignal("doNotExist()") == -1); + QCOMPARE(mobj->indexOfSignal("doNotExist()"), -1); } void tst_Moc::blackslashNewlines() @@ -888,7 +888,7 @@ void tst_Moc::blackslashNewlines() BackslashNewlines tst; const QMetaObject *mobj = tst.metaObject(); QVERIFY(mobj->indexOfSlot("works()") != -1); - QVERIFY(mobj->indexOfSlot("buggy()") == -1); + QCOMPARE(mobj->indexOfSlot("buggy()"), -1); } void tst_Moc::slotWithSillyConst() @@ -928,8 +928,8 @@ void tst_Moc::testExtraDataForEnum() const QMetaObject * const *objects = mobjUser->d.relatedMetaObjects; QVERIFY(objects); - QVERIFY(objects[0] == mobjSource); - QVERIFY(objects[1] == 0); + QCOMPARE(objects[0], mobjSource); + QVERIFY(!objects[1]); } void tst_Moc::namespaceTypeProperty() @@ -982,7 +982,7 @@ void tst_Moc::namespacedFlags() const QVariant v = bar.property("flags"); QVERIFY(v.isValid()); QVERIFY(baz.setProperty("flags", v)); - QVERIFY(baz.flags() == bar.flags()); + QCOMPARE(baz.flags(), bar.flags()); QList<Foo::Bar::Flags> l; l << baz.flags(); @@ -1104,7 +1104,7 @@ void tst_Moc::winNewline() if (data.at(i) == QLatin1Char('\r')) { QVERIFY(i < data.count() - 1); ++i; - QVERIFY(data.at(i) == '\n'); + QCOMPARE(data.at(i), '\n'); } else { QVERIFY(data.at(i) != '\n'); } @@ -1255,14 +1255,14 @@ void tst_Moc::invokable() { const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject; QCOMPARE(mobj.methodCount(), 6); - QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()")); + QCOMPARE(mobj.method(5).methodSignature(), QByteArray("foo()")); } { const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject; QCOMPARE(mobj.methodCount(), 7); - QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()")); - QVERIFY(mobj.method(6).methodSignature() == QByteArray("bar()")); + QCOMPARE(mobj.method(5).methodSignature(), QByteArray("foo()")); + QCOMPARE(mobj.method(6).methodSignature(), QByteArray("bar()")); } } @@ -1271,22 +1271,22 @@ void tst_Moc::singleFunctionKeywordSignalAndSlot() { const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject; QCOMPARE(mobj.methodCount(), 7); - QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()")); - QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()")); + QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()")); + QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()")); } { const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject; QCOMPARE(mobj.methodCount(), 7); - QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()")); - QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()")); + QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()")); + QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()")); } { const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject; QCOMPARE(mobj.methodCount(), 7); - QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()")); - QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()")); + QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()")); + QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()")); } } @@ -1740,34 +1740,34 @@ template <class T> void tst_Moc::revisions_T() { int idx = T::staticMetaObject.indexOfProperty("prop1"); - QVERIFY(T::staticMetaObject.property(idx).revision() == 0); + QCOMPARE(T::staticMetaObject.property(idx).revision(), 0); idx = T::staticMetaObject.indexOfProperty("prop2"); - QVERIFY(T::staticMetaObject.property(idx).revision() == 2); + QCOMPARE(T::staticMetaObject.property(idx).revision(), 2); idx = T::staticMetaObject.indexOfMethod("method1()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 0); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 0); idx = T::staticMetaObject.indexOfMethod("method2()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 4); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 4); idx = T::staticMetaObject.indexOfSlot("slot1()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 0); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 0); idx = T::staticMetaObject.indexOfSlot("slot2()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 3); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 3); idx = T::staticMetaObject.indexOfSlot("slot3()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 6); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 6); idx = T::staticMetaObject.indexOfSlot("slot4()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 6); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 6); idx = T::staticMetaObject.indexOfSignal("signal1()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 0); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 0); idx = T::staticMetaObject.indexOfSignal("signal2()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 5); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 5); idx = T::staticMetaObject.indexOfSignal("signal3()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 7); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 7); idx = T::staticMetaObject.indexOfSignal("signal4()"); - QVERIFY(T::staticMetaObject.method(idx).revision() == 7); + QCOMPARE(T::staticMetaObject.method(idx).revision(), 7); idx = T::staticMetaObject.indexOfEnumerator("TestEnum"); QCOMPARE(T::staticMetaObject.enumerator(idx).keyCount(), 2); @@ -1947,7 +1947,7 @@ public: void tst_Moc::privateClass() { - QVERIFY(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()") == 0); + QCOMPARE(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()"), 0); QVERIFY(PrivateClass::staticMetaObject.indexOfSignal("someSignal()") > 0); } @@ -3068,7 +3068,7 @@ void tst_Moc::parseDefines() int index = mo->indexOfSlot("stringMethod()"); QVERIFY(index != -1); - QVERIFY(mo->method(index).returnType() == QMetaType::QString); + QCOMPARE(mo->method(index).returnType(), int(QMetaType::QString)); index = mo->indexOfSlot("combined1()"); QVERIFY(index != -1); @@ -3127,7 +3127,7 @@ void tst_Moc::parseDefines() QVERIFY(!qstrcmp(mci.value(), "TestValue")); } } - QVERIFY(count == 3); + QCOMPARE(count, 3); index = mo->indexOfSlot("PD_DEFINE_ITSELF_SUFFIX(int)"); QVERIFY(index != -1); @@ -3253,7 +3253,7 @@ void tst_Moc::relatedMetaObjectsWithinNamespaces() const QMetaObject *testMo = &QTBUG_2151::B::staticMetaObject; QVERIFY(testMo->d.relatedMetaObjects); - QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo); + QCOMPARE(testMo->d.relatedMetaObjects[0], relatedMo); } void tst_Moc::relatedMetaObjectsInGadget() @@ -3262,7 +3262,7 @@ void tst_Moc::relatedMetaObjectsInGadget() const QMetaObject *testMo = &QTBUG_35657::B::staticMetaObject; QVERIFY(testMo->d.relatedMetaObjects); - QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo); + QCOMPARE(testMo->d.relatedMetaObjects[0], relatedMo); } void tst_Moc::relatedMetaObjectsNameConflict_data() diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index 2ce32c7cf2..a4a3f1f6b3 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -1043,15 +1043,15 @@ void tst_QDom::browseElements() QVERIFY(!bar.isNull()); QVERIFY(bar.previousSiblingElement("bar").isNull()); QVERIFY(bar.previousSiblingElement().isNull()); - QVERIFY(bar.nextSiblingElement("bar").tagName() == "bar"); + QCOMPARE(bar.nextSiblingElement("bar").tagName(), QLatin1String("bar")); QVERIFY(bar.nextSiblingElement("bar").nextSiblingElement("bar").isNull()); QDomElement bop = foo.firstChildElement("bop"); QVERIFY(!bop.isNull()); - QVERIFY(bar.nextSiblingElement() == bop); - QVERIFY(bop.nextSiblingElement("bop") == foo.lastChildElement("bop")); - QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement("bar")); - QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement()); + QCOMPARE(bar.nextSiblingElement(), bop); + QCOMPARE(bop.nextSiblingElement("bop"), foo.lastChildElement("bop")); + QCOMPARE(bop.previousSiblingElement("bar"), foo.firstChildElement("bar")); + QCOMPARE(bop.previousSiblingElement("bar"), foo.firstChildElement()); } void tst_QDom::domNodeMapAndList() diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp index 04f19f6a2b..a5ac58878e 100644 --- a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp +++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp @@ -147,7 +147,7 @@ public slots: void requestFinished(QNetworkReply *reply) { - QVERIFY(reply->error() == QNetworkReply::NoError); + QCOMPARE(reply->error(), QNetworkReply::NoError); reply->deleteLater(); } |