for (int i = 0; i < filler.length(); ++i) {
if (filler.at(i) == '1')
- b->setBit(i, TRUE);
+ b->setBit(i, true);
}
}
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
void tst_QFile::exists()
{
QFile f( QFINDTESTDATA("testfile.txt") );
- QCOMPARE( f.exists(), (bool)TRUE );
+ QVERIFY(f.exists());
QFile file("nobodyhassuchafile");
file.remove();
#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
bool end = f.atEnd();
f.close();
- QCOMPARE( end, (bool)TRUE );
+ QVERIFY(end);
}
void tst_QFile::readLine()
// Not tested at the moment.
void tst_QSettings::oldSubkeyList()
{
- QVERIFY( TRUE );
+ QVERIFY( true );
}
*/
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
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 );
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() ) );
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 );
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();
// 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;
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);
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);
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);
sender2->emitSignal1();
QCOMPARE(static_cast<QObject *>(psender), static_cast<QObject *>(0));
QCOMPARE(static_cast<QObject *>(pseq3), static_cast<QObject *>(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);
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
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 );
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 );
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 );
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();
// 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;
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));
if (thread_exited[y])
continue;
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
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));
if (thread_exited[y])
continue;
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
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));
if (thread_exited[y])
continue;
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
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));
if (thread_exited[y])
continue;
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
mousePressButton = e->button();
mousePressButtons = e->buttons();
mousePressModifiers = e->modifiers();
- mousePressEventRecieved = TRUE;
+ mousePressEventRecieved = true;
e->accept();
}
void mouseReleaseEvent(QMouseEvent *e)
mouseReleaseButton = e->button();
mouseReleaseButtons = e->buttons();
mouseReleaseModifiers = e->modifiers();
- mouseReleaseEventRecieved = TRUE;
+ mouseReleaseEventRecieved = true;
e->accept();
}
};
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;
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);
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()
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 ) );
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 );
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;
}
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 ) );
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()
bytesAvailable_finished = 1234567890;
bytesAvailable_done = 1234567890;
- inFileDirExistsFunction = FALSE;
+ inFileDirExistsFunction = false;
#if !defined(Q_OS_WINCE)
srand(time(0));
QTest::addColumn<QString>("password");
QTest::addColumn<bool>("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()
// ### 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 ) );
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 )
addCommand( QFtp::Cd, ftp->cd( cdDir + "/" + dirToCreate ) );
addCommand( QFtp::Close, ftp->close() );
- inFileDirExistsFunction = TRUE;
+ inFileDirExistsFunction = true;
QTestEventLoop::instance().enterLoop( 30 );
delete ftp;
ftp = 0;
// ### 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
QTest::addColumn<int>("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;
}
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
// tristate checkbox
QCheckBox tristate("Tristate!", &window);
- tristate.setTristate(TRUE);
+ tristate.setTristate(true);
// radiobutton
QRadioButton radio("Radio me!", &window);
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;
}
};
// 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;
}
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()
QPoint oldPosition = testWidget->pos();
// show
- ((DummyDialog*)testWidget)->showExtension( TRUE );
+ ((DummyDialog*)testWidget)->showExtension( true );
// while ( testWidget->size() == dlgSize )
// qApp->processEvents();
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 );
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();
lineEdit->setFocus();
QVERIFY(push->isDefault());
- pushTwo->setDefault(TRUE);
+ pushTwo->setDefault(true);
QVERIFY(pushTwo->isDefault());
pushTwo->setFocus();
void tst_QFontDialog::defaultOkButton()
{
- bool ok = FALSE;
+ bool ok = false;
QTimer::singleShot(2000, this, SLOT(postKeyReturn()));
QFontDialog::getFont(&ok);
- QVERIFY(ok == TRUE);
+ QVERIFY(ok);
}
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;
/* 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" );
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() );
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() );
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 ) );
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);
}
void tab()
{
- focusNextPrevChild(TRUE);
+ focusNextPrevChild(true);
}
void backTab()
{
- focusNextPrevChild(FALSE);
+ focusNextPrevChild(false);
}
};
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 );
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 );
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 );
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 );
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" );
}
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();
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() );
}
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()
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() );
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 );
}
void tst_QCheckBox::setDown()
{
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
}
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 );
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 );
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 );
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 );
// 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() );
// 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 );
// 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() );
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() );
}
{
// the pushbutton shouldn't toggle the button.
testWidget->toggle();
- QVERIFY( testWidget->isChecked() == FALSE );
+ QVERIFY(!testWidget->isChecked());
}
void tst_QCommandLinkButton::toggled()
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 );
testWidget->setBuddy( 0 );
testWidget->setIndent( 0 );
testWidget->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
- testWidget->setScaledContents( FALSE );
+ testWidget->setScaledContents( false );
}
void tst_QLabel::cleanup()
{
// 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 );
{
// 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 );
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 );
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 );
// 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() );
// 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 );
// 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() );
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() );
}
{
// the pushbutton shouldn't toggle the button.
testWidget->toggle();
- QVERIFY( testWidget->isChecked() == FALSE );
+ QVERIFY( testWidget->isChecked() == false );
}
void tst_QPushButton::toggled()
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 );
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()
void tst_QWorkspace::accelActivated()
{
- accelPressed = TRUE;
+ accelPressed = true;
}
void tst_QWorkspace::showWindows()
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;
}
/*
- 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).
*/
QTest::addColumn<QList<QVariant> >("pathToNode");
QTest::addColumn<bool>("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()
QTest::addColumn<bool>("insertLevel2AfterCstr");
QTest::addColumn<bool>("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()
QTest::addColumn<bool>("insertLevel2AfterCstr");
QTest::addColumn<bool>("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()
}
/*
- 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 )
{
}
/*
- 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 )
{
}
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();
m_result += nestPrefix();
m_result += "startDocument()\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endDocument()
--m_nest;
m_result += nestPrefix();
m_result += "endDocument()\n";
- return TRUE;
+ return true;
}
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)
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)
m_result += "startPrefixMapping(prefix=\"" + escapeStr(prefix)
+ "\", uri=\"" + escapeStr(uri) + "\")\n";
++m_nest;
- return TRUE;
+ return true;
}
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)
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)
+ "\", systemId=\"" + escapeStr(exception.systemId())
+ "\", message=\"" + escapeStr(exception.message())
+ "\"})\n";
- return TRUE;
+ return true;
}
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)
+ "\", systemId=\"" + escapeStr(exception.systemId())
+ "\", message=\"" + escapeStr(exception.message())
+ "\"})\n";
- return TRUE;
+ return true;
}
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,
+ "\", systemId=\"" + escapeStr(systemId)
+ "\", notationName=\"" + escapeStr(notationName)
+ "\")\n";
- return TRUE;
+ return true;
}
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 )
+ "\", publicId=\"" + escapeStr(publicId)
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endDTD ()
--m_nest;
m_result += nestPrefix();
m_result += "endDTD()\n";
- return TRUE;
+ return true;
}
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 )
--m_nest;
m_result += nestPrefix();
m_result += "endEntity(name=\"" + escapeStr(name) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::startCDATA ()
m_result += nestPrefix();
m_result += "startCDATA()\n";
++m_nest;
- return TRUE;
+ return true;
}
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,
+ escapeStr(aName) + "\", type=\"" + escapeStr(type)
+ "\", valueDefault=\"" + escapeStr(valueDefault)
+ "\", value=\"" + escapeStr(value) + "\")\n";
- return TRUE;
+ return true;
}
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,
m_result += "externalEntityDecl(name=\"" + escapeStr(name)
+ "\", publicId=\"" + escapeStr(publicId)
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
- return TRUE;
+ return true;
}
Parser::Parser()