summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qcommandlinkbutton
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/widgets/qcommandlinkbutton
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/widgets/qcommandlinkbutton')
-rw-r--r--tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp42
1 files changed, 21 insertions, 21 deletions
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 );