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 --- .../corelib/io/qdatastream/tst_qdatastream.cpp | 74 +++++----- tests/auto/corelib/io/qfile/tst_qfile.cpp | 24 ++-- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 2 +- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 156 ++++++++++----------- .../thread/qwaitcondition/tst_qwaitcondition.cpp | 16 +-- .../gui/kernel/qmouseevent/tst_qmouseevent.cpp | 8 +- tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp | 2 - tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 2 +- .../painting/qpainter/utils/createImages/main.cpp | 4 +- tests/auto/gui/painting/qpen/tst_qpen.cpp | 12 +- tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp | 2 +- tests/auto/gui/painting/qprinter/tst_qprinter.cpp | 24 ++-- tests/auto/network/access/qftp/tst_qftp.cpp | 36 ++--- .../kernel/qhostaddress/tst_qhostaddress.cpp | 118 ++++++++-------- .../other/exceptionsafety_objects/oomsimulator.h | 6 +- .../other/qaccessibility/tst_qaccessibility.cpp | 2 +- tests/auto/other/qfocusevent/tst_qfocusevent.cpp | 20 +-- tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp | 18 +-- .../dialogs/qfontdialog/tst_qfontdialog.cpp | 6 +- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 36 ++--- .../qabstractbutton/tst_qabstractbutton.cpp | 42 +++--- .../widgets/widgets/qcheckbox/tst_qcheckbox.cpp | 34 ++--- .../qcommandlinkbutton/tst_qcommandlinkbutton.cpp | 42 +++--- tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp | 2 +- .../auto/widgets/widgets/qmenubar/tst_qmenubar.cpp | 4 +- .../widgets/qpushbutton/tst_qpushbutton.cpp | 42 +++--- .../auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp | 10 +- .../widgets/widgets/qworkspace/tst_qworkspace.cpp | 2 +- tests/auto/xml/dom/qdom/tst_qdom.cpp | 64 ++++----- .../xml/sax/qxmlsimplereader/parser/parser.cpp | 52 +++---- 30 files changed, 430 insertions(+), 432 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 9e7e93255d..6e91780ecc 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -873,7 +873,7 @@ static void QBitArrayData(QBitArray *b, int index) for (int i = 0; i < filler.length(); ++i) { if (filler.at(i) == '1') - b->setBit(i, TRUE); + b->setBit(i, true); } } @@ -1313,83 +1313,83 @@ void tst_QDataStream::readQDateTime(QDataStream *s) static QFont qFontData(int index) { switch (index) { - case 0: return QFont("Courier", 20, QFont::Bold, TRUE); - case 1: return QFont("Courier", 18, QFont::Bold, FALSE); - case 2: return QFont("Courier", 16, QFont::Light, TRUE); - case 3: return QFont("Courier", 14, QFont::Normal, FALSE); - case 4: return QFont("Courier", 12, QFont::DemiBold, TRUE); - case 5: return QFont("Courier", 10, QFont::Black, FALSE); + case 0: return QFont("Courier", 20, QFont::Bold, true); + case 1: return QFont("Courier", 18, QFont::Bold, false); + case 2: return QFont("Courier", 16, QFont::Light, true); + case 3: return QFont("Courier", 14, QFont::Normal, false); + case 4: return QFont("Courier", 12, QFont::DemiBold, true); + case 5: return QFont("Courier", 10, QFont::Black, false); case 6: { - QFont f("Helvetica", 10, QFont::Normal, FALSE); + QFont f("Helvetica", 10, QFont::Normal, false); f.setPixelSize(2); - f.setUnderline(FALSE); - f.setStrikeOut(FALSE); - f.setFixedPitch(FALSE); + f.setUnderline(false); + f.setStrikeOut(false); + f.setFixedPitch(false); return f; } case 7: { - QFont f("Helvetica", 10, QFont::Bold, FALSE); + QFont f("Helvetica", 10, QFont::Bold, false); f.setPixelSize(4); - f.setUnderline(TRUE); - f.setStrikeOut(FALSE); - f.setFixedPitch(FALSE); + f.setUnderline(true); + f.setStrikeOut(false); + f.setFixedPitch(false); return f; } case 8: { - QFont f("Helvetica", 10, QFont::Light, FALSE); + QFont f("Helvetica", 10, QFont::Light, false); f.setPixelSize(6); - f.setUnderline(FALSE); - f.setStrikeOut(TRUE); - f.setFixedPitch(FALSE); + f.setUnderline(false); + f.setStrikeOut(true); + f.setFixedPitch(false); return f; } case 9: { - QFont f("Helvetica", 10, QFont::DemiBold, FALSE); + QFont f("Helvetica", 10, QFont::DemiBold, false); f.setPixelSize(8); - f.setUnderline(FALSE); - f.setStrikeOut(FALSE); - f.setFixedPitch(TRUE); + f.setUnderline(false); + f.setStrikeOut(false); + f.setFixedPitch(true); return f; } case 10: { - QFont f("Helvetica", 10, QFont::Black, FALSE); + QFont f("Helvetica", 10, QFont::Black, false); f.setPixelSize(10); - f.setUnderline(TRUE); - f.setStrikeOut(TRUE); - f.setFixedPitch(FALSE); + f.setUnderline(true); + f.setStrikeOut(true); + f.setFixedPitch(false); return f; } case 11: { - QFont f("Helvetica", 10, QFont::Normal, TRUE); + QFont f("Helvetica", 10, QFont::Normal, true); f.setPixelSize(12); - f.setUnderline(FALSE); - f.setStrikeOut(TRUE); - f.setFixedPitch(TRUE); + f.setUnderline(false); + f.setStrikeOut(true); + f.setFixedPitch(true); return f; } case 12: { - QFont f("Helvetica", 10, QFont::Bold, TRUE); + QFont f("Helvetica", 10, QFont::Bold, true); f.setPixelSize(14); - f.setUnderline(TRUE); - f.setStrikeOut(TRUE); - f.setFixedPitch(TRUE); + f.setUnderline(true); + f.setStrikeOut(true); + f.setFixedPitch(true); return f; } case 13: { - QFont f("Helvetica", 10, QFont::Bold, TRUE); + QFont f("Helvetica", 10, QFont::Bold, true); f.setStretch(200); return f; } } - return QFont("Courier", 18, QFont::Bold, TRUE); + return QFont("Courier", 18, QFont::Bold, true); } #define MAX_QFONT_DATA 14 diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index cae97f80c4..ccdbc85293 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -404,7 +404,7 @@ void tst_QFile::cleanupTestCase() void tst_QFile::exists() { QFile f( QFINDTESTDATA("testfile.txt") ); - QCOMPARE( f.exists(), (bool)TRUE ); + QVERIFY(f.exists()); QFile file("nobodyhassuchafile"); file.remove(); @@ -443,41 +443,41 @@ void tst_QFile::open_data() #endif QTest::newRow( "exist_readOnly" ) << QString(QFINDTESTDATA("testfile.txt")) << int(QIODevice::ReadOnly) - << (bool)TRUE << QFile::NoError; + << true << QFile::NoError; QTest::newRow( "exist_writeOnly" ) << QString("readonlyfile") << int(QIODevice::WriteOnly) - << (bool)FALSE + << false << QFile::OpenError; QTest::newRow( "exist_append" ) << QString("readonlyfile") << int(QIODevice::Append) - << (bool)FALSE << QFile::OpenError; + << false << QFile::OpenError; QTest::newRow( "nonexist_readOnly" ) << QString("nonExist.txt") << int(QIODevice::ReadOnly) - << (bool)FALSE << QFile::OpenError; + << false << QFile::OpenError; QTest::newRow("emptyfile") << QString("") << int(QIODevice::ReadOnly) - << (bool)FALSE + << false << QFile::OpenError; - QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << (bool)FALSE + QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << false << QFile::OpenError; - QTest::newRow("two-dots") << QString(QFINDTESTDATA("two.dots.file")) << int(QIODevice::ReadOnly) << (bool)TRUE + QTest::newRow("two-dots") << QString(QFINDTESTDATA("two.dots.file")) << int(QIODevice::ReadOnly) << true << QFile::NoError; QTest::newRow("readonlyfile") << QString("readonlyfile") << int(QIODevice::WriteOnly) - << (bool)FALSE << QFile::OpenError; + << false << QFile::OpenError; QTest::newRow("noreadfile") << QString("noreadfile") << int(QIODevice::ReadOnly) - << (bool)FALSE << QFile::OpenError; + << false << QFile::OpenError; #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly) - << (bool)TRUE << QFile::NoError; + << true << QFile::NoError; QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QIODevice::ReadOnly) << true << QFile::NoError; #endif @@ -694,7 +694,7 @@ void tst_QFile::atEnd() bool end = f.atEnd(); f.close(); - QCOMPARE( end, (bool)TRUE ); + QVERIFY(end); } void tst_QFile::readLine() diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 58e0b4f5b4..ac2345d002 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -3158,7 +3158,7 @@ void tst_QSettings::consistentRegistryStorage() // Not tested at the moment. void tst_QSettings::oldSubkeyList() { - QVERIFY( TRUE ); + QVERIFY( true ); } */ diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 2c99d1b556..7d54409c23 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -260,10 +260,10 @@ void tst_QObject::disconnect() s->emitSignal3(); s->emitSignal4(); - QCOMPARE( r1->called(1), TRUE ); - QCOMPARE( r1->called(2), TRUE ); - QCOMPARE( r1->called(3), TRUE ); - QCOMPARE( r1->called(4), TRUE ); + QVERIFY(r1->called(1)); + QVERIFY(r1->called(2)); + QVERIFY(r1->called(3)); + QVERIFY(r1->called(4)); r1->reset(); // usual disconnect with all parameters given @@ -271,12 +271,12 @@ void tst_QObject::disconnect() s->emitSignal1(); - QCOMPARE( r1->called(1), FALSE ); + QVERIFY(!r1->called(1)); r1->reset(); - QCOMPARE( ret, TRUE ); + QVERIFY(ret); ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) ); - QCOMPARE( ret, FALSE ); + QVERIFY(!ret); // disconnect all signals from s from all slots from r1 QObject::disconnect( s, 0, r1, 0 ); @@ -285,9 +285,9 @@ void tst_QObject::disconnect() s->emitSignal3(); s->emitSignal4(); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r1->called(3), FALSE ); - QCOMPARE( r1->called(4), FALSE ); + QVERIFY(!r1->called(2)); + QVERIFY(!r1->called(3)); + QVERIFY(!r1->called(4)); r1->reset(); connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) ); @@ -301,10 +301,10 @@ void tst_QObject::disconnect() s->emitSignal1(); s->emitSignal2(); - QCOMPARE( r1->called(1), FALSE ); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r1->called(3), FALSE ); - QCOMPARE( r1->called(4), TRUE ); + QVERIFY(!r1->called(1)); + QVERIFY(!r1->called(2)); + QVERIFY(!r1->called(3)); + QVERIFY(r1->called(4)); r1->reset(); // make sure all is disconnected again QObject::disconnect( s, 0, r1, 0 ); @@ -322,12 +322,12 @@ void tst_QObject::disconnect() s->emitSignal2(); s->emitSignal3(); - QCOMPARE( r1->called(1), FALSE ); - QCOMPARE( r2->called(1), FALSE ); - QCOMPARE( r1->called(2), TRUE ); - QCOMPARE( r2->called(2), TRUE ); - QCOMPARE( r1->called(2), TRUE ); - QCOMPARE( r2->called(2), TRUE ); + QVERIFY(!r1->called(1)); + QVERIFY(!r2->called(1)); + QVERIFY(r1->called(2)); + QVERIFY(r2->called(2)); + QVERIFY(r1->called(2)); + QVERIFY(r2->called(2)); r1->reset(); r2->reset(); @@ -335,10 +335,10 @@ void tst_QObject::disconnect() // disconnect all signals of s from all receivers QObject::disconnect( s, 0, 0, 0 ); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r2->called(2), FALSE ); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r2->called(2), FALSE ); + QVERIFY(!r1->called(2)); + QVERIFY(!r2->called(2)); + QVERIFY(!r1->called(2)); + QVERIFY(!r2->called(2)); delete r2; delete r1; @@ -979,14 +979,14 @@ void tst_QObject::emitInDefinedOrder() SequenceObject::sequence = sequence = 0; sender2->emitSignal1(); - QCOMPARE(seq1.called(1), TRUE); - QCOMPARE(seq2.called(1), TRUE); - QCOMPARE(seq3->called(1), FALSE); - QCOMPARE(seq4.called(1), TRUE); - QCOMPARE(seq1.called(2), TRUE); - QCOMPARE(seq2.called(2), TRUE); - QCOMPARE(seq3->called(2), FALSE); - QCOMPARE(seq4.called(2), TRUE); + QVERIFY(seq1.called(1)); + QVERIFY(seq2.called(1)); + QVERIFY(!seq3->called(1)); + QVERIFY(seq4.called(1)); + QVERIFY(seq1.called(2)); + QVERIFY(seq2.called(2)); + QVERIFY(!seq3->called(2)); + QVERIFY(seq4.called(2)); QCOMPARE(seq1.sequence_slot1, ++sequence); QCOMPARE(seq2.sequence_slot1, ++sequence); QCOMPARE(seq4.sequence_slot1, ++sequence); @@ -1015,14 +1015,14 @@ void tst_QObject::emitInDefinedOrder() SequenceObject::sequence = sequence = 0; sender2->emitSignal1(); - QCOMPARE(seq1.called(2), TRUE); - QCOMPARE(seq2.called(2), TRUE); - QCOMPARE(seq3->called(2), FALSE); - QCOMPARE(seq4.called(2), TRUE); - QCOMPARE(seq1.called(1), TRUE); - QCOMPARE(seq2.called(1), TRUE); - QCOMPARE(seq3->called(1), FALSE); - QCOMPARE(seq4.called(1), TRUE); + QVERIFY(seq1.called(2)); + QVERIFY(seq2.called(2)); + QVERIFY(!seq3->called(2)); + QVERIFY(seq4.called(2)); + QVERIFY(seq1.called(1)); + QVERIFY(seq2.called(1)); + QVERIFY(!seq3->called(1)); + QVERIFY(seq4.called(1)); QCOMPARE(seq1.sequence_slot2, ++sequence); QCOMPARE(seq2.sequence_slot2, ++sequence); QCOMPARE(seq4.sequence_slot2, ++sequence); @@ -1051,14 +1051,14 @@ void tst_QObject::emitInDefinedOrder() SequenceObject::sequence = sequence = 0; sender2->emitSignal1(); - QCOMPARE(seq1.called(1), TRUE); - QCOMPARE(seq2.called(1), TRUE); - QCOMPARE(seq3->called(1), FALSE); - QCOMPARE(seq4.called(1), TRUE); - QCOMPARE(seq1.called(2), TRUE); - QCOMPARE(seq2.called(2), TRUE); - QCOMPARE(seq3->called(2), FALSE); - QCOMPARE(seq4.called(2), TRUE); + QVERIFY(seq1.called(1)); + QVERIFY(seq2.called(1)); + QVERIFY(!seq3->called(1)); + QVERIFY(seq4.called(1)); + QVERIFY(seq1.called(2)); + QVERIFY(seq2.called(2)); + QVERIFY(!seq3->called(2)); + QVERIFY(seq4.called(2)); QCOMPARE(seq1.sequence_slot1, ++sequence); QCOMPARE(seq2.sequence_slot1, ++sequence); QCOMPARE(seq4.sequence_slot1, ++sequence); @@ -1092,12 +1092,12 @@ void tst_QObject::emitInDefinedOrder() sender2->emitSignal1(); QCOMPARE(static_cast(psender), static_cast(0)); QCOMPARE(static_cast(pseq3), static_cast(0)); - QCOMPARE(seq1.called(1), TRUE); - QCOMPARE(seq2.called(1), TRUE); - QCOMPARE(seq4.called(1), TRUE); - QCOMPARE(seq1.called(2), TRUE); - QCOMPARE(seq2.called(2), TRUE); - QCOMPARE(seq4.called(2), FALSE); + QVERIFY(seq1.called(1)); + QVERIFY(seq2.called(1)); + QVERIFY(seq4.called(1)); + QVERIFY(seq1.called(2)); + QVERIFY(seq2.called(2)); + QVERIFY(!seq4.called(2)); QCOMPARE(seq1.sequence_slot1, ++sequence); QCOMPARE(seq2.sequence_slot1, ++sequence); QCOMPARE(seq4.sequence_slot1, ++sequence); @@ -4209,10 +4209,10 @@ void tst_QObject::pointerDisconnect() s->emitSignal3(); s->emitSignal4(); - QCOMPARE( r1->called(1), TRUE ); - QCOMPARE( r1->called(2), TRUE ); - QCOMPARE( r1->called(3), TRUE ); - QCOMPARE( r1->called(4), TRUE ); + QVERIFY(r1->called(1)); + QVERIFY(r1->called(2)); + QVERIFY(r1->called(3)); + QVERIFY(r1->called(4)); r1->reset(); // usual disconnect with all parameters given @@ -4220,12 +4220,12 @@ void tst_QObject::pointerDisconnect() s->emitSignal1(); - QCOMPARE( r1->called(1), FALSE ); + QVERIFY(!r1->called(1)); r1->reset(); - QCOMPARE( ret, TRUE ); + QVERIFY(ret); ret = QObject::disconnect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); - QCOMPARE( ret, FALSE ); + QVERIFY(!ret); // disconnect all signals from s from all slots from r1 QObject::disconnect( s, 0, r1, 0 ); @@ -4234,9 +4234,9 @@ void tst_QObject::pointerDisconnect() s->emitSignal3(); s->emitSignal4(); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r1->called(3), FALSE ); - QCOMPARE( r1->called(4), FALSE ); + QVERIFY(!r1->called(2)); + QVERIFY(!r1->called(3)); + QVERIFY(!r1->called(4)); r1->reset(); connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 ); @@ -4250,10 +4250,10 @@ void tst_QObject::pointerDisconnect() s->emitSignal1(); s->emitSignal2(); - QCOMPARE( r1->called(1), FALSE ); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r1->called(3), FALSE ); - QCOMPARE( r1->called(4), TRUE ); + QVERIFY(!r1->called(1)); + QVERIFY(!r1->called(2)); + QVERIFY(!r1->called(3)); + QVERIFY(r1->called(4)); r1->reset(); // make sure all is disconnected again QObject::disconnect( s, 0, r1, 0 ); @@ -4271,12 +4271,12 @@ void tst_QObject::pointerDisconnect() s->emitSignal2(); s->emitSignal3(); - QCOMPARE( r1->called(1), FALSE ); - QCOMPARE( r2->called(1), FALSE ); - QCOMPARE( r1->called(2), TRUE ); - QCOMPARE( r2->called(2), TRUE ); - QCOMPARE( r1->called(2), TRUE ); - QCOMPARE( r2->called(2), TRUE ); + QVERIFY(!r1->called(1)); + QVERIFY(!r2->called(1)); + QVERIFY(r1->called(2)); + QVERIFY(r2->called(2)); + QVERIFY(r1->called(2)); + QVERIFY(r2->called(2)); r1->reset(); r2->reset(); @@ -4284,10 +4284,10 @@ void tst_QObject::pointerDisconnect() // disconnect all signals of s from all receivers QObject::disconnect( s, 0, 0, 0 ); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r2->called(2), FALSE ); - QCOMPARE( r1->called(2), FALSE ); - QCOMPARE( r2->called(2), FALSE ); + QVERIFY(!r1->called(2)); + QVERIFY(!r2->called(2)); + QVERIFY(!r1->called(2)); + QVERIFY(!r2->called(2)); delete r2; delete r1; diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp index 4ffde9fcb8..4237b41e57 100644 --- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp @@ -443,7 +443,7 @@ void tst_QWaitCondition::wakeOne() for (x = 0; x < ThreadCount; ++x) { thread[x].mutex = &mutex; thread[x].cond = &cond; - thread_exited[x] = FALSE; + thread_exited[x] = false; thread[x].start(); // wait for thread to start QVERIFY(thread[x].started.wait(&mutex, 1000)); @@ -468,7 +468,7 @@ void tst_QWaitCondition::wakeOne() if (thread_exited[y]) continue; if (thread[y].wait(exited > 0 ? 10 : 1000)) { - thread_exited[y] = TRUE; + thread_exited[y] = true; ++exited; } } @@ -487,7 +487,7 @@ void tst_QWaitCondition::wakeOne() for (x = 0; x < ThreadCount; ++x) { rwthread[x].readWriteLock = &readWriteLock; rwthread[x].cond = &cond; - thread_exited[x] = FALSE; + thread_exited[x] = false; rwthread[x].start(); // wait for thread to start QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); @@ -512,7 +512,7 @@ void tst_QWaitCondition::wakeOne() if (thread_exited[y]) continue; if (rwthread[y].wait(exited > 0 ? 10 : 1000)) { - thread_exited[y] = TRUE; + thread_exited[y] = true; ++exited; } } @@ -537,7 +537,7 @@ void tst_QWaitCondition::wakeOne() for (x = 0; x < ThreadCount; ++x) { thread[x].mutex = &mutex; thread[x].cond = &cond; - thread_exited[x] = FALSE; + thread_exited[x] = false; thread[x].start(); // wait for thread to start QVERIFY(thread[x].started.wait(&mutex, 1000)); @@ -564,7 +564,7 @@ void tst_QWaitCondition::wakeOne() if (thread_exited[y]) continue; if (thread[y].wait(exited > 0 ? 10 : 1000)) { - thread_exited[y] = TRUE; + thread_exited[y] = true; ++exited; } } @@ -583,7 +583,7 @@ void tst_QWaitCondition::wakeOne() for (x = 0; x < ThreadCount; ++x) { rwthread[x].readWriteLock = &readWriteLock; rwthread[x].cond = &cond; - thread_exited[x] = FALSE; + thread_exited[x] = false; rwthread[x].start(); // wait for thread to start QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); @@ -610,7 +610,7 @@ void tst_QWaitCondition::wakeOne() if (thread_exited[y]) continue; if (rwthread[y].wait(exited > 0 ? 10 : 1000)) { - thread_exited[y] = TRUE; + thread_exited[y] = true; ++exited; } } diff --git a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp index 370338d24a..bbfaf4c408 100644 --- a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp +++ b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp @@ -72,7 +72,7 @@ protected: mousePressButton = e->button(); mousePressButtons = e->buttons(); mousePressModifiers = e->modifiers(); - mousePressEventRecieved = TRUE; + mousePressEventRecieved = true; e->accept(); } void mouseReleaseEvent(QMouseEvent *e) @@ -81,7 +81,7 @@ protected: mouseReleaseButton = e->button(); mouseReleaseButtons = e->buttons(); mouseReleaseModifiers = e->modifiers(); - mouseReleaseEventRecieved = TRUE; + mouseReleaseEventRecieved = true; e->accept(); } }; @@ -134,8 +134,8 @@ void tst_QMouseEvent::cleanupTestCase() void tst_QMouseEvent::init() { - testMouseWidget->mousePressEventRecieved = FALSE; - testMouseWidget->mouseReleaseEventRecieved = FALSE; + testMouseWidget->mousePressEventRecieved = false; + testMouseWidget->mouseReleaseEventRecieved = false; testMouseWidget->mousePressButton = 0; testMouseWidget->mousePressButtons = 0; testMouseWidget->mousePressModifiers = 0; diff --git a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp index d3a087eefc..af472c6c8e 100644 --- a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp @@ -1254,10 +1254,8 @@ void tst_QShortcut::testElement() if (action == ClearAll) { clearAllShortcuts(); - QCOMPARE(TRUE, TRUE); } else if (action == SetupAccel) { setupShortcut(testWidget, txt, k1, k2, k3, k4); - QCOMPARE(TRUE, TRUE); } else { sendKeyEvents(k1, c1, k2, c2, k3, c3, k4, c4); QCOMPARE(int(currentResult), result); diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index c868e9fa39..4faecad104 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -347,7 +347,7 @@ Q_DECLARE_METATYPE(QRegion) tst_QPainter::tst_QPainter() { // QtTestCase sets this to false, but this turns off alpha pixmaps on Unix. - QApplication::setDesktopSettingsAware(TRUE); + QApplication::setDesktopSettingsAware(true); } tst_QPainter::~tst_QPainter() diff --git a/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp b/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp index 418c385717..a5a948a8e1 100644 --- a/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp +++ b/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp @@ -127,7 +127,7 @@ static QBitmap createSrcBitmap( int size, int border ) painter.drawRect( border, border, size, size2 ); painter.end(); if ( border > 0 ) { - QBitmap mask( totalSize, totalSize, TRUE ); + QBitmap mask( totalSize, totalSize, true ); QPainter painter; painter.begin( &mask ); painter.setPen( QPen( Qt::color1, 1 ) ); @@ -171,7 +171,7 @@ int main( int argc, char **argv ) QBitmap src_tmp = createSrcBitmap( 32, 0 ).xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) ); src_tmp.resize( 32, 48 ); QBitmap src2 = src_tmp.xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) ); - QBitmap mask( 32, 48, TRUE ); + QBitmap mask( 32, 48, true ); { QPainter painter; painter.begin( &mask ); diff --git a/tests/auto/gui/painting/qpen/tst_qpen.cpp b/tests/auto/gui/painting/qpen/tst_qpen.cpp index eeb5aae96d..832e9c2daa 100644 --- a/tests/auto/gui/painting/qpen/tst_qpen.cpp +++ b/tests/auto/gui/painting/qpen/tst_qpen.cpp @@ -117,22 +117,22 @@ void tst_QPen::operator_eq_eq_data() QTest::newRow("differentColor") << QPen(Qt::red) << QPen(Qt::blue) - << bool(FALSE); + << false; QTest::newRow("differentWidth") << QPen(Qt::red, 2) << QPen(Qt::red, 3) - << bool(FALSE); + << false; QTest::newRow("differentPenStyle") << QPen(Qt::red, 2, Qt::DashLine) << QPen(Qt::red, 2, Qt::DotLine) - << bool(FALSE); + << false; QTest::newRow("differentCapStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) << QPen(Qt::red, 2, Qt::DashLine, Qt::SquareCap, Qt::BevelJoin) - << bool(FALSE); + << false; QTest::newRow("differentJoinStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin) - << bool(FALSE); + << false; QTest::newRow("same") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) - << bool(TRUE); + << true; } diff --git a/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp b/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp index 8d0bed6128..f69e058183 100644 --- a/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp +++ b/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp @@ -76,7 +76,7 @@ void tst_QPolygon::makeEllipse() int i; // make sure that all points are R+-1 away from the center - bool err = FALSE; + bool err = false; for (i = 1; i < pa.size(); i++) { QPoint p = pa.at( i ); double r = sqrt( pow( double(p.x() - R), 2.0 ) + pow( double(p.y() - R), 2.0 ) ); diff --git a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp index 4767048929..2bb3cbeeef 100644 --- a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp +++ b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp @@ -315,25 +315,25 @@ void tst_QPrinter::testSetOptions() QPrintDialog dlg(&prn); // Verify default values - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), TRUE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), FALSE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), true); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), false); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true); dlg.setEnabledOptions(QAbstractPrintDialog::PrintPageRange); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), FALSE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), false); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true); dlg.setEnabledOptions((QAbstractPrintDialog::PrintDialogOptions(QAbstractPrintDialog::PrintSelection | QAbstractPrintDialog::PrintPageRange))); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), TRUE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), true); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true); dlg.setEnabledOptions(QAbstractPrintDialog::PrintSelection); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), TRUE); - MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), FALSE); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), true); + MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), false); } void tst_QPrinter::testMargins_data() diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index 2e484d5bb5..904e23a756 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -278,7 +278,7 @@ void tst_QFtp::init() bytesAvailable_finished = 1234567890; bytesAvailable_done = 1234567890; - inFileDirExistsFunction = FALSE; + inFileDirExistsFunction = false; #if !defined(Q_OS_WINCE) srand(time(0)); @@ -435,12 +435,12 @@ void tst_QFtp::close_data() QTest::addColumn("password"); QTest::addColumn("login"); - QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << (bool)TRUE; - QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << (bool)TRUE; - QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << (bool)TRUE; - QTest::newRow( "login04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << (bool)TRUE; + QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << true; + QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << true; + QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << true; + QTest::newRow( "login04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << true; - QTest::newRow( "no-login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("") << QString("") << (bool)FALSE; + QTest::newRow( "no-login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("") << QString("") << false; } void tst_QFtp::close() @@ -1963,12 +1963,12 @@ bool tst_QFtp::fileExists( const QString &host, quint16 port, const QString &use // ### make these tests work if (ftp->currentId() != 0) { qWarning("ftp->currentId() != 0"); - return FALSE; + return false; } if (ftp->state() != QFtp::Unconnected) { qWarning("ftp->state() != QFtp::Unconnected"); - return FALSE; + return false; } addCommand( QFtp::ConnectToHost, ftp->connectToHost( host, port ) ); @@ -1978,39 +1978,39 @@ bool tst_QFtp::fileExists( const QString &host, quint16 port, const QString &use addCommand( QFtp::List, ftp->list( file ) ); addCommand( QFtp::Close, ftp->close() ); - inFileDirExistsFunction = TRUE; + inFileDirExistsFunction = true; QTestEventLoop::instance().enterLoop( 30 ); delete ftp; ftp = 0; if ( QTestEventLoop::instance().timeout() ) { // ### make this test work qWarning("tst_QFtp::fileExists: Network operation timed out"); - return FALSE; + return false; } - inFileDirExistsFunction = FALSE; + inFileDirExistsFunction = false; ResMapIt it = resultMap.find( QFtp::ConnectToHost ); // ### make these tests work if (it == resultMap.end()) { qWarning("it != resultMap.end()"); - return FALSE; + return false; } if (it.value().success == -1) { qWarning("it.value().success != -1"); - return FALSE; + return false; } if ( it.value().success == 1 ) { for ( uint i=0; i < (uint) listInfo_i.count(); i++ ) { if ( QFileInfo(listInfo_i[i].name()).fileName() == QFileInfo(file).fileName() ) - return TRUE; + return true; } } //this is not a good warning considering sometime this function is used to test that a file does not exist //qWarning("file doesn't exist"); - return FALSE; + return false; } bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user, const QString &password, const QString &cdDir, const QString &dirToCreate ) @@ -2029,7 +2029,7 @@ bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user addCommand( QFtp::Cd, ftp->cd( cdDir + "/" + dirToCreate ) ); addCommand( QFtp::Close, ftp->close() ); - inFileDirExistsFunction = TRUE; + inFileDirExistsFunction = true; QTestEventLoop::instance().enterLoop( 30 ); delete ftp; ftp = 0; @@ -2037,9 +2037,9 @@ bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user // ### make this test work // QFAIL( "Network operation timed out" ); qWarning("tst_QFtp::dirExists: Network operation timed out"); - return FALSE; + return false; } - inFileDirExistsFunction = FALSE; + inFileDirExistsFunction = false; ResMapIt it = resultMap.find( QFtp::Cd ); // ### make these tests work diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp index 8af3a37665..bf7a6a0f64 100644 --- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp +++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp @@ -157,67 +157,67 @@ void tst_QHostAddress::setAddress_QString_data() QTest::addColumn("protocol"); // 4: IPv4, 6: IPv6, other: undefined //next we fill it with data - QTest::newRow("ip4_00") << QString("127.0.0.1") << (bool)TRUE << QString("127.0.0.1") << 4; - QTest::newRow("ip4_01") << QString("255.3.2.1") << (bool)TRUE << QString("255.3.2.1") << 4; - QTest::newRow("ip4_03") << QString(" 255.3.2.1") << (bool)TRUE << QString("255.3.2.1") << 4; - QTest::newRow("ip4_04") << QString("255.3.2.1\r ") << (bool)TRUE << QString("255.3.2.1") << 4; - QTest::newRow("ip4_05") << QString("0.0.0.0") << (bool)TRUE << QString("0.0.0.0") << 4; + QTest::newRow("ip4_00") << QString("127.0.0.1") << true << QString("127.0.0.1") << 4; + QTest::newRow("ip4_01") << QString("255.3.2.1") << true << QString("255.3.2.1") << 4; + QTest::newRow("ip4_03") << QString(" 255.3.2.1") << true << QString("255.3.2.1") << 4; + QTest::newRow("ip4_04") << QString("255.3.2.1\r ") << true << QString("255.3.2.1") << 4; + QTest::newRow("ip4_05") << QString("0.0.0.0") << true << QString("0.0.0.0") << 4; // for the format of IPv6 addresses see also RFC 5952 - QTest::newRow("ip6_00") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << (bool)TRUE << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << 6; - QTest::newRow("ip6_01") << QString("1080:0000:0000:0000:0008:0800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6; - QTest::newRow("ip6_02") << QString("1080:0:0:0:8:800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6; - QTest::newRow("ip6_03") << QString("1080::8:800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6; - QTest::newRow("ip6_04") << QString("FF01::43") << (bool)TRUE << QString("FF01::43") << 6; - QTest::newRow("ip6_05") << QString("::1") << (bool)TRUE << QString("::1") << 6; - QTest::newRow("ip6_06") << QString("1::") << (bool)TRUE << QString("1::") << 6; - QTest::newRow("ip6_07") << QString("::") << (bool)TRUE << QString("::") << 6; - QTest::newRow("ip6_08") << QString("0:0:0:0:0:0:13.1.68.3") << (bool)TRUE << QString("::D01:4403") << 6; - QTest::newRow("ip6_09") << QString("::13.1.68.3") << (bool)TRUE << QString("::D01:4403") << 6; - QTest::newRow("ip6_10") << QString("0:0:0:0:0:FFFF:129.144.52.38") << (bool)TRUE << QString("::FFFF:8190:3426") << 6; - QTest::newRow("ip6_11") << QString("::FFFF:129.144.52.38") << (bool)TRUE << QString("::FFFF:8190:3426") << 6; - QTest::newRow("ip6_12") << QString("1::FFFF:129.144.52.38") << (bool)TRUE << QString("1::FFFF:8190:3426") << 6; - QTest::newRow("ip6_13") << QString("A:B::D:E") << (bool)TRUE << QString("A:B::D:E") << 6; - QTest::newRow("ip6_14") << QString("1080:0:1:0:8:800:200C:417A") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:417A") << 6; - QTest::newRow("ip6_15") << QString("1080:0:1:0:8:800:200C:0") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:0") << 6; - QTest::newRow("ip6_16") << QString("1080:0:1:0:8:800:0:0") << (bool)TRUE << QString("1080:0:1:0:8:800::") << 6; - QTest::newRow("ip6_17") << QString("1080:0:0:0:8:800:0:0") << (bool)TRUE << QString("1080::8:800:0:0") << 6; - QTest::newRow("ip6_18") << QString("0:1:1:1:8:800:0:0") << (bool)TRUE << QString("0:1:1:1:8:800::") << 6; - QTest::newRow("ip6_19") << QString("0:1:1:1:8:800:0:1") << (bool)TRUE << QString("0:1:1:1:8:800:0:1") << 6; - - QTest::newRow("error_00") << QString("foobarcom") << (bool)FALSE << QString() << 0; - QTest::newRow("error_01") << QString("foo.bar.com") << (bool)FALSE << QString() << 0; - QTest::newRow("error_02") << QString("") << (bool)FALSE << QString() << 0; - QTest::newRow("error_03") << QString() << (bool)FALSE << QString() << 0; - QTest::newRow("error_04") << QString(" \t\r") << (bool)FALSE << QString() << 0; - - QTest::newRow("error_ip4_00") << QString("256.9.9.9") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip4_01") << QString("-1.9.9.9") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip4_02") << QString("123.0.0") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip4_03") << QString("123.0.0.0.0") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip4_04") << QString("255.2 3.2.1") << (bool)FALSE << QString() << 0; - - QTest::newRow("error_ip6_00") << QString(":") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_01") << QString(":::") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_02") << QString("::AAAA:") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_03") << QString(":AAAA::") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_04") << QString("FFFF:::129.144.52.38") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_05") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:1234") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_06") << QString("129.144.52.38::") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_07") << QString("::129.144.52.38:129.144.52.38") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_08") << QString(":::129.144.52.38") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_09") << QString("1FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_10") << QString("::FFFFFFFF") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_11") << QString("::EFGH") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_12") << QString("ABCD:ABCD:ABCD") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_13") << QString("::ABCD:ABCD::") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_14") << QString("1::2::3") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_15") << QString("1:2:::") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_16") << QString(":::1:2") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_17") << QString("1:::2") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_18") << QString("FEDC::7654:3210:FEDC:BA98::3210") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_19") << QString("ABCD:ABCD:ABCD:1.2.3.4") << (bool)FALSE << QString() << 0; - QTest::newRow("error_ip6_20") << QString("ABCD::ABCD::ABCD:1.2.3.4") << (bool)FALSE << QString() << 0; + QTest::newRow("ip6_00") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << true << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << 6; + QTest::newRow("ip6_01") << QString("1080:0000:0000:0000:0008:0800:200C:417A") << true << QString("1080::8:800:200C:417A") << 6; + QTest::newRow("ip6_02") << QString("1080:0:0:0:8:800:200C:417A") << true << QString("1080::8:800:200C:417A") << 6; + QTest::newRow("ip6_03") << QString("1080::8:800:200C:417A") << true << QString("1080::8:800:200C:417A") << 6; + QTest::newRow("ip6_04") << QString("FF01::43") << true << QString("FF01::43") << 6; + QTest::newRow("ip6_05") << QString("::1") << true << QString("::1") << 6; + QTest::newRow("ip6_06") << QString("1::") << true << QString("1::") << 6; + QTest::newRow("ip6_07") << QString("::") << true << QString("::") << 6; + QTest::newRow("ip6_08") << QString("0:0:0:0:0:0:13.1.68.3") << true << QString("::D01:4403") << 6; + QTest::newRow("ip6_09") << QString("::13.1.68.3") << true << QString("::D01:4403") << 6; + QTest::newRow("ip6_10") << QString("0:0:0:0:0:FFFF:129.144.52.38") << true << QString("::FFFF:8190:3426") << 6; + QTest::newRow("ip6_11") << QString("::FFFF:129.144.52.38") << true << QString("::FFFF:8190:3426") << 6; + QTest::newRow("ip6_12") << QString("1::FFFF:129.144.52.38") << true << QString("1::FFFF:8190:3426") << 6; + QTest::newRow("ip6_13") << QString("A:B::D:E") << true << QString("A:B::D:E") << 6; + QTest::newRow("ip6_14") << QString("1080:0:1:0:8:800:200C:417A") << true << QString("1080:0:1:0:8:800:200C:417A") << 6; + QTest::newRow("ip6_15") << QString("1080:0:1:0:8:800:200C:0") << true << QString("1080:0:1:0:8:800:200C:0") << 6; + QTest::newRow("ip6_16") << QString("1080:0:1:0:8:800:0:0") << true << QString("1080:0:1:0:8:800::") << 6; + QTest::newRow("ip6_17") << QString("1080:0:0:0:8:800:0:0") << true << QString("1080::8:800:0:0") << 6; + QTest::newRow("ip6_18") << QString("0:1:1:1:8:800:0:0") << true << QString("0:1:1:1:8:800::") << 6; + QTest::newRow("ip6_19") << QString("0:1:1:1:8:800:0:1") << true << QString("0:1:1:1:8:800:0:1") << 6; + + QTest::newRow("error_00") << QString("foobarcom") << false << QString() << 0; + QTest::newRow("error_01") << QString("foo.bar.com") << false << QString() << 0; + QTest::newRow("error_02") << QString("") << false << QString() << 0; + QTest::newRow("error_03") << QString() << false << QString() << 0; + QTest::newRow("error_04") << QString(" \t\r") << false << QString() << 0; + + QTest::newRow("error_ip4_00") << QString("256.9.9.9") << false << QString() << 0; + QTest::newRow("error_ip4_01") << QString("-1.9.9.9") << false << QString() << 0; + QTest::newRow("error_ip4_02") << QString("123.0.0") << false << QString() << 0; + QTest::newRow("error_ip4_03") << QString("123.0.0.0.0") << false << QString() << 0; + QTest::newRow("error_ip4_04") << QString("255.2 3.2.1") << false << QString() << 0; + + QTest::newRow("error_ip6_00") << QString(":") << false << QString() << 0; + QTest::newRow("error_ip6_01") << QString(":::") << false << QString() << 0; + QTest::newRow("error_ip6_02") << QString("::AAAA:") << false << QString() << 0; + QTest::newRow("error_ip6_03") << QString(":AAAA::") << false << QString() << 0; + QTest::newRow("error_ip6_04") << QString("FFFF:::129.144.52.38") << false << QString() << 0; + QTest::newRow("error_ip6_05") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:1234") << false << QString() << 0; + QTest::newRow("error_ip6_06") << QString("129.144.52.38::") << false << QString() << 0; + QTest::newRow("error_ip6_07") << QString("::129.144.52.38:129.144.52.38") << false << QString() << 0; + QTest::newRow("error_ip6_08") << QString(":::129.144.52.38") << false << QString() << 0; + QTest::newRow("error_ip6_09") << QString("1FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << false << QString() << 0; + QTest::newRow("error_ip6_10") << QString("::FFFFFFFF") << false << QString() << 0; + QTest::newRow("error_ip6_11") << QString("::EFGH") << false << QString() << 0; + QTest::newRow("error_ip6_12") << QString("ABCD:ABCD:ABCD") << false << QString() << 0; + QTest::newRow("error_ip6_13") << QString("::ABCD:ABCD::") << false << QString() << 0; + QTest::newRow("error_ip6_14") << QString("1::2::3") << false << QString() << 0; + QTest::newRow("error_ip6_15") << QString("1:2:::") << false << QString() << 0; + QTest::newRow("error_ip6_16") << QString(":::1:2") << false << QString() << 0; + QTest::newRow("error_ip6_17") << QString("1:::2") << false << QString() << 0; + QTest::newRow("error_ip6_18") << QString("FEDC::7654:3210:FEDC:BA98::3210") << false << QString() << 0; + QTest::newRow("error_ip6_19") << QString("ABCD:ABCD:ABCD:1.2.3.4") << false << QString() << 0; + QTest::newRow("error_ip6_20") << QString("ABCD::ABCD::ABCD:1.2.3.4") << false << QString() << 0; } diff --git a/tests/auto/other/exceptionsafety_objects/oomsimulator.h b/tests/auto/other/exceptionsafety_objects/oomsimulator.h index 15500f590b..15b13a48a7 100644 --- a/tests/auto/other/exceptionsafety_objects/oomsimulator.h +++ b/tests/auto/other/exceptionsafety_objects/oomsimulator.h @@ -173,17 +173,17 @@ static int qCrtAllocHook(int allocType, void * /*userData*/, size_t /*size*/, const unsigned char * /*filename*/, int /*lineNumber*/) { if (blockType == _CRT_BLOCK) - return TRUE; // ignore allocations from the C library + return true; // ignore allocations from the C library switch (allocType) { case _HOOK_ALLOC: case _HOOK_REALLOC: ++mallocCount; if (mallocFailActive && --mallocFailIndex < 0) - return FALSE; // simulate OOM + return false; // simulate OOM } - return TRUE; + return true; } static struct QCrtDebugRegistrator diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 9b14fb9e22..dd81fba5b8 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1060,7 +1060,7 @@ void tst_QAccessibility::buttonTest() // tristate checkbox QCheckBox tristate("Tristate!", &window); - tristate.setTristate(TRUE); + tristate.setTristate(true); // radiobutton QRadioButton radio("Radio me!", &window); diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp index a0803b029c..cf7aada811 100644 --- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp +++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp @@ -73,14 +73,14 @@ protected: QLineEdit::focusInEvent( e ); focusInEventReason = e->reason(); focusInEventGotFocus = e->gotFocus(); - focusInEventRecieved = TRUE; + focusInEventRecieved = true; } void focusOutEvent( QFocusEvent* e ) { QLineEdit::focusOutEvent( e ); focusOutEventReason = e->reason(); focusOutEventLostFocus = !e->gotFocus(); - focusOutEventRecieved = TRUE; + focusOutEventRecieved = true; } }; @@ -173,17 +173,17 @@ void tst_QFocusEvent::initWidget() // The first lineedit should have focus QVERIFY( childFocusWidgetOne->hasFocus() ); - childFocusWidgetOne->focusInEventRecieved = FALSE; - childFocusWidgetOne->focusInEventGotFocus = FALSE; + childFocusWidgetOne->focusInEventRecieved = false; + childFocusWidgetOne->focusInEventGotFocus = false; childFocusWidgetOne->focusInEventReason = -1; - childFocusWidgetOne->focusOutEventRecieved = FALSE; - childFocusWidgetOne->focusOutEventLostFocus = FALSE; + childFocusWidgetOne->focusOutEventRecieved = false; + childFocusWidgetOne->focusOutEventLostFocus = false; childFocusWidgetOne->focusOutEventReason = -1; - childFocusWidgetTwo->focusInEventRecieved = FALSE; - childFocusWidgetTwo->focusInEventGotFocus = FALSE; + childFocusWidgetTwo->focusInEventRecieved = false; + childFocusWidgetTwo->focusInEventGotFocus = false; childFocusWidgetTwo->focusInEventReason = -1; - childFocusWidgetTwo->focusOutEventRecieved = FALSE; - childFocusWidgetTwo->focusOutEventLostFocus = FALSE; + childFocusWidgetTwo->focusOutEventRecieved = false; + childFocusWidgetTwo->focusOutEventLostFocus = false; childFocusWidgetTwo->focusOutEventReason = -1; } 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; 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() diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index 734d7b473b..a206271a13 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -261,11 +261,11 @@ void tst_QDom::setContent() QStringList::Iterator it; for ( it = featuresTrue.begin(); it != featuresTrue.end(); ++it ) { QVERIFY( reader.hasFeature( *it ) ); - reader.setFeature( *it, TRUE ); + reader.setFeature( *it, true ); } for ( it = featuresFalse.begin(); it != featuresFalse.end(); ++it ) { QVERIFY( reader.hasFeature( *it ) ); - reader.setFeature( *it, FALSE ); + reader.setFeature( *it, false ); } QDomDocument domDoc; @@ -386,7 +386,7 @@ void tst_QDom::hasAttributes_data() } /* - This function tests that QDomNode::hasAttributes() returns TRUE if and only + This function tests that QDomNode::hasAttributes() returns true if and only if the node has attributes (i.e. QDomNode::attributes() returns a list with attributes in it). */ @@ -588,13 +588,13 @@ void tst_QDom::cloneNode_data() QTest::addColumn >("pathToNode"); QTest::addColumn("deep"); - QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << (bool)FALSE; - QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << (bool)FALSE; - QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << (bool)FALSE; + QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << false; + QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << false; + QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << false; - QTest::newRow( "deep_01" ) << doc01 << nodeB1 << (bool)TRUE; - QTest::newRow( "deep_02" ) << doc01 << nodeC1 << (bool)TRUE; - QTest::newRow( "deep_03" ) << doc01 << nodeC2 << (bool)TRUE; + QTest::newRow( "deep_01" ) << doc01 << nodeB1 << true; + QTest::newRow( "deep_02" ) << doc01 << nodeC1 << true; + QTest::newRow( "deep_03" ) << doc01 << nodeC2 << true; } void tst_QDom::cloneNode() @@ -732,14 +732,14 @@ void tst_QDom::ownerDocumentTask27424_data() QTest::addColumn("insertLevel2AfterCstr"); QTest::addColumn("insertLevel3AfterCstr"); - QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE; - QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE; - QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE; - QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE; - QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE; - QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE; - QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE; - QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE; + QTest::newRow( "000" ) << false << false << false; + QTest::newRow( "001" ) << false << false << true; + QTest::newRow( "010" ) << false << true << false; + QTest::newRow( "011" ) << false << true << true; + QTest::newRow( "100" ) << true << false << false; + QTest::newRow( "101" ) << true << false << true; + QTest::newRow( "110" ) << true << true << false; + QTest::newRow( "111" ) << true << true << true; } void tst_QDom::ownerDocumentTask27424() @@ -858,14 +858,14 @@ void tst_QDom::documentCreationTask27424_data() QTest::addColumn("insertLevel2AfterCstr"); QTest::addColumn("insertLevel3AfterCstr"); - QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE; - QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE; - QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE; - QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE; - QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE; - QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE; - QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE; - QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE; + QTest::newRow( "000" ) << false << false << false; + QTest::newRow( "001" ) << false << false << true; + QTest::newRow( "010" ) << false << true << false; + QTest::newRow( "011" ) << false << true << true; + QTest::newRow( "100" ) << true << false << false; + QTest::newRow( "101" ) << true << false << true; + QTest::newRow( "110" ) << true << true << false; + QTest::newRow( "111" ) << true << true << true; } void tst_QDom::documentCreationTask27424() @@ -961,9 +961,9 @@ bool tst_QDom::isDeepEqual(const QDomNode &n1, const QDomNode &n2) } /* - Returns TRUE if \a doc1 and \a doc2 represent the same XML document, i.e. + Returns true if \a doc1 and \a doc2 represent the same XML document, i.e. they have the same informational content. Otherwise, this function returns - FALSE. + false. */ bool tst_QDom::compareDocuments( const QDomDocument &doc1, const QDomDocument &doc2 ) { @@ -971,12 +971,12 @@ bool tst_QDom::compareDocuments( const QDomDocument &doc1, const QDomDocument &d } /* - Returns TRUE if \a node1 and \a node2 represent the same XML node, i.e. + Returns true if \a node1 and \a node2 represent the same XML node, i.e. they have the same informational content. Otherwise, this function returns - FALSE. + false. - If \a deep is TRUE, children of the nodes are also tested. If \a deep is - FALSE, only \a node1 and \a node 2 are compared. + If \a deep is true, children of the nodes are also tested. If \a deep is + false, only \a node1 and \a node 2 are compared. */ bool tst_QDom::compareNodes( const QDomNode &node1, const QDomNode &node2, bool deep ) { @@ -995,7 +995,7 @@ bool tst_QDom::compareNodes( const QDomNode &node1, const QDomNode &node2, bool } if ( node1.isNull() && node2.isNull() ) - return TRUE; + return true; // ### I am not sure if this test is complete bool equal = node1.nodeName() == node2.nodeName(); equal = equal && node1.nodeType() == node2.nodeType(); diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp index d1f1c3cfda..99a833231e 100644 --- a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp +++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp @@ -124,7 +124,7 @@ bool ContentHandler::startDocument() m_result += nestPrefix(); m_result += "startDocument()\n"; ++m_nest; - return TRUE; + return true; } bool ContentHandler::endDocument() @@ -132,7 +132,7 @@ bool ContentHandler::endDocument() --m_nest; m_result += nestPrefix(); m_result += "endDocument()\n"; - return TRUE; + return true; } bool ContentHandler::startElement(const QString &namespaceURI, @@ -146,7 +146,7 @@ bool ContentHandler::startElement(const QString &namespaceURI, + "\", qName=\"" + escapeStr(qName) + "\", atts=[" + formatAttributes(atts) + "])\n"; ++m_nest; - return TRUE; + return true; } QString ContentHandler::escapeStr(const QString &s) @@ -183,14 +183,14 @@ bool ContentHandler::endElement(const QString &namespaceURI, m_result += "endElement(namespaceURI=\"" + escapeStr(namespaceURI) + "\", localName=\"" + escapeStr(localName) + "\", qName=\"" + escapeStr(qName) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::characters(const QString &ch) { m_result += nestPrefix(); m_result += "characters(ch=\"" + escapeStr(ch) + "\")\n"; - return TRUE; + return true; } void ContentHandler::setDocumentLocator(QXmlLocator *locator) @@ -208,7 +208,7 @@ bool ContentHandler::startPrefixMapping (const QString &prefix, const QString & m_result += "startPrefixMapping(prefix=\"" + escapeStr(prefix) + "\", uri=\"" + escapeStr(uri) + "\")\n"; ++m_nest; - return TRUE; + return true; } bool ContentHandler::endPrefixMapping(const QString &prefix) @@ -216,14 +216,14 @@ bool ContentHandler::endPrefixMapping(const QString &prefix) --m_nest; m_result += nestPrefix(); m_result += "endPrefixMapping(prefix=\"" + escapeStr(prefix) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::ignorableWhitespace(const QString & ch) { m_result += nestPrefix(); m_result += "ignorableWhitespace(ch=\"" + escapeStr(ch) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::processingInstruction(const QString &target, const QString &data) @@ -231,14 +231,14 @@ bool ContentHandler::processingInstruction(const QString &target, const QString m_result += nestPrefix(); m_result += "processingInstruction(target=\"" + escapeStr(target) + "\", data=\"" + escapeStr(data) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::skippedEntity (const QString & name) { m_result += nestPrefix(); m_result += "skippedEntity(name=\"" + escapeStr(name) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::warning(const QXmlParseException & exception) @@ -256,7 +256,7 @@ bool ContentHandler::warning(const QXmlParseException & exception) + "\", systemId=\"" + escapeStr(exception.systemId()) + "\", message=\"" + escapeStr(exception.message()) + "\"})\n"; - return TRUE; + return true; } bool ContentHandler::error(const QXmlParseException & exception) @@ -274,7 +274,7 @@ bool ContentHandler::error(const QXmlParseException & exception) + "\", systemId=\"" + escapeStr(exception.systemId()) + "\", message=\"" + escapeStr(exception.message()) + "\"})\n"; - return TRUE; + return true; } bool ContentHandler::fatalError(const QXmlParseException & exception) @@ -292,7 +292,7 @@ bool ContentHandler::fatalError(const QXmlParseException & exception) + "\", systemId=\"" + escapeStr(exception.systemId()) + "\", message=\"" + escapeStr(exception.message()) + "\"})\n"; - return TRUE; + return true; } bool ContentHandler::notationDecl ( const QString & name, @@ -303,7 +303,7 @@ bool ContentHandler::notationDecl ( const QString & name, m_result += "notationDecl(name=\"" + escapeStr(name) + "\", publicId=\"" + escapeStr(publicId) + "\", systemId=\"" + escapeStr(systemId) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::unparsedEntityDecl ( const QString & name, @@ -317,7 +317,7 @@ bool ContentHandler::unparsedEntityDecl ( const QString & name, + "\", systemId=\"" + escapeStr(systemId) + "\", notationName=\"" + escapeStr(notationName) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::resolveEntity(const QString & publicId, @@ -328,7 +328,7 @@ bool ContentHandler::resolveEntity(const QString & publicId, m_result += "resolveEntity(publicId=\"" + escapeStr(publicId) + "\", systemId=\"" + escapeStr(systemId) + "\", ret={})\n"; - return TRUE; + return true; } bool ContentHandler::startDTD ( const QString & name, const QString & publicId, const QString & systemId ) @@ -338,7 +338,7 @@ bool ContentHandler::startDTD ( const QString & name, const QString & publicId, + "\", publicId=\"" + escapeStr(publicId) + "\", systemId=\"" + escapeStr(systemId) + "\")\n"; ++m_nest; - return TRUE; + return true; } bool ContentHandler::endDTD () @@ -346,7 +346,7 @@ bool ContentHandler::endDTD () --m_nest; m_result += nestPrefix(); m_result += "endDTD()\n"; - return TRUE; + return true; } bool ContentHandler::startEntity ( const QString & name ) @@ -354,7 +354,7 @@ bool ContentHandler::startEntity ( const QString & name ) m_result += nestPrefix(); m_result += "startEntity(name=\"" + escapeStr(name) + "\")\n"; ++m_nest; - return TRUE; + return true; } bool ContentHandler::endEntity ( const QString & name ) @@ -362,7 +362,7 @@ bool ContentHandler::endEntity ( const QString & name ) --m_nest; m_result += nestPrefix(); m_result += "endEntity(name=\"" + escapeStr(name) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::startCDATA () @@ -370,7 +370,7 @@ bool ContentHandler::startCDATA () m_result += nestPrefix(); m_result += "startCDATA()\n"; ++m_nest; - return TRUE; + return true; } bool ContentHandler::endCDATA () @@ -378,14 +378,14 @@ bool ContentHandler::endCDATA () --m_nest; m_result += nestPrefix(); m_result += "endCDATA()\n"; - return TRUE; + return true; } bool ContentHandler::comment ( const QString & ch ) { m_result += nestPrefix(); m_result += "comment(ch=\"" + escapeStr(ch) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::attributeDecl ( const QString & eName, @@ -399,7 +399,7 @@ bool ContentHandler::attributeDecl ( const QString & eName, + escapeStr(aName) + "\", type=\"" + escapeStr(type) + "\", valueDefault=\"" + escapeStr(valueDefault) + "\", value=\"" + escapeStr(value) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::internalEntityDecl ( const QString & name, @@ -408,7 +408,7 @@ bool ContentHandler::internalEntityDecl ( const QString & name, m_result += nestPrefix(); m_result += "internatlEntityDecl(name=\"" + escapeStr(name) + "\", value=\"" + escapeStr(value) + "\")\n"; - return TRUE; + return true; } bool ContentHandler::externalEntityDecl ( const QString & name, @@ -419,7 +419,7 @@ bool ContentHandler::externalEntityDecl ( const QString & name, m_result += "externalEntityDecl(name=\"" + escapeStr(name) + "\", publicId=\"" + escapeStr(publicId) + "\", systemId=\"" + escapeStr(systemId) + "\")\n"; - return TRUE; + return true; } Parser::Parser() -- cgit v1.2.3