From fda36df6babf20bcfd04a54a1336a9c26e72a8ef Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 30 Dec 2011 15:51:05 +1000 Subject: Use true and false in preference to TRUE and FALSE in tests. Use the C++ boolean constants true and false instead of the C macros TRUE and FALSE (which are actually integers), and use QVERIFY instead of QCOMPARE for verifying simple boolean expressions. Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932 Reviewed-by: Rohan McGovern --- tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp | 18 +++++++++--------- .../widgets/dialogs/qfontdialog/tst_qfontdialog.cpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/auto/widgets/dialogs') diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index 0ebe27f053..ea28234e0c 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -170,10 +170,10 @@ void tst_QDialog::showExtension_data() QTest::addColumn("result"); //next we fill it with data - QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << (bool)FALSE << QSize(100,150); - QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << (bool)FALSE << QSize(120,150); - QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << (bool)TRUE << QSize(150,100); - QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << (bool)TRUE << QSize(150,120); + QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << false << QSize(100,150); + QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << false << QSize(120,150); + QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << true << QSize(150,100); + QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << true << QSize(150,120); } void tst_QDialog::showExtension() @@ -193,7 +193,7 @@ void tst_QDialog::showExtension() QPoint oldPosition = testWidget->pos(); // show - ((DummyDialog*)testWidget)->showExtension( TRUE ); + ((DummyDialog*)testWidget)->showExtension( true ); // while ( testWidget->size() == dlgSize ) // qApp->processEvents(); @@ -202,7 +202,7 @@ void tst_QDialog::showExtension() QCOMPARE(testWidget->pos(), oldPosition); // hide extension. back to old size ? - ((DummyDialog*)testWidget)->showExtension( FALSE ); + ((DummyDialog*)testWidget)->showExtension( false ); QCOMPARE( testWidget->size(), dlgSize ); testWidget->setExtension( 0 ); @@ -214,14 +214,14 @@ void tst_QDialog::defaultButtons() QPushButton *push = new QPushButton("Button 1", testWidget); QPushButton *pushTwo = new QPushButton("Button 2", testWidget); QPushButton *pushThree = new QPushButton("Button 3", testWidget); - pushThree->setAutoDefault(FALSE); + pushThree->setAutoDefault(false); //we need to show the buttons. Otherwise they won't get the focus push->show(); pushTwo->show(); pushThree->show(); - push->setDefault(TRUE); + push->setDefault(true); QVERIFY(push->isDefault()); pushTwo->setFocus(); @@ -231,7 +231,7 @@ void tst_QDialog::defaultButtons() lineEdit->setFocus(); QVERIFY(push->isDefault()); - pushTwo->setDefault(TRUE); + pushTwo->setDefault(true); QVERIFY(pushTwo->isDefault()); pushTwo->setFocus(); diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp index 855cc14095..f3efbc181f 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp @@ -119,10 +119,10 @@ void tst_QFontDialog::postKeyReturn() { void tst_QFontDialog::defaultOkButton() { - bool ok = FALSE; + bool ok = false; QTimer::singleShot(2000, this, SLOT(postKeyReturn())); QFontDialog::getFont(&ok); - QVERIFY(ok == TRUE); + QVERIFY(ok); } @@ -132,7 +132,7 @@ void tst_QFontDialog::setFont() while the font dialog was open. Task #27662 */ - bool ok = FALSE; + bool ok = false; #if defined Q_OS_HPUX QString fontName = "Courier"; int fontSize = 25; -- cgit v1.2.3