diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-30 15:16:36 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-31 11:50:10 +0000 |
commit | 7b72cc205ccd3e568b59a32a5cd751bd62b42e94 (patch) | |
tree | b6ef774e09a1101c3e9a5cbf18323c369e98a6f6 /tests/auto/widgets/widgets/qbuttongroup | |
parent | 3859b304e846b4ee8e77350945b6c63bbb487e13 (diff) |
tests/auto/widgets: 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.
Change-Id: Ie29640451dddeb58342038a8cd5fac152cce39e5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/widgets/qbuttongroup')
-rw-r--r-- | tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp index df69063540..5dec6224ca 100644 --- a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp @@ -324,13 +324,13 @@ void tst_QButtonGroup::testSignals() int expectedId = -2; - QVERIFY(clickedIdSpy.takeFirst().at(0).toInt() == expectedId); + QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), expectedId); QCOMPARE(pressedSpy.count(), 1); QCOMPARE(pressedIdSpy.count(), 1); - QVERIFY(pressedIdSpy.takeFirst().at(0).toInt() == expectedId); + QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), expectedId); QCOMPARE(releasedSpy.count(), 1); QCOMPARE(releasedIdSpy.count(), 1); - QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == expectedId); + QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), expectedId); clickedSpy.clear(); clickedIdSpy.clear(); @@ -344,13 +344,13 @@ void tst_QButtonGroup::testSignals() QCOMPARE(clickedSpy.count(), 1); QCOMPARE(clickedIdSpy.count(), 1); - QVERIFY(clickedIdSpy.takeFirst().at(0).toInt() == 23); + QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), 23); QCOMPARE(pressedSpy.count(), 1); QCOMPARE(pressedIdSpy.count(), 1); - QVERIFY(pressedIdSpy.takeFirst().at(0).toInt() == 23); + QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), 23); QCOMPARE(releasedSpy.count(), 1); QCOMPARE(releasedIdSpy.count(), 1); - QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == 23); + QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), 23); QSignalSpy toggledSpy(&buttons, SIGNAL(buttonToggled(QAbstractButton*, bool))); @@ -427,25 +427,25 @@ void tst_QButtonGroup::checkedButton() buttons.addButton(&pb1); buttons.addButton(&pb2, 23); - QVERIFY(buttons.checkedButton() == 0); + QVERIFY(!buttons.checkedButton()); pb1.setChecked(true); - QVERIFY(buttons.checkedButton() == &pb1); + QCOMPARE(buttons.checkedButton(), &pb1); pb2.setChecked(true); - QVERIFY(buttons.checkedButton() == &pb2); + QCOMPARE(buttons.checkedButton(), &pb2); pb2.setChecked(false); - QVERIFY(buttons.checkedButton() == &pb1); + QCOMPARE(buttons.checkedButton(), &pb1); pb1.setChecked(false); - QVERIFY(buttons.checkedButton() == 0); + QVERIFY(!buttons.checkedButton()); buttons.setExclusive(true); - QVERIFY(buttons.checkedButton() == 0); + QVERIFY(!buttons.checkedButton()); pb1.setChecked(true); - QVERIFY(buttons.checkedButton() == &pb1); + QCOMPARE(buttons.checkedButton(), &pb1); pb2.setChecked(true); - QVERIFY(buttons.checkedButton() == &pb2); + QCOMPARE(buttons.checkedButton(), &pb2); // checked button cannot be unchecked pb2.setChecked(false); - QVERIFY(buttons.checkedButton() == &pb2); + QCOMPARE(buttons.checkedButton(), &pb2); } class task209485_ButtonDeleter : public QObject @@ -523,9 +523,9 @@ void tst_QButtonGroup::autoIncrementId() radio1->setChecked(true); - QVERIFY(buttons->id(radio1) == -2); - QVERIFY(buttons->id(radio2) == -3); - QVERIFY(buttons->id(radio3) == -4); + QCOMPARE(buttons->id(radio1), -2); + QCOMPARE(buttons->id(radio2), -3); + QCOMPARE(buttons->id(radio3), -4); dlg.show(); } |