summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
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
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')
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp18
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp6
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp36
-rw-r--r--tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp42
-rw-r--r--tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp34
-rw-r--r--tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp42
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp4
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp42
-rw-r--r--tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp10
-rw-r--r--tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp2
11 files changed, 119 insertions, 119 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;
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index bca6c2b9ea..a3e48fe53a 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -726,7 +726,7 @@ void BezierViewer::paintEvent( QPaintEvent* )
/* Write number of vertices */
painter.setPen( Qt::red );
- painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, TRUE ) );
+ painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, true ) );
QString caption;
caption.setNum( bezier.size() );
caption += QString::fromLatin1( " vertices" );
@@ -759,24 +759,24 @@ void tst_QWidget::fontPropagation()
childWidget->show();
QCOMPARE( font, childWidget->font() );
- font.setBold( TRUE );
+ font.setBold( true );
testWidget->setFont( font );
QCOMPARE( font, testWidget->font() );
QCOMPARE( font, childWidget->font() );
QFont newFont = font;
- newFont.setItalic( TRUE );
+ newFont.setItalic( true );
childWidget->setFont( newFont );
QWidget* grandChildWidget = new QWidget( childWidget );
QCOMPARE( font, testWidget->font() );
QCOMPARE( newFont, grandChildWidget->font() );
- font.setUnderline( TRUE );
+ font.setUnderline( true );
testWidget->setFont( font );
// the child and grand child should now have merged bold and
// underline
- newFont.setUnderline( TRUE );
+ newFont.setUnderline( true );
QCOMPARE( newFont, childWidget->font() );
QCOMPARE( newFont, grandChildWidget->font() );
@@ -1074,32 +1074,32 @@ void tst_QWidget::enabledPropagation()
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
- testWidget->setDisabled( FALSE );
+ testWidget->setDisabled( false );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QWidget* grandChildWidget = new QWidget( childWidget );
QVERIFY( grandChildWidget->isEnabled() );
- testWidget->setDisabled( TRUE );
+ testWidget->setDisabled( true );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( FALSE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( false );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( TRUE );
- testWidget->setEnabled( FALSE );
- childWidget->setDisabled( TRUE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( true );
+ testWidget->setEnabled( false );
+ childWidget->setDisabled( true );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
@@ -1162,7 +1162,7 @@ void tst_QWidget::isEnabledTo()
QVERIFY( childWidget->isEnabledTo( testWidget ) );
QVERIFY( grandChildWidget->isEnabledTo( testWidget ) );
- childWidget->setEnabled( FALSE );
+ childWidget->setEnabled( false );
QVERIFY( !childWidget->isEnabledTo( testWidget ) );
QVERIFY( grandChildWidget->isEnabledTo( childWidget ) );
QVERIFY( !grandChildWidget->isEnabledTo( testWidget ) );
@@ -1245,7 +1245,7 @@ void tst_QWidget::visible_setWindowOpacity()
QVERIFY( !testWidget->isVisible() );
testWidget->setWindowOpacity(0.5);
#ifdef Q_OS_WIN
- QVERIFY(::IsWindowVisible(winHandleOf(testWidget)) == FALSE);
+ QVERIFY(!::IsWindowVisible(winHandleOf(testWidget)));
#endif
testWidget->setWindowOpacity(1.0);
}
@@ -1638,12 +1638,12 @@ public:
void tab()
{
- focusNextPrevChild(TRUE);
+ focusNextPrevChild(true);
}
void backTab()
{
- focusNextPrevChild(FALSE);
+ focusNextPrevChild(false);
}
};
diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
index 5d4c346adb..4d689bbed0 100644
--- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
+++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
@@ -182,9 +182,9 @@ void tst_QAbstractButton::cleanupTestCase()
void tst_QAbstractButton::init()
{
testWidget->setText("Test");
- testWidget->setEnabled( TRUE );
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setEnabled( true );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QKeySequence seq;
testWidget->setShortcut( seq );
@@ -257,16 +257,16 @@ void tst_QAbstractButton::setAutoRepeat()
break;
case 1:
// check if we can toggle the mode
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setAutoRepeat( true );
QVERIFY( testWidget->autoRepeat() );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setAutoRepeat( false );
QVERIFY( !testWidget->autoRepeat() );
break;
case 2:
// check that the button is down if we press space and not in autorepeat
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait( REPEAT_DELAY );
@@ -295,9 +295,9 @@ void tst_QAbstractButton::setAutoRepeat()
QVERIFY(click_count > 1);
break;
case 4:
- // check that pressing ENTER has no effect when autorepeat is FALSE
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ // check that pressing ENTER has no effect when autorepeat is false
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( REPEAT_DELAY );
@@ -312,9 +312,9 @@ void tst_QAbstractButton::setAutoRepeat()
QVERIFY( click_count == 0 );
break;
case 5:
- // check that pressing ENTER has no effect when autorepeat is TRUE
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ // check that pressing ENTER has no effect when autorepeat is true
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( REPEAT_DELAY );
@@ -427,11 +427,11 @@ void tst_QAbstractButton::setIcon()
void tst_QAbstractButton::setEnabled()
{
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
// QTEST( testWidget, "disabled" );
- testWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
// QTEST( testWidget, "enabled" );
}
@@ -443,14 +443,14 @@ void tst_QAbstractButton::isCheckable()
void tst_QAbstractButton::setDown()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QTest::qWait(300);
QVERIFY( testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
// add some debugging stuff
QWidget *grab = QWidget::keyboardGrabber();
@@ -466,13 +466,13 @@ void tst_QAbstractButton::setDown()
void tst_QAbstractButton::isChecked()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
testWidget->toggle();
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
diff --git a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
index 404f3f30b9..ec52abed57 100644
--- a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
+++ b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
@@ -121,9 +121,9 @@ void tst_QCheckBox::cleanupTestCase()
void tst_QCheckBox::init()
{
- testWidget->setTristate( FALSE );
- testWidget->setChecked( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setTristate( false );
+ testWidget->setChecked( false );
+ testWidget->setAutoRepeat( false );
}
void tst_QCheckBox::cleanup()
@@ -158,17 +158,17 @@ void tst_QCheckBox::onToggled( bool /*on*/ )
void tst_QCheckBox::setChecked()
{
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
QVERIFY( testWidget->isChecked() );
QVERIFY( testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Checked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QVERIFY( !testWidget->isChecked() );
QVERIFY( !testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QTest::keyClick( testWidget, ' ' );
QVERIFY( testWidget->isChecked() );
@@ -178,34 +178,34 @@ void tst_QCheckBox::setChecked()
void tst_QCheckBox::setTriState()
{
- testWidget->setTristate( TRUE );
+ testWidget->setTristate( true );
QVERIFY( testWidget->isTristate() );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
testWidget->setCheckState(Qt::PartiallyChecked);
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
QVERIFY( testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Checked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QVERIFY( !testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
testWidget->setCheckState(Qt::PartiallyChecked);
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
- testWidget->setTristate( FALSE );
+ testWidget->setTristate( false );
QVERIFY( !testWidget->isTristate() );
testWidget->setCheckState(Qt::PartiallyChecked);
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
QVERIFY( testWidget->checkState() == Qt::Checked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
}
@@ -237,10 +237,10 @@ void tst_QCheckBox::setText()
void tst_QCheckBox::setDown()
{
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
}
@@ -272,7 +272,7 @@ void tst_QCheckBox::pressed()
connect(testWidget, SIGNAL(released()), this, SLOT(onReleased()));
press_count = 0;
release_count = 0;
- testWidget->setDown(FALSE);
+ testWidget->setDown(false);
QVERIFY( !testWidget->isChecked() );
QTest::keyPress( testWidget, Qt::Key_Space );
@@ -315,12 +315,12 @@ void tst_QCheckBox::stateChanged()
QSignalSpy stateChangedSpy(testWidget, SIGNAL(stateChanged(int)));
connect(testWidget, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
cur_state = -1;
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
qApp->processEvents();
QCOMPARE( cur_state, (int)2 );
cur_state = -1;
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
qApp->processEvents();
QCOMPARE( cur_state, (int)0 );
diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
index 7d550bcf9c..2c583cf6d8 100644
--- a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
+++ b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
@@ -154,11 +154,11 @@ void tst_QCommandLinkButton::cleanupTestCase()
void tst_QCommandLinkButton::init()
{
- testWidget->setAutoRepeat( FALSE );
- testWidget->setDown( FALSE );
+ testWidget->setAutoRepeat( false );
+ testWidget->setDown( false );
testWidget->setText("Test");
testWidget->setDescription("Description text.");
- testWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
QKeySequence seq;
testWidget->setShortcut( seq );
@@ -215,17 +215,17 @@ void tst_QCommandLinkButton::setAutoRepeat()
QVERIFY( !tmp.autoRepeat() );
// check if we can toggle the mode
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setAutoRepeat( true );
QVERIFY( testWidget->autoRepeat() );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setAutoRepeat( false );
QVERIFY( !testWidget->autoRepeat() );
resetCounters();
// check that the button is down if we press space and not in autorepeat
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait( 300 );
@@ -242,8 +242,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
// check that the button is down if we press space while in autorepeat
// we can't actually confirm how many times it is fired, more than 1 is enough.
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait(900);
QVERIFY( testWidget->isDown() );
@@ -257,8 +257,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
@@ -272,8 +272,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyClick( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
QVERIFY( !testWidget->isDown() );
@@ -318,26 +318,26 @@ void tst_QCommandLinkButton::isCheckable()
void tst_QCommandLinkButton::setDown()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QTest::keyClick( testWidget, Qt::Key_Escape );
QVERIFY( !testWidget->isDown() );
}
void tst_QCommandLinkButton::isChecked()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
testWidget->toggle();
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
@@ -346,7 +346,7 @@ void tst_QCommandLinkButton::toggle()
{
// the pushbutton shouldn't toggle the button.
testWidget->toggle();
- QVERIFY( testWidget->isChecked() == FALSE );
+ QVERIFY(!testWidget->isChecked());
}
void tst_QCommandLinkButton::toggled()
@@ -432,7 +432,7 @@ void tst_QCommandLinkButton::clicked()
press_count = 0;
release_count = 0;
- testWidget->setDown(FALSE);
+ testWidget->setDown(false);
for (uint i=0; i<10; i++)
QTest::mouseClick( testWidget, Qt::LeftButton );
QCOMPARE( press_count, (uint)10 );
diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
index 18da7fdf5f..b70a8a67e1 100644
--- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
+++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
@@ -181,7 +181,7 @@ void tst_QLabel::init()
testWidget->setBuddy( 0 );
testWidget->setIndent( 0 );
testWidget->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
- testWidget->setScaledContents( FALSE );
+ testWidget->setScaledContents( false );
}
void tst_QLabel::cleanup()
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index ad7071f651..5dd783537a 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -722,7 +722,7 @@ void tst_QMenuBar::check_homeKey()
{
// I'm temporarily shutting up this testcase.
// Seems like the behaviour i'm expecting isn't ok.
- QVERIFY( TRUE );
+ QVERIFY( true );
return;
QEXPECT_FAIL( "0", "Popupmenu should respond to a Home key", Abort );
@@ -760,7 +760,7 @@ void tst_QMenuBar::check_endKey()
{
// I'm temporarily silenting this testcase.
// Seems like the behaviour i'm expecting isn't ok.
- QVERIFY( TRUE );
+ QVERIFY( true );
return;
QEXPECT_FAIL( "0", "Popupmenu should respond to an End key", Abort );
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 3a0a320831..496b3774a1 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -152,10 +152,10 @@ void tst_QPushButton::cleanupTestCase()
void tst_QPushButton::init()
{
- testWidget->setAutoRepeat( FALSE );
- testWidget->setDown( FALSE );
+ testWidget->setAutoRepeat( false );
+ testWidget->setDown( false );
testWidget->setText("Test");
- testWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
QKeySequence seq;
testWidget->setShortcut( seq );
@@ -206,17 +206,17 @@ void tst_QPushButton::autoRepeat()
QVERIFY( !tmp.autoRepeat() );
// check if we can toggle the mode
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setAutoRepeat( true );
QVERIFY( testWidget->autoRepeat() );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setAutoRepeat( false );
QVERIFY( !testWidget->autoRepeat() );
resetCounters();
// check that the button is down if we press space and not in autorepeat
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait( 300 );
@@ -233,8 +233,8 @@ void tst_QPushButton::autoRepeat()
// check that the button is down if we press space while in autorepeat
// we can't actually confirm how many times it is fired, more than 1 is enough.
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait(900);
QVERIFY( testWidget->isDown() );
@@ -248,8 +248,8 @@ void tst_QPushButton::autoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
@@ -263,8 +263,8 @@ void tst_QPushButton::autoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyClick( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
QVERIFY( !testWidget->isDown() );
@@ -307,26 +307,26 @@ void tst_QPushButton::isCheckable()
void tst_QPushButton::setDown()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QTest::keyClick( testWidget, Qt::Key_Escape );
QVERIFY( !testWidget->isDown() );
}
void tst_QPushButton::isChecked()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
testWidget->toggle();
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
@@ -335,7 +335,7 @@ void tst_QPushButton::toggle()
{
// the pushbutton shouldn't toggle the button.
testWidget->toggle();
- QVERIFY( testWidget->isChecked() == FALSE );
+ QVERIFY( testWidget->isChecked() == false );
}
void tst_QPushButton::toggled()
@@ -421,7 +421,7 @@ void tst_QPushButton::clicked()
press_count = 0;
release_count = 0;
- testWidget->setDown(FALSE);
+ testWidget->setDown(false);
for (uint i=0; i<10; i++)
QTest::mouseClick( testWidget, Qt::LeftButton );
QCOMPARE( press_count, (uint)10 );
diff --git a/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp b/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp
index ca3fb34632..6d0af0779d 100644
--- a/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp
+++ b/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp
@@ -273,23 +273,23 @@ void tst_QToolBox::change()
QCOMPARE( currentIndex, 1 );
QCOMPARE( testWidget->currentIndex(), 1 );
- testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
+ testWidget->setItemEnabled( testWidget->currentIndex(), false );
QCOMPARE( currentIndex, 2 );
QCOMPARE( testWidget->currentIndex(), 2 );
currentIndex = -1;
- testWidget->setItemEnabled( testWidget->indexOf(lastItem), FALSE );
+ testWidget->setItemEnabled( testWidget->indexOf(lastItem), false );
QCOMPARE( currentIndex, -1 );
QCOMPARE( testWidget->currentIndex(), 2 );
- testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
+ testWidget->setItemEnabled( testWidget->currentIndex(), false );
QCOMPARE( currentIndex, 0 );
currentIndex = -1;
- testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
+ testWidget->setItemEnabled( testWidget->currentIndex(), false );
QCOMPARE( currentIndex, -1 );
- testWidget->setItemEnabled( 1, TRUE );
+ testWidget->setItemEnabled( 1, true );
}
void tst_QToolBox::clear()
diff --git a/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp b/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp
index 28ffb4280f..133f3cef79 100644
--- a/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp
+++ b/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp
@@ -303,7 +303,7 @@ void tst_QWorkspace::windowActivatedWithMinimize()
void tst_QWorkspace::accelActivated()
{
- accelPressed = TRUE;
+ accelPressed = true;
}
void tst_QWorkspace::showWindows()