summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-12-30 15:51:05 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-03 02:57:12 +0100
commitfda36df6babf20bcfd04a54a1336a9c26e72a8ef (patch)
tree0c09018e6db15ea40e156b38854e224e62e9130f /tests/auto/widgets/dialogs
parent39f3ee8a5dd499cf86f95e7fc9200eb3226b16be (diff)
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 <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp18
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp6
2 files changed, 12 insertions, 12 deletions
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<QSize>("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;