Use true and false in preference to TRUE and FALSE in tests.
Use the C++ boolean constants true and false instead of the C macros TRUE and FALSE (which are actually integers), and use QVERIFY instead of QCOMPARE for verifying simple boolean expressions. Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
parent
39f3ee8a5d
commit
fda36df6ba
@ -873,7 +873,7 @@ static void QBitArrayData(QBitArray *b, int index)
|
|||||||
|
|
||||||
for (int i = 0; i < filler.length(); ++i) {
|
for (int i = 0; i < filler.length(); ++i) {
|
||||||
if (filler.at(i) == '1')
|
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)
|
static QFont qFontData(int index)
|
||||||
{
|
{
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0: return QFont("Courier", 20, QFont::Bold, TRUE);
|
case 0: return QFont("Courier", 20, QFont::Bold, true);
|
||||||
case 1: return QFont("Courier", 18, QFont::Bold, FALSE);
|
case 1: return QFont("Courier", 18, QFont::Bold, false);
|
||||||
case 2: return QFont("Courier", 16, QFont::Light, TRUE);
|
case 2: return QFont("Courier", 16, QFont::Light, true);
|
||||||
case 3: return QFont("Courier", 14, QFont::Normal, FALSE);
|
case 3: return QFont("Courier", 14, QFont::Normal, false);
|
||||||
case 4: return QFont("Courier", 12, QFont::DemiBold, TRUE);
|
case 4: return QFont("Courier", 12, QFont::DemiBold, true);
|
||||||
case 5: return QFont("Courier", 10, QFont::Black, FALSE);
|
case 5: return QFont("Courier", 10, QFont::Black, false);
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Normal, FALSE);
|
QFont f("Helvetica", 10, QFont::Normal, false);
|
||||||
f.setPixelSize(2);
|
f.setPixelSize(2);
|
||||||
f.setUnderline(FALSE);
|
f.setUnderline(false);
|
||||||
f.setStrikeOut(FALSE);
|
f.setStrikeOut(false);
|
||||||
f.setFixedPitch(FALSE);
|
f.setFixedPitch(false);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Bold, FALSE);
|
QFont f("Helvetica", 10, QFont::Bold, false);
|
||||||
f.setPixelSize(4);
|
f.setPixelSize(4);
|
||||||
f.setUnderline(TRUE);
|
f.setUnderline(true);
|
||||||
f.setStrikeOut(FALSE);
|
f.setStrikeOut(false);
|
||||||
f.setFixedPitch(FALSE);
|
f.setFixedPitch(false);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 8:
|
case 8:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Light, FALSE);
|
QFont f("Helvetica", 10, QFont::Light, false);
|
||||||
f.setPixelSize(6);
|
f.setPixelSize(6);
|
||||||
f.setUnderline(FALSE);
|
f.setUnderline(false);
|
||||||
f.setStrikeOut(TRUE);
|
f.setStrikeOut(true);
|
||||||
f.setFixedPitch(FALSE);
|
f.setFixedPitch(false);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::DemiBold, FALSE);
|
QFont f("Helvetica", 10, QFont::DemiBold, false);
|
||||||
f.setPixelSize(8);
|
f.setPixelSize(8);
|
||||||
f.setUnderline(FALSE);
|
f.setUnderline(false);
|
||||||
f.setStrikeOut(FALSE);
|
f.setStrikeOut(false);
|
||||||
f.setFixedPitch(TRUE);
|
f.setFixedPitch(true);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Black, FALSE);
|
QFont f("Helvetica", 10, QFont::Black, false);
|
||||||
f.setPixelSize(10);
|
f.setPixelSize(10);
|
||||||
f.setUnderline(TRUE);
|
f.setUnderline(true);
|
||||||
f.setStrikeOut(TRUE);
|
f.setStrikeOut(true);
|
||||||
f.setFixedPitch(FALSE);
|
f.setFixedPitch(false);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 11:
|
case 11:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Normal, TRUE);
|
QFont f("Helvetica", 10, QFont::Normal, true);
|
||||||
f.setPixelSize(12);
|
f.setPixelSize(12);
|
||||||
f.setUnderline(FALSE);
|
f.setUnderline(false);
|
||||||
f.setStrikeOut(TRUE);
|
f.setStrikeOut(true);
|
||||||
f.setFixedPitch(TRUE);
|
f.setFixedPitch(true);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 12:
|
case 12:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Bold, TRUE);
|
QFont f("Helvetica", 10, QFont::Bold, true);
|
||||||
f.setPixelSize(14);
|
f.setPixelSize(14);
|
||||||
f.setUnderline(TRUE);
|
f.setUnderline(true);
|
||||||
f.setStrikeOut(TRUE);
|
f.setStrikeOut(true);
|
||||||
f.setFixedPitch(TRUE);
|
f.setFixedPitch(true);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
case 13:
|
case 13:
|
||||||
{
|
{
|
||||||
QFont f("Helvetica", 10, QFont::Bold, TRUE);
|
QFont f("Helvetica", 10, QFont::Bold, true);
|
||||||
f.setStretch(200);
|
f.setStretch(200);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QFont("Courier", 18, QFont::Bold, TRUE);
|
return QFont("Courier", 18, QFont::Bold, true);
|
||||||
}
|
}
|
||||||
#define MAX_QFONT_DATA 14
|
#define MAX_QFONT_DATA 14
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ void tst_QFile::cleanupTestCase()
|
|||||||
void tst_QFile::exists()
|
void tst_QFile::exists()
|
||||||
{
|
{
|
||||||
QFile f( QFINDTESTDATA("testfile.txt") );
|
QFile f( QFINDTESTDATA("testfile.txt") );
|
||||||
QCOMPARE( f.exists(), (bool)TRUE );
|
QVERIFY(f.exists());
|
||||||
|
|
||||||
QFile file("nobodyhassuchafile");
|
QFile file("nobodyhassuchafile");
|
||||||
file.remove();
|
file.remove();
|
||||||
@ -443,41 +443,41 @@ void tst_QFile::open_data()
|
|||||||
#endif
|
#endif
|
||||||
QTest::newRow( "exist_readOnly" )
|
QTest::newRow( "exist_readOnly" )
|
||||||
<< QString(QFINDTESTDATA("testfile.txt")) << int(QIODevice::ReadOnly)
|
<< QString(QFINDTESTDATA("testfile.txt")) << int(QIODevice::ReadOnly)
|
||||||
<< (bool)TRUE << QFile::NoError;
|
<< true << QFile::NoError;
|
||||||
|
|
||||||
QTest::newRow( "exist_writeOnly" )
|
QTest::newRow( "exist_writeOnly" )
|
||||||
<< QString("readonlyfile")
|
<< QString("readonlyfile")
|
||||||
<< int(QIODevice::WriteOnly)
|
<< int(QIODevice::WriteOnly)
|
||||||
<< (bool)FALSE
|
<< false
|
||||||
<< QFile::OpenError;
|
<< QFile::OpenError;
|
||||||
|
|
||||||
QTest::newRow( "exist_append" )
|
QTest::newRow( "exist_append" )
|
||||||
<< QString("readonlyfile") << int(QIODevice::Append)
|
<< QString("readonlyfile") << int(QIODevice::Append)
|
||||||
<< (bool)FALSE << QFile::OpenError;
|
<< false << QFile::OpenError;
|
||||||
|
|
||||||
QTest::newRow( "nonexist_readOnly" )
|
QTest::newRow( "nonexist_readOnly" )
|
||||||
<< QString("nonExist.txt") << int(QIODevice::ReadOnly)
|
<< QString("nonExist.txt") << int(QIODevice::ReadOnly)
|
||||||
<< (bool)FALSE << QFile::OpenError;
|
<< false << QFile::OpenError;
|
||||||
|
|
||||||
QTest::newRow("emptyfile")
|
QTest::newRow("emptyfile")
|
||||||
<< QString("")
|
<< QString("")
|
||||||
<< int(QIODevice::ReadOnly)
|
<< int(QIODevice::ReadOnly)
|
||||||
<< (bool)FALSE
|
<< false
|
||||||
<< QFile::OpenError;
|
<< QFile::OpenError;
|
||||||
|
|
||||||
QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << (bool)FALSE
|
QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << false
|
||||||
<< QFile::OpenError;
|
<< 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;
|
<< QFile::NoError;
|
||||||
|
|
||||||
QTest::newRow("readonlyfile") << QString("readonlyfile") << int(QIODevice::WriteOnly)
|
QTest::newRow("readonlyfile") << QString("readonlyfile") << int(QIODevice::WriteOnly)
|
||||||
<< (bool)FALSE << QFile::OpenError;
|
<< false << QFile::OpenError;
|
||||||
QTest::newRow("noreadfile") << QString("noreadfile") << int(QIODevice::ReadOnly)
|
QTest::newRow("noreadfile") << QString("noreadfile") << int(QIODevice::ReadOnly)
|
||||||
<< (bool)FALSE << QFile::OpenError;
|
<< false << QFile::OpenError;
|
||||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||||
QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly)
|
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)
|
QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QIODevice::ReadOnly)
|
||||||
<< true << QFile::NoError;
|
<< true << QFile::NoError;
|
||||||
#endif
|
#endif
|
||||||
@ -694,7 +694,7 @@ void tst_QFile::atEnd()
|
|||||||
|
|
||||||
bool end = f.atEnd();
|
bool end = f.atEnd();
|
||||||
f.close();
|
f.close();
|
||||||
QCOMPARE( end, (bool)TRUE );
|
QVERIFY(end);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QFile::readLine()
|
void tst_QFile::readLine()
|
||||||
|
@ -3158,7 +3158,7 @@ void tst_QSettings::consistentRegistryStorage()
|
|||||||
// Not tested at the moment.
|
// Not tested at the moment.
|
||||||
void tst_QSettings::oldSubkeyList()
|
void tst_QSettings::oldSubkeyList()
|
||||||
{
|
{
|
||||||
QVERIFY( TRUE );
|
QVERIFY( true );
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -260,10 +260,10 @@ void tst_QObject::disconnect()
|
|||||||
s->emitSignal3();
|
s->emitSignal3();
|
||||||
s->emitSignal4();
|
s->emitSignal4();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), TRUE );
|
QVERIFY(r1->called(1));
|
||||||
QCOMPARE( r1->called(2), TRUE );
|
QVERIFY(r1->called(2));
|
||||||
QCOMPARE( r1->called(3), TRUE );
|
QVERIFY(r1->called(3));
|
||||||
QCOMPARE( r1->called(4), TRUE );
|
QVERIFY(r1->called(4));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
|
|
||||||
// usual disconnect with all parameters given
|
// usual disconnect with all parameters given
|
||||||
@ -271,12 +271,12 @@ void tst_QObject::disconnect()
|
|||||||
|
|
||||||
s->emitSignal1();
|
s->emitSignal1();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), FALSE );
|
QVERIFY(!r1->called(1));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
|
|
||||||
QCOMPARE( ret, TRUE );
|
QVERIFY(ret);
|
||||||
ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
|
ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
|
||||||
QCOMPARE( ret, FALSE );
|
QVERIFY(!ret);
|
||||||
|
|
||||||
// disconnect all signals from s from all slots from r1
|
// disconnect all signals from s from all slots from r1
|
||||||
QObject::disconnect( s, 0, r1, 0 );
|
QObject::disconnect( s, 0, r1, 0 );
|
||||||
@ -285,9 +285,9 @@ void tst_QObject::disconnect()
|
|||||||
s->emitSignal3();
|
s->emitSignal3();
|
||||||
s->emitSignal4();
|
s->emitSignal4();
|
||||||
|
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r1->called(3), FALSE );
|
QVERIFY(!r1->called(3));
|
||||||
QCOMPARE( r1->called(4), FALSE );
|
QVERIFY(!r1->called(4));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
|
|
||||||
connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
|
connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
|
||||||
@ -301,10 +301,10 @@ void tst_QObject::disconnect()
|
|||||||
s->emitSignal1();
|
s->emitSignal1();
|
||||||
s->emitSignal2();
|
s->emitSignal2();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), FALSE );
|
QVERIFY(!r1->called(1));
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r1->called(3), FALSE );
|
QVERIFY(!r1->called(3));
|
||||||
QCOMPARE( r1->called(4), TRUE );
|
QVERIFY(r1->called(4));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
// make sure all is disconnected again
|
// make sure all is disconnected again
|
||||||
QObject::disconnect( s, 0, r1, 0 );
|
QObject::disconnect( s, 0, r1, 0 );
|
||||||
@ -322,12 +322,12 @@ void tst_QObject::disconnect()
|
|||||||
s->emitSignal2();
|
s->emitSignal2();
|
||||||
s->emitSignal3();
|
s->emitSignal3();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), FALSE );
|
QVERIFY(!r1->called(1));
|
||||||
QCOMPARE( r2->called(1), FALSE );
|
QVERIFY(!r2->called(1));
|
||||||
QCOMPARE( r1->called(2), TRUE );
|
QVERIFY(r1->called(2));
|
||||||
QCOMPARE( r2->called(2), TRUE );
|
QVERIFY(r2->called(2));
|
||||||
QCOMPARE( r1->called(2), TRUE );
|
QVERIFY(r1->called(2));
|
||||||
QCOMPARE( r2->called(2), TRUE );
|
QVERIFY(r2->called(2));
|
||||||
|
|
||||||
r1->reset();
|
r1->reset();
|
||||||
r2->reset();
|
r2->reset();
|
||||||
@ -335,10 +335,10 @@ void tst_QObject::disconnect()
|
|||||||
// disconnect all signals of s from all receivers
|
// disconnect all signals of s from all receivers
|
||||||
QObject::disconnect( s, 0, 0, 0 );
|
QObject::disconnect( s, 0, 0, 0 );
|
||||||
|
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r2->called(2), FALSE );
|
QVERIFY(!r2->called(2));
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r2->called(2), FALSE );
|
QVERIFY(!r2->called(2));
|
||||||
|
|
||||||
delete r2;
|
delete r2;
|
||||||
delete r1;
|
delete r1;
|
||||||
@ -979,14 +979,14 @@ void tst_QObject::emitInDefinedOrder()
|
|||||||
|
|
||||||
SequenceObject::sequence = sequence = 0;
|
SequenceObject::sequence = sequence = 0;
|
||||||
sender2->emitSignal1();
|
sender2->emitSignal1();
|
||||||
QCOMPARE(seq1.called(1), TRUE);
|
QVERIFY(seq1.called(1));
|
||||||
QCOMPARE(seq2.called(1), TRUE);
|
QVERIFY(seq2.called(1));
|
||||||
QCOMPARE(seq3->called(1), FALSE);
|
QVERIFY(!seq3->called(1));
|
||||||
QCOMPARE(seq4.called(1), TRUE);
|
QVERIFY(seq4.called(1));
|
||||||
QCOMPARE(seq1.called(2), TRUE);
|
QVERIFY(seq1.called(2));
|
||||||
QCOMPARE(seq2.called(2), TRUE);
|
QVERIFY(seq2.called(2));
|
||||||
QCOMPARE(seq3->called(2), FALSE);
|
QVERIFY(!seq3->called(2));
|
||||||
QCOMPARE(seq4.called(2), TRUE);
|
QVERIFY(seq4.called(2));
|
||||||
QCOMPARE(seq1.sequence_slot1, ++sequence);
|
QCOMPARE(seq1.sequence_slot1, ++sequence);
|
||||||
QCOMPARE(seq2.sequence_slot1, ++sequence);
|
QCOMPARE(seq2.sequence_slot1, ++sequence);
|
||||||
QCOMPARE(seq4.sequence_slot1, ++sequence);
|
QCOMPARE(seq4.sequence_slot1, ++sequence);
|
||||||
@ -1015,14 +1015,14 @@ void tst_QObject::emitInDefinedOrder()
|
|||||||
|
|
||||||
SequenceObject::sequence = sequence = 0;
|
SequenceObject::sequence = sequence = 0;
|
||||||
sender2->emitSignal1();
|
sender2->emitSignal1();
|
||||||
QCOMPARE(seq1.called(2), TRUE);
|
QVERIFY(seq1.called(2));
|
||||||
QCOMPARE(seq2.called(2), TRUE);
|
QVERIFY(seq2.called(2));
|
||||||
QCOMPARE(seq3->called(2), FALSE);
|
QVERIFY(!seq3->called(2));
|
||||||
QCOMPARE(seq4.called(2), TRUE);
|
QVERIFY(seq4.called(2));
|
||||||
QCOMPARE(seq1.called(1), TRUE);
|
QVERIFY(seq1.called(1));
|
||||||
QCOMPARE(seq2.called(1), TRUE);
|
QVERIFY(seq2.called(1));
|
||||||
QCOMPARE(seq3->called(1), FALSE);
|
QVERIFY(!seq3->called(1));
|
||||||
QCOMPARE(seq4.called(1), TRUE);
|
QVERIFY(seq4.called(1));
|
||||||
QCOMPARE(seq1.sequence_slot2, ++sequence);
|
QCOMPARE(seq1.sequence_slot2, ++sequence);
|
||||||
QCOMPARE(seq2.sequence_slot2, ++sequence);
|
QCOMPARE(seq2.sequence_slot2, ++sequence);
|
||||||
QCOMPARE(seq4.sequence_slot2, ++sequence);
|
QCOMPARE(seq4.sequence_slot2, ++sequence);
|
||||||
@ -1051,14 +1051,14 @@ void tst_QObject::emitInDefinedOrder()
|
|||||||
|
|
||||||
SequenceObject::sequence = sequence = 0;
|
SequenceObject::sequence = sequence = 0;
|
||||||
sender2->emitSignal1();
|
sender2->emitSignal1();
|
||||||
QCOMPARE(seq1.called(1), TRUE);
|
QVERIFY(seq1.called(1));
|
||||||
QCOMPARE(seq2.called(1), TRUE);
|
QVERIFY(seq2.called(1));
|
||||||
QCOMPARE(seq3->called(1), FALSE);
|
QVERIFY(!seq3->called(1));
|
||||||
QCOMPARE(seq4.called(1), TRUE);
|
QVERIFY(seq4.called(1));
|
||||||
QCOMPARE(seq1.called(2), TRUE);
|
QVERIFY(seq1.called(2));
|
||||||
QCOMPARE(seq2.called(2), TRUE);
|
QVERIFY(seq2.called(2));
|
||||||
QCOMPARE(seq3->called(2), FALSE);
|
QVERIFY(!seq3->called(2));
|
||||||
QCOMPARE(seq4.called(2), TRUE);
|
QVERIFY(seq4.called(2));
|
||||||
QCOMPARE(seq1.sequence_slot1, ++sequence);
|
QCOMPARE(seq1.sequence_slot1, ++sequence);
|
||||||
QCOMPARE(seq2.sequence_slot1, ++sequence);
|
QCOMPARE(seq2.sequence_slot1, ++sequence);
|
||||||
QCOMPARE(seq4.sequence_slot1, ++sequence);
|
QCOMPARE(seq4.sequence_slot1, ++sequence);
|
||||||
@ -1092,12 +1092,12 @@ void tst_QObject::emitInDefinedOrder()
|
|||||||
sender2->emitSignal1();
|
sender2->emitSignal1();
|
||||||
QCOMPARE(static_cast<QObject *>(psender), static_cast<QObject *>(0));
|
QCOMPARE(static_cast<QObject *>(psender), static_cast<QObject *>(0));
|
||||||
QCOMPARE(static_cast<QObject *>(pseq3), static_cast<QObject *>(0));
|
QCOMPARE(static_cast<QObject *>(pseq3), static_cast<QObject *>(0));
|
||||||
QCOMPARE(seq1.called(1), TRUE);
|
QVERIFY(seq1.called(1));
|
||||||
QCOMPARE(seq2.called(1), TRUE);
|
QVERIFY(seq2.called(1));
|
||||||
QCOMPARE(seq4.called(1), TRUE);
|
QVERIFY(seq4.called(1));
|
||||||
QCOMPARE(seq1.called(2), TRUE);
|
QVERIFY(seq1.called(2));
|
||||||
QCOMPARE(seq2.called(2), TRUE);
|
QVERIFY(seq2.called(2));
|
||||||
QCOMPARE(seq4.called(2), FALSE);
|
QVERIFY(!seq4.called(2));
|
||||||
QCOMPARE(seq1.sequence_slot1, ++sequence);
|
QCOMPARE(seq1.sequence_slot1, ++sequence);
|
||||||
QCOMPARE(seq2.sequence_slot1, ++sequence);
|
QCOMPARE(seq2.sequence_slot1, ++sequence);
|
||||||
QCOMPARE(seq4.sequence_slot1, ++sequence);
|
QCOMPARE(seq4.sequence_slot1, ++sequence);
|
||||||
@ -4209,10 +4209,10 @@ void tst_QObject::pointerDisconnect()
|
|||||||
s->emitSignal3();
|
s->emitSignal3();
|
||||||
s->emitSignal4();
|
s->emitSignal4();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), TRUE );
|
QVERIFY(r1->called(1));
|
||||||
QCOMPARE( r1->called(2), TRUE );
|
QVERIFY(r1->called(2));
|
||||||
QCOMPARE( r1->called(3), TRUE );
|
QVERIFY(r1->called(3));
|
||||||
QCOMPARE( r1->called(4), TRUE );
|
QVERIFY(r1->called(4));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
|
|
||||||
// usual disconnect with all parameters given
|
// usual disconnect with all parameters given
|
||||||
@ -4220,12 +4220,12 @@ void tst_QObject::pointerDisconnect()
|
|||||||
|
|
||||||
s->emitSignal1();
|
s->emitSignal1();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), FALSE );
|
QVERIFY(!r1->called(1));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
|
|
||||||
QCOMPARE( ret, TRUE );
|
QVERIFY(ret);
|
||||||
ret = QObject::disconnect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 );
|
ret = QObject::disconnect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 );
|
||||||
QCOMPARE( ret, FALSE );
|
QVERIFY(!ret);
|
||||||
|
|
||||||
// disconnect all signals from s from all slots from r1
|
// disconnect all signals from s from all slots from r1
|
||||||
QObject::disconnect( s, 0, r1, 0 );
|
QObject::disconnect( s, 0, r1, 0 );
|
||||||
@ -4234,9 +4234,9 @@ void tst_QObject::pointerDisconnect()
|
|||||||
s->emitSignal3();
|
s->emitSignal3();
|
||||||
s->emitSignal4();
|
s->emitSignal4();
|
||||||
|
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r1->called(3), FALSE );
|
QVERIFY(!r1->called(3));
|
||||||
QCOMPARE( r1->called(4), FALSE );
|
QVERIFY(!r1->called(4));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
|
|
||||||
connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 );
|
connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 );
|
||||||
@ -4250,10 +4250,10 @@ void tst_QObject::pointerDisconnect()
|
|||||||
s->emitSignal1();
|
s->emitSignal1();
|
||||||
s->emitSignal2();
|
s->emitSignal2();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), FALSE );
|
QVERIFY(!r1->called(1));
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r1->called(3), FALSE );
|
QVERIFY(!r1->called(3));
|
||||||
QCOMPARE( r1->called(4), TRUE );
|
QVERIFY(r1->called(4));
|
||||||
r1->reset();
|
r1->reset();
|
||||||
// make sure all is disconnected again
|
// make sure all is disconnected again
|
||||||
QObject::disconnect( s, 0, r1, 0 );
|
QObject::disconnect( s, 0, r1, 0 );
|
||||||
@ -4271,12 +4271,12 @@ void tst_QObject::pointerDisconnect()
|
|||||||
s->emitSignal2();
|
s->emitSignal2();
|
||||||
s->emitSignal3();
|
s->emitSignal3();
|
||||||
|
|
||||||
QCOMPARE( r1->called(1), FALSE );
|
QVERIFY(!r1->called(1));
|
||||||
QCOMPARE( r2->called(1), FALSE );
|
QVERIFY(!r2->called(1));
|
||||||
QCOMPARE( r1->called(2), TRUE );
|
QVERIFY(r1->called(2));
|
||||||
QCOMPARE( r2->called(2), TRUE );
|
QVERIFY(r2->called(2));
|
||||||
QCOMPARE( r1->called(2), TRUE );
|
QVERIFY(r1->called(2));
|
||||||
QCOMPARE( r2->called(2), TRUE );
|
QVERIFY(r2->called(2));
|
||||||
|
|
||||||
r1->reset();
|
r1->reset();
|
||||||
r2->reset();
|
r2->reset();
|
||||||
@ -4284,10 +4284,10 @@ void tst_QObject::pointerDisconnect()
|
|||||||
// disconnect all signals of s from all receivers
|
// disconnect all signals of s from all receivers
|
||||||
QObject::disconnect( s, 0, 0, 0 );
|
QObject::disconnect( s, 0, 0, 0 );
|
||||||
|
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r2->called(2), FALSE );
|
QVERIFY(!r2->called(2));
|
||||||
QCOMPARE( r1->called(2), FALSE );
|
QVERIFY(!r1->called(2));
|
||||||
QCOMPARE( r2->called(2), FALSE );
|
QVERIFY(!r2->called(2));
|
||||||
|
|
||||||
delete r2;
|
delete r2;
|
||||||
delete r1;
|
delete r1;
|
||||||
|
@ -443,7 +443,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
for (x = 0; x < ThreadCount; ++x) {
|
for (x = 0; x < ThreadCount; ++x) {
|
||||||
thread[x].mutex = &mutex;
|
thread[x].mutex = &mutex;
|
||||||
thread[x].cond = &cond;
|
thread[x].cond = &cond;
|
||||||
thread_exited[x] = FALSE;
|
thread_exited[x] = false;
|
||||||
thread[x].start();
|
thread[x].start();
|
||||||
// wait for thread to start
|
// wait for thread to start
|
||||||
QVERIFY(thread[x].started.wait(&mutex, 1000));
|
QVERIFY(thread[x].started.wait(&mutex, 1000));
|
||||||
@ -468,7 +468,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
if (thread_exited[y])
|
if (thread_exited[y])
|
||||||
continue;
|
continue;
|
||||||
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
|
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
|
||||||
thread_exited[y] = TRUE;
|
thread_exited[y] = true;
|
||||||
++exited;
|
++exited;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -487,7 +487,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
for (x = 0; x < ThreadCount; ++x) {
|
for (x = 0; x < ThreadCount; ++x) {
|
||||||
rwthread[x].readWriteLock = &readWriteLock;
|
rwthread[x].readWriteLock = &readWriteLock;
|
||||||
rwthread[x].cond = &cond;
|
rwthread[x].cond = &cond;
|
||||||
thread_exited[x] = FALSE;
|
thread_exited[x] = false;
|
||||||
rwthread[x].start();
|
rwthread[x].start();
|
||||||
// wait for thread to start
|
// wait for thread to start
|
||||||
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
|
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
|
||||||
@ -512,7 +512,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
if (thread_exited[y])
|
if (thread_exited[y])
|
||||||
continue;
|
continue;
|
||||||
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
|
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
|
||||||
thread_exited[y] = TRUE;
|
thread_exited[y] = true;
|
||||||
++exited;
|
++exited;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -537,7 +537,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
for (x = 0; x < ThreadCount; ++x) {
|
for (x = 0; x < ThreadCount; ++x) {
|
||||||
thread[x].mutex = &mutex;
|
thread[x].mutex = &mutex;
|
||||||
thread[x].cond = &cond;
|
thread[x].cond = &cond;
|
||||||
thread_exited[x] = FALSE;
|
thread_exited[x] = false;
|
||||||
thread[x].start();
|
thread[x].start();
|
||||||
// wait for thread to start
|
// wait for thread to start
|
||||||
QVERIFY(thread[x].started.wait(&mutex, 1000));
|
QVERIFY(thread[x].started.wait(&mutex, 1000));
|
||||||
@ -564,7 +564,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
if (thread_exited[y])
|
if (thread_exited[y])
|
||||||
continue;
|
continue;
|
||||||
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
|
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
|
||||||
thread_exited[y] = TRUE;
|
thread_exited[y] = true;
|
||||||
++exited;
|
++exited;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -583,7 +583,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
for (x = 0; x < ThreadCount; ++x) {
|
for (x = 0; x < ThreadCount; ++x) {
|
||||||
rwthread[x].readWriteLock = &readWriteLock;
|
rwthread[x].readWriteLock = &readWriteLock;
|
||||||
rwthread[x].cond = &cond;
|
rwthread[x].cond = &cond;
|
||||||
thread_exited[x] = FALSE;
|
thread_exited[x] = false;
|
||||||
rwthread[x].start();
|
rwthread[x].start();
|
||||||
// wait for thread to start
|
// wait for thread to start
|
||||||
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
|
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
|
||||||
@ -610,7 +610,7 @@ void tst_QWaitCondition::wakeOne()
|
|||||||
if (thread_exited[y])
|
if (thread_exited[y])
|
||||||
continue;
|
continue;
|
||||||
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
|
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
|
||||||
thread_exited[y] = TRUE;
|
thread_exited[y] = true;
|
||||||
++exited;
|
++exited;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ protected:
|
|||||||
mousePressButton = e->button();
|
mousePressButton = e->button();
|
||||||
mousePressButtons = e->buttons();
|
mousePressButtons = e->buttons();
|
||||||
mousePressModifiers = e->modifiers();
|
mousePressModifiers = e->modifiers();
|
||||||
mousePressEventRecieved = TRUE;
|
mousePressEventRecieved = true;
|
||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
void mouseReleaseEvent(QMouseEvent *e)
|
void mouseReleaseEvent(QMouseEvent *e)
|
||||||
@ -81,7 +81,7 @@ protected:
|
|||||||
mouseReleaseButton = e->button();
|
mouseReleaseButton = e->button();
|
||||||
mouseReleaseButtons = e->buttons();
|
mouseReleaseButtons = e->buttons();
|
||||||
mouseReleaseModifiers = e->modifiers();
|
mouseReleaseModifiers = e->modifiers();
|
||||||
mouseReleaseEventRecieved = TRUE;
|
mouseReleaseEventRecieved = true;
|
||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -134,8 +134,8 @@ void tst_QMouseEvent::cleanupTestCase()
|
|||||||
|
|
||||||
void tst_QMouseEvent::init()
|
void tst_QMouseEvent::init()
|
||||||
{
|
{
|
||||||
testMouseWidget->mousePressEventRecieved = FALSE;
|
testMouseWidget->mousePressEventRecieved = false;
|
||||||
testMouseWidget->mouseReleaseEventRecieved = FALSE;
|
testMouseWidget->mouseReleaseEventRecieved = false;
|
||||||
testMouseWidget->mousePressButton = 0;
|
testMouseWidget->mousePressButton = 0;
|
||||||
testMouseWidget->mousePressButtons = 0;
|
testMouseWidget->mousePressButtons = 0;
|
||||||
testMouseWidget->mousePressModifiers = 0;
|
testMouseWidget->mousePressModifiers = 0;
|
||||||
|
@ -1254,10 +1254,8 @@ void tst_QShortcut::testElement()
|
|||||||
|
|
||||||
if (action == ClearAll) {
|
if (action == ClearAll) {
|
||||||
clearAllShortcuts();
|
clearAllShortcuts();
|
||||||
QCOMPARE(TRUE, TRUE);
|
|
||||||
} else if (action == SetupAccel) {
|
} else if (action == SetupAccel) {
|
||||||
setupShortcut(testWidget, txt, k1, k2, k3, k4);
|
setupShortcut(testWidget, txt, k1, k2, k3, k4);
|
||||||
QCOMPARE(TRUE, TRUE);
|
|
||||||
} else {
|
} else {
|
||||||
sendKeyEvents(k1, c1, k2, c2, k3, c3, k4, c4);
|
sendKeyEvents(k1, c1, k2, c2, k3, c3, k4, c4);
|
||||||
QCOMPARE(int(currentResult), result);
|
QCOMPARE(int(currentResult), result);
|
||||||
|
@ -347,7 +347,7 @@ Q_DECLARE_METATYPE(QRegion)
|
|||||||
tst_QPainter::tst_QPainter()
|
tst_QPainter::tst_QPainter()
|
||||||
{
|
{
|
||||||
// QtTestCase sets this to false, but this turns off alpha pixmaps on Unix.
|
// QtTestCase sets this to false, but this turns off alpha pixmaps on Unix.
|
||||||
QApplication::setDesktopSettingsAware(TRUE);
|
QApplication::setDesktopSettingsAware(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
tst_QPainter::~tst_QPainter()
|
tst_QPainter::~tst_QPainter()
|
||||||
|
@ -127,7 +127,7 @@ static QBitmap createSrcBitmap( int size, int border )
|
|||||||
painter.drawRect( border, border, size, size2 );
|
painter.drawRect( border, border, size, size2 );
|
||||||
painter.end();
|
painter.end();
|
||||||
if ( border > 0 ) {
|
if ( border > 0 ) {
|
||||||
QBitmap mask( totalSize, totalSize, TRUE );
|
QBitmap mask( totalSize, totalSize, true );
|
||||||
QPainter painter;
|
QPainter painter;
|
||||||
painter.begin( &mask );
|
painter.begin( &mask );
|
||||||
painter.setPen( QPen( Qt::color1, 1 ) );
|
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 ) );
|
QBitmap src_tmp = createSrcBitmap( 32, 0 ).xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
|
||||||
src_tmp.resize( 32, 48 );
|
src_tmp.resize( 32, 48 );
|
||||||
QBitmap src2 = src_tmp.xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
|
QBitmap src2 = src_tmp.xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
|
||||||
QBitmap mask( 32, 48, TRUE );
|
QBitmap mask( 32, 48, true );
|
||||||
{
|
{
|
||||||
QPainter painter;
|
QPainter painter;
|
||||||
painter.begin( &mask );
|
painter.begin( &mask );
|
||||||
|
@ -117,22 +117,22 @@ void tst_QPen::operator_eq_eq_data()
|
|||||||
|
|
||||||
QTest::newRow("differentColor") << QPen(Qt::red)
|
QTest::newRow("differentColor") << QPen(Qt::red)
|
||||||
<< QPen(Qt::blue)
|
<< QPen(Qt::blue)
|
||||||
<< bool(FALSE);
|
<< false;
|
||||||
QTest::newRow("differentWidth") << QPen(Qt::red, 2)
|
QTest::newRow("differentWidth") << QPen(Qt::red, 2)
|
||||||
<< QPen(Qt::red, 3)
|
<< QPen(Qt::red, 3)
|
||||||
<< bool(FALSE);
|
<< false;
|
||||||
QTest::newRow("differentPenStyle") << QPen(Qt::red, 2, Qt::DashLine)
|
QTest::newRow("differentPenStyle") << QPen(Qt::red, 2, Qt::DashLine)
|
||||||
<< QPen(Qt::red, 2, Qt::DotLine)
|
<< QPen(Qt::red, 2, Qt::DotLine)
|
||||||
<< bool(FALSE);
|
<< false;
|
||||||
QTest::newRow("differentCapStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
|
QTest::newRow("differentCapStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
|
||||||
<< QPen(Qt::red, 2, Qt::DashLine, Qt::SquareCap, 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)
|
QTest::newRow("differentJoinStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
|
||||||
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin)
|
<< 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)
|
QTest::newRow("same") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
|
||||||
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
|
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
|
||||||
<< bool(TRUE);
|
<< true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void tst_QPolygon::makeEllipse()
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
// make sure that all points are R+-1 away from the center
|
// 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++) {
|
for (i = 1; i < pa.size(); i++) {
|
||||||
QPoint p = pa.at( i );
|
QPoint p = pa.at( i );
|
||||||
double r = sqrt( pow( double(p.x() - R), 2.0 ) + pow( double(p.y() - R), 2.0 ) );
|
double r = sqrt( pow( double(p.x() - R), 2.0 ) + pow( double(p.y() - R), 2.0 ) );
|
||||||
|
@ -315,25 +315,25 @@ void tst_QPrinter::testSetOptions()
|
|||||||
QPrintDialog dlg(&prn);
|
QPrintDialog dlg(&prn);
|
||||||
|
|
||||||
// Verify default values
|
// Verify default values
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), TRUE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), true);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), FALSE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), false);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true);
|
||||||
|
|
||||||
dlg.setEnabledOptions(QAbstractPrintDialog::PrintPageRange);
|
dlg.setEnabledOptions(QAbstractPrintDialog::PrintPageRange);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), FALSE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), false);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true);
|
||||||
|
|
||||||
dlg.setEnabledOptions((QAbstractPrintDialog::PrintDialogOptions(QAbstractPrintDialog::PrintSelection
|
dlg.setEnabledOptions((QAbstractPrintDialog::PrintDialogOptions(QAbstractPrintDialog::PrintSelection
|
||||||
| QAbstractPrintDialog::PrintPageRange)));
|
| QAbstractPrintDialog::PrintPageRange)));
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), TRUE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), true);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true);
|
||||||
|
|
||||||
dlg.setEnabledOptions(QAbstractPrintDialog::PrintSelection);
|
dlg.setEnabledOptions(QAbstractPrintDialog::PrintSelection);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), TRUE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), true);
|
||||||
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), FALSE);
|
MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QPrinter::testMargins_data()
|
void tst_QPrinter::testMargins_data()
|
||||||
|
@ -278,7 +278,7 @@ void tst_QFtp::init()
|
|||||||
bytesAvailable_finished = 1234567890;
|
bytesAvailable_finished = 1234567890;
|
||||||
bytesAvailable_done = 1234567890;
|
bytesAvailable_done = 1234567890;
|
||||||
|
|
||||||
inFileDirExistsFunction = FALSE;
|
inFileDirExistsFunction = false;
|
||||||
|
|
||||||
#if !defined(Q_OS_WINCE)
|
#if !defined(Q_OS_WINCE)
|
||||||
srand(time(0));
|
srand(time(0));
|
||||||
@ -435,12 +435,12 @@ void tst_QFtp::close_data()
|
|||||||
QTest::addColumn<QString>("password");
|
QTest::addColumn<QString>("password");
|
||||||
QTest::addColumn<bool>("login");
|
QTest::addColumn<bool>("login");
|
||||||
|
|
||||||
QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << (bool)TRUE;
|
QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << true;
|
||||||
QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << (bool)TRUE;
|
QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << true;
|
||||||
QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << (bool)TRUE;
|
QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << true;
|
||||||
QTest::newRow( "login04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << (bool)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()
|
void tst_QFtp::close()
|
||||||
@ -1963,12 +1963,12 @@ bool tst_QFtp::fileExists( const QString &host, quint16 port, const QString &use
|
|||||||
// ### make these tests work
|
// ### make these tests work
|
||||||
if (ftp->currentId() != 0) {
|
if (ftp->currentId() != 0) {
|
||||||
qWarning("ftp->currentId() != 0");
|
qWarning("ftp->currentId() != 0");
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ftp->state() != QFtp::Unconnected) {
|
if (ftp->state() != QFtp::Unconnected) {
|
||||||
qWarning("ftp->state() != QFtp::Unconnected");
|
qWarning("ftp->state() != QFtp::Unconnected");
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
addCommand( QFtp::ConnectToHost, ftp->connectToHost( host, port ) );
|
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::List, ftp->list( file ) );
|
||||||
addCommand( QFtp::Close, ftp->close() );
|
addCommand( QFtp::Close, ftp->close() );
|
||||||
|
|
||||||
inFileDirExistsFunction = TRUE;
|
inFileDirExistsFunction = true;
|
||||||
QTestEventLoop::instance().enterLoop( 30 );
|
QTestEventLoop::instance().enterLoop( 30 );
|
||||||
delete ftp;
|
delete ftp;
|
||||||
ftp = 0;
|
ftp = 0;
|
||||||
if ( QTestEventLoop::instance().timeout() ) {
|
if ( QTestEventLoop::instance().timeout() ) {
|
||||||
// ### make this test work
|
// ### make this test work
|
||||||
qWarning("tst_QFtp::fileExists: Network operation timed out");
|
qWarning("tst_QFtp::fileExists: Network operation timed out");
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
inFileDirExistsFunction = FALSE;
|
inFileDirExistsFunction = false;
|
||||||
|
|
||||||
ResMapIt it = resultMap.find( QFtp::ConnectToHost );
|
ResMapIt it = resultMap.find( QFtp::ConnectToHost );
|
||||||
// ### make these tests work
|
// ### make these tests work
|
||||||
if (it == resultMap.end()) {
|
if (it == resultMap.end()) {
|
||||||
qWarning("it != resultMap.end()");
|
qWarning("it != resultMap.end()");
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it.value().success == -1) {
|
if (it.value().success == -1) {
|
||||||
qWarning("it.value().success != -1");
|
qWarning("it.value().success != -1");
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( it.value().success == 1 ) {
|
if ( it.value().success == 1 ) {
|
||||||
for ( uint i=0; i < (uint) listInfo_i.count(); i++ ) {
|
for ( uint i=0; i < (uint) listInfo_i.count(); i++ ) {
|
||||||
if ( QFileInfo(listInfo_i[i].name()).fileName() == QFileInfo(file).fileName() )
|
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
|
//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");
|
//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 )
|
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::Cd, ftp->cd( cdDir + "/" + dirToCreate ) );
|
||||||
addCommand( QFtp::Close, ftp->close() );
|
addCommand( QFtp::Close, ftp->close() );
|
||||||
|
|
||||||
inFileDirExistsFunction = TRUE;
|
inFileDirExistsFunction = true;
|
||||||
QTestEventLoop::instance().enterLoop( 30 );
|
QTestEventLoop::instance().enterLoop( 30 );
|
||||||
delete ftp;
|
delete ftp;
|
||||||
ftp = 0;
|
ftp = 0;
|
||||||
@ -2037,9 +2037,9 @@ bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user
|
|||||||
// ### make this test work
|
// ### make this test work
|
||||||
// QFAIL( "Network operation timed out" );
|
// QFAIL( "Network operation timed out" );
|
||||||
qWarning("tst_QFtp::dirExists: 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 );
|
ResMapIt it = resultMap.find( QFtp::Cd );
|
||||||
// ### make these tests work
|
// ### make these tests work
|
||||||
|
@ -157,67 +157,67 @@ void tst_QHostAddress::setAddress_QString_data()
|
|||||||
QTest::addColumn<int>("protocol"); // 4: IPv4, 6: IPv6, other: undefined
|
QTest::addColumn<int>("protocol"); // 4: IPv4, 6: IPv6, other: undefined
|
||||||
|
|
||||||
//next we fill it with data
|
//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_00") << QString("127.0.0.1") << 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_01") << QString("255.3.2.1") << 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_03") << QString(" 255.3.2.1") << 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_04") << QString("255.3.2.1\r ") << 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_05") << QString("0.0.0.0") << true << QString("0.0.0.0") << 4;
|
||||||
|
|
||||||
// for the format of IPv6 addresses see also RFC 5952
|
// 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_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") << (bool)TRUE << QString("1080::8:800:200C:417A") << 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") << (bool)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") << (bool)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") << (bool)TRUE << QString("FF01::43") << 6;
|
QTest::newRow("ip6_04") << QString("FF01::43") << true << QString("FF01::43") << 6;
|
||||||
QTest::newRow("ip6_05") << QString("::1") << (bool)TRUE << QString("::1") << 6;
|
QTest::newRow("ip6_05") << QString("::1") << true << QString("::1") << 6;
|
||||||
QTest::newRow("ip6_06") << QString("1::") << (bool)TRUE << QString("1::") << 6;
|
QTest::newRow("ip6_06") << QString("1::") << true << QString("1::") << 6;
|
||||||
QTest::newRow("ip6_07") << QString("::") << (bool)TRUE << QString("::") << 6;
|
QTest::newRow("ip6_07") << QString("::") << 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_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") << (bool)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") << (bool)TRUE << QString("::FFFF:8190:3426") << 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") << (bool)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") << (bool)TRUE << QString("1::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") << (bool)TRUE << QString("A:B::D:E") << 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") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:417A") << 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") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:0") << 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") << (bool)TRUE << QString("1080:0:1:0:8:800::") << 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") << (bool)TRUE << QString("1080::8:800:0:0") << 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") << (bool)TRUE << QString("0:1:1:1:8:800::") << 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") << (bool)TRUE << QString("0:1:1:1:8:800:0:1") << 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") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_00") << QString("foobarcom") << false << QString() << 0;
|
||||||
QTest::newRow("error_01") << QString("foo.bar.com") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_01") << QString("foo.bar.com") << false << QString() << 0;
|
||||||
QTest::newRow("error_02") << QString("") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_02") << QString("") << false << QString() << 0;
|
||||||
QTest::newRow("error_03") << QString() << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_03") << QString() << false << QString() << 0;
|
||||||
QTest::newRow("error_04") << QString(" \t\r") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_04") << QString(" \t\r") << false << QString() << 0;
|
||||||
|
|
||||||
QTest::newRow("error_ip4_00") << QString("256.9.9.9") << (bool)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") << (bool)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") << (bool)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") << (bool)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") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip4_04") << QString("255.2 3.2.1") << false << QString() << 0;
|
||||||
|
|
||||||
QTest::newRow("error_ip6_00") << QString(":") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_00") << QString(":") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_01") << QString(":::") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_01") << QString(":::") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_02") << QString("::AAAA:") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_02") << QString("::AAAA:") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_03") << QString(":AAAA::") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_03") << QString(":AAAA::") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_04") << QString("FFFF:::129.144.52.38") << (bool)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") << (bool)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::") << (bool)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") << (bool)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") << (bool)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") << (bool)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") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_10") << QString("::FFFFFFFF") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_11") << QString("::EFGH") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_11") << QString("::EFGH") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_12") << QString("ABCD:ABCD:ABCD") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_12") << QString("ABCD:ABCD:ABCD") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_13") << QString("::ABCD:ABCD::") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_13") << QString("::ABCD:ABCD::") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_14") << QString("1::2::3") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_14") << QString("1::2::3") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_15") << QString("1:2:::") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_15") << QString("1:2:::") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_16") << QString(":::1:2") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_16") << QString(":::1:2") << false << QString() << 0;
|
||||||
QTest::newRow("error_ip6_17") << QString("1:::2") << (bool)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") << (bool)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") << (bool)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") << (bool)FALSE << QString() << 0;
|
QTest::newRow("error_ip6_20") << QString("ABCD::ABCD::ABCD:1.2.3.4") << false << QString() << 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,17 +173,17 @@ static int qCrtAllocHook(int allocType, void * /*userData*/, size_t /*size*/,
|
|||||||
const unsigned char * /*filename*/, int /*lineNumber*/)
|
const unsigned char * /*filename*/, int /*lineNumber*/)
|
||||||
{
|
{
|
||||||
if (blockType == _CRT_BLOCK)
|
if (blockType == _CRT_BLOCK)
|
||||||
return TRUE; // ignore allocations from the C library
|
return true; // ignore allocations from the C library
|
||||||
|
|
||||||
switch (allocType) {
|
switch (allocType) {
|
||||||
case _HOOK_ALLOC:
|
case _HOOK_ALLOC:
|
||||||
case _HOOK_REALLOC:
|
case _HOOK_REALLOC:
|
||||||
++mallocCount;
|
++mallocCount;
|
||||||
if (mallocFailActive && --mallocFailIndex < 0)
|
if (mallocFailActive && --mallocFailIndex < 0)
|
||||||
return FALSE; // simulate OOM
|
return false; // simulate OOM
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct QCrtDebugRegistrator
|
static struct QCrtDebugRegistrator
|
||||||
|
@ -1060,7 +1060,7 @@ void tst_QAccessibility::buttonTest()
|
|||||||
|
|
||||||
// tristate checkbox
|
// tristate checkbox
|
||||||
QCheckBox tristate("Tristate!", &window);
|
QCheckBox tristate("Tristate!", &window);
|
||||||
tristate.setTristate(TRUE);
|
tristate.setTristate(true);
|
||||||
|
|
||||||
// radiobutton
|
// radiobutton
|
||||||
QRadioButton radio("Radio me!", &window);
|
QRadioButton radio("Radio me!", &window);
|
||||||
|
@ -73,14 +73,14 @@ protected:
|
|||||||
QLineEdit::focusInEvent( e );
|
QLineEdit::focusInEvent( e );
|
||||||
focusInEventReason = e->reason();
|
focusInEventReason = e->reason();
|
||||||
focusInEventGotFocus = e->gotFocus();
|
focusInEventGotFocus = e->gotFocus();
|
||||||
focusInEventRecieved = TRUE;
|
focusInEventRecieved = true;
|
||||||
}
|
}
|
||||||
void focusOutEvent( QFocusEvent* e )
|
void focusOutEvent( QFocusEvent* e )
|
||||||
{
|
{
|
||||||
QLineEdit::focusOutEvent( e );
|
QLineEdit::focusOutEvent( e );
|
||||||
focusOutEventReason = e->reason();
|
focusOutEventReason = e->reason();
|
||||||
focusOutEventLostFocus = !e->gotFocus();
|
focusOutEventLostFocus = !e->gotFocus();
|
||||||
focusOutEventRecieved = TRUE;
|
focusOutEventRecieved = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -173,17 +173,17 @@ void tst_QFocusEvent::initWidget()
|
|||||||
// The first lineedit should have focus
|
// The first lineedit should have focus
|
||||||
QVERIFY( childFocusWidgetOne->hasFocus() );
|
QVERIFY( childFocusWidgetOne->hasFocus() );
|
||||||
|
|
||||||
childFocusWidgetOne->focusInEventRecieved = FALSE;
|
childFocusWidgetOne->focusInEventRecieved = false;
|
||||||
childFocusWidgetOne->focusInEventGotFocus = FALSE;
|
childFocusWidgetOne->focusInEventGotFocus = false;
|
||||||
childFocusWidgetOne->focusInEventReason = -1;
|
childFocusWidgetOne->focusInEventReason = -1;
|
||||||
childFocusWidgetOne->focusOutEventRecieved = FALSE;
|
childFocusWidgetOne->focusOutEventRecieved = false;
|
||||||
childFocusWidgetOne->focusOutEventLostFocus = FALSE;
|
childFocusWidgetOne->focusOutEventLostFocus = false;
|
||||||
childFocusWidgetOne->focusOutEventReason = -1;
|
childFocusWidgetOne->focusOutEventReason = -1;
|
||||||
childFocusWidgetTwo->focusInEventRecieved = FALSE;
|
childFocusWidgetTwo->focusInEventRecieved = false;
|
||||||
childFocusWidgetTwo->focusInEventGotFocus = FALSE;
|
childFocusWidgetTwo->focusInEventGotFocus = false;
|
||||||
childFocusWidgetTwo->focusInEventReason = -1;
|
childFocusWidgetTwo->focusInEventReason = -1;
|
||||||
childFocusWidgetTwo->focusOutEventRecieved = FALSE;
|
childFocusWidgetTwo->focusOutEventRecieved = false;
|
||||||
childFocusWidgetTwo->focusOutEventLostFocus = FALSE;
|
childFocusWidgetTwo->focusOutEventLostFocus = false;
|
||||||
childFocusWidgetTwo->focusOutEventReason = -1;
|
childFocusWidgetTwo->focusOutEventReason = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,10 +170,10 @@ void tst_QDialog::showExtension_data()
|
|||||||
QTest::addColumn<QSize>("result");
|
QTest::addColumn<QSize>("result");
|
||||||
|
|
||||||
//next we fill it with data
|
//next we fill it with data
|
||||||
QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << (bool)FALSE << QSize(100,150);
|
QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << false << QSize(100,150);
|
||||||
QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << (bool)FALSE << QSize(120,150);
|
QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << false << QSize(120,150);
|
||||||
QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << (bool)TRUE << QSize(150,100);
|
QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << true << QSize(150,100);
|
||||||
QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << (bool)TRUE << QSize(150,120);
|
QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << true << QSize(150,120);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDialog::showExtension()
|
void tst_QDialog::showExtension()
|
||||||
@ -193,7 +193,7 @@ void tst_QDialog::showExtension()
|
|||||||
QPoint oldPosition = testWidget->pos();
|
QPoint oldPosition = testWidget->pos();
|
||||||
|
|
||||||
// show
|
// show
|
||||||
((DummyDialog*)testWidget)->showExtension( TRUE );
|
((DummyDialog*)testWidget)->showExtension( true );
|
||||||
// while ( testWidget->size() == dlgSize )
|
// while ( testWidget->size() == dlgSize )
|
||||||
// qApp->processEvents();
|
// qApp->processEvents();
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ void tst_QDialog::showExtension()
|
|||||||
QCOMPARE(testWidget->pos(), oldPosition);
|
QCOMPARE(testWidget->pos(), oldPosition);
|
||||||
|
|
||||||
// hide extension. back to old size ?
|
// hide extension. back to old size ?
|
||||||
((DummyDialog*)testWidget)->showExtension( FALSE );
|
((DummyDialog*)testWidget)->showExtension( false );
|
||||||
QCOMPARE( testWidget->size(), dlgSize );
|
QCOMPARE( testWidget->size(), dlgSize );
|
||||||
|
|
||||||
testWidget->setExtension( 0 );
|
testWidget->setExtension( 0 );
|
||||||
@ -214,14 +214,14 @@ void tst_QDialog::defaultButtons()
|
|||||||
QPushButton *push = new QPushButton("Button 1", testWidget);
|
QPushButton *push = new QPushButton("Button 1", testWidget);
|
||||||
QPushButton *pushTwo = new QPushButton("Button 2", testWidget);
|
QPushButton *pushTwo = new QPushButton("Button 2", testWidget);
|
||||||
QPushButton *pushThree = new QPushButton("Button 3", 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
|
//we need to show the buttons. Otherwise they won't get the focus
|
||||||
push->show();
|
push->show();
|
||||||
pushTwo->show();
|
pushTwo->show();
|
||||||
pushThree->show();
|
pushThree->show();
|
||||||
|
|
||||||
push->setDefault(TRUE);
|
push->setDefault(true);
|
||||||
QVERIFY(push->isDefault());
|
QVERIFY(push->isDefault());
|
||||||
|
|
||||||
pushTwo->setFocus();
|
pushTwo->setFocus();
|
||||||
@ -231,7 +231,7 @@ void tst_QDialog::defaultButtons()
|
|||||||
lineEdit->setFocus();
|
lineEdit->setFocus();
|
||||||
QVERIFY(push->isDefault());
|
QVERIFY(push->isDefault());
|
||||||
|
|
||||||
pushTwo->setDefault(TRUE);
|
pushTwo->setDefault(true);
|
||||||
QVERIFY(pushTwo->isDefault());
|
QVERIFY(pushTwo->isDefault());
|
||||||
|
|
||||||
pushTwo->setFocus();
|
pushTwo->setFocus();
|
||||||
|
@ -119,10 +119,10 @@ void tst_QFontDialog::postKeyReturn() {
|
|||||||
|
|
||||||
void tst_QFontDialog::defaultOkButton()
|
void tst_QFontDialog::defaultOkButton()
|
||||||
{
|
{
|
||||||
bool ok = FALSE;
|
bool ok = false;
|
||||||
QTimer::singleShot(2000, this, SLOT(postKeyReturn()));
|
QTimer::singleShot(2000, this, SLOT(postKeyReturn()));
|
||||||
QFontDialog::getFont(&ok);
|
QFontDialog::getFont(&ok);
|
||||||
QVERIFY(ok == TRUE);
|
QVERIFY(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ void tst_QFontDialog::setFont()
|
|||||||
while the font dialog was open.
|
while the font dialog was open.
|
||||||
Task #27662
|
Task #27662
|
||||||
*/
|
*/
|
||||||
bool ok = FALSE;
|
bool ok = false;
|
||||||
#if defined Q_OS_HPUX
|
#if defined Q_OS_HPUX
|
||||||
QString fontName = "Courier";
|
QString fontName = "Courier";
|
||||||
int fontSize = 25;
|
int fontSize = 25;
|
||||||
|
@ -726,7 +726,7 @@ void BezierViewer::paintEvent( QPaintEvent* )
|
|||||||
|
|
||||||
/* Write number of vertices */
|
/* Write number of vertices */
|
||||||
painter.setPen( Qt::red );
|
painter.setPen( Qt::red );
|
||||||
painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, TRUE ) );
|
painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, true ) );
|
||||||
QString caption;
|
QString caption;
|
||||||
caption.setNum( bezier.size() );
|
caption.setNum( bezier.size() );
|
||||||
caption += QString::fromLatin1( " vertices" );
|
caption += QString::fromLatin1( " vertices" );
|
||||||
@ -759,24 +759,24 @@ void tst_QWidget::fontPropagation()
|
|||||||
childWidget->show();
|
childWidget->show();
|
||||||
QCOMPARE( font, childWidget->font() );
|
QCOMPARE( font, childWidget->font() );
|
||||||
|
|
||||||
font.setBold( TRUE );
|
font.setBold( true );
|
||||||
testWidget->setFont( font );
|
testWidget->setFont( font );
|
||||||
QCOMPARE( font, testWidget->font() );
|
QCOMPARE( font, testWidget->font() );
|
||||||
QCOMPARE( font, childWidget->font() );
|
QCOMPARE( font, childWidget->font() );
|
||||||
|
|
||||||
QFont newFont = font;
|
QFont newFont = font;
|
||||||
newFont.setItalic( TRUE );
|
newFont.setItalic( true );
|
||||||
childWidget->setFont( newFont );
|
childWidget->setFont( newFont );
|
||||||
QWidget* grandChildWidget = new QWidget( childWidget );
|
QWidget* grandChildWidget = new QWidget( childWidget );
|
||||||
QCOMPARE( font, testWidget->font() );
|
QCOMPARE( font, testWidget->font() );
|
||||||
QCOMPARE( newFont, grandChildWidget->font() );
|
QCOMPARE( newFont, grandChildWidget->font() );
|
||||||
|
|
||||||
font.setUnderline( TRUE );
|
font.setUnderline( true );
|
||||||
testWidget->setFont( font );
|
testWidget->setFont( font );
|
||||||
|
|
||||||
// the child and grand child should now have merged bold and
|
// the child and grand child should now have merged bold and
|
||||||
// underline
|
// underline
|
||||||
newFont.setUnderline( TRUE );
|
newFont.setUnderline( true );
|
||||||
|
|
||||||
QCOMPARE( newFont, childWidget->font() );
|
QCOMPARE( newFont, childWidget->font() );
|
||||||
QCOMPARE( newFont, grandChildWidget->font() );
|
QCOMPARE( newFont, grandChildWidget->font() );
|
||||||
@ -1074,32 +1074,32 @@ void tst_QWidget::enabledPropagation()
|
|||||||
QVERIFY( testWidget->isEnabled() );
|
QVERIFY( testWidget->isEnabled() );
|
||||||
QVERIFY( childWidget->isEnabled() );
|
QVERIFY( childWidget->isEnabled() );
|
||||||
|
|
||||||
testWidget->setEnabled( FALSE );
|
testWidget->setEnabled( false );
|
||||||
QVERIFY( !testWidget->isEnabled() );
|
QVERIFY( !testWidget->isEnabled() );
|
||||||
QVERIFY( !childWidget->isEnabled() );
|
QVERIFY( !childWidget->isEnabled() );
|
||||||
|
|
||||||
testWidget->setDisabled( FALSE );
|
testWidget->setDisabled( false );
|
||||||
QVERIFY( testWidget->isEnabled() );
|
QVERIFY( testWidget->isEnabled() );
|
||||||
QVERIFY( childWidget->isEnabled() );
|
QVERIFY( childWidget->isEnabled() );
|
||||||
|
|
||||||
QWidget* grandChildWidget = new QWidget( childWidget );
|
QWidget* grandChildWidget = new QWidget( childWidget );
|
||||||
QVERIFY( grandChildWidget->isEnabled() );
|
QVERIFY( grandChildWidget->isEnabled() );
|
||||||
|
|
||||||
testWidget->setDisabled( TRUE );
|
testWidget->setDisabled( true );
|
||||||
QVERIFY( !testWidget->isEnabled() );
|
QVERIFY( !testWidget->isEnabled() );
|
||||||
QVERIFY( !childWidget->isEnabled() );
|
QVERIFY( !childWidget->isEnabled() );
|
||||||
QVERIFY( !grandChildWidget->isEnabled() );
|
QVERIFY( !grandChildWidget->isEnabled() );
|
||||||
|
|
||||||
grandChildWidget->setEnabled( FALSE );
|
grandChildWidget->setEnabled( false );
|
||||||
testWidget->setEnabled( TRUE );
|
testWidget->setEnabled( true );
|
||||||
QVERIFY( testWidget->isEnabled() );
|
QVERIFY( testWidget->isEnabled() );
|
||||||
QVERIFY( childWidget->isEnabled() );
|
QVERIFY( childWidget->isEnabled() );
|
||||||
QVERIFY( !grandChildWidget->isEnabled() );
|
QVERIFY( !grandChildWidget->isEnabled() );
|
||||||
|
|
||||||
grandChildWidget->setEnabled( TRUE );
|
grandChildWidget->setEnabled( true );
|
||||||
testWidget->setEnabled( FALSE );
|
testWidget->setEnabled( false );
|
||||||
childWidget->setDisabled( TRUE );
|
childWidget->setDisabled( true );
|
||||||
testWidget->setEnabled( TRUE );
|
testWidget->setEnabled( true );
|
||||||
QVERIFY( testWidget->isEnabled() );
|
QVERIFY( testWidget->isEnabled() );
|
||||||
QVERIFY( !childWidget->isEnabled() );
|
QVERIFY( !childWidget->isEnabled() );
|
||||||
QVERIFY( !grandChildWidget->isEnabled() );
|
QVERIFY( !grandChildWidget->isEnabled() );
|
||||||
@ -1162,7 +1162,7 @@ void tst_QWidget::isEnabledTo()
|
|||||||
QVERIFY( childWidget->isEnabledTo( testWidget ) );
|
QVERIFY( childWidget->isEnabledTo( testWidget ) );
|
||||||
QVERIFY( grandChildWidget->isEnabledTo( testWidget ) );
|
QVERIFY( grandChildWidget->isEnabledTo( testWidget ) );
|
||||||
|
|
||||||
childWidget->setEnabled( FALSE );
|
childWidget->setEnabled( false );
|
||||||
QVERIFY( !childWidget->isEnabledTo( testWidget ) );
|
QVERIFY( !childWidget->isEnabledTo( testWidget ) );
|
||||||
QVERIFY( grandChildWidget->isEnabledTo( childWidget ) );
|
QVERIFY( grandChildWidget->isEnabledTo( childWidget ) );
|
||||||
QVERIFY( !grandChildWidget->isEnabledTo( testWidget ) );
|
QVERIFY( !grandChildWidget->isEnabledTo( testWidget ) );
|
||||||
@ -1245,7 +1245,7 @@ void tst_QWidget::visible_setWindowOpacity()
|
|||||||
QVERIFY( !testWidget->isVisible() );
|
QVERIFY( !testWidget->isVisible() );
|
||||||
testWidget->setWindowOpacity(0.5);
|
testWidget->setWindowOpacity(0.5);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
QVERIFY(::IsWindowVisible(winHandleOf(testWidget)) == FALSE);
|
QVERIFY(!::IsWindowVisible(winHandleOf(testWidget)));
|
||||||
#endif
|
#endif
|
||||||
testWidget->setWindowOpacity(1.0);
|
testWidget->setWindowOpacity(1.0);
|
||||||
}
|
}
|
||||||
@ -1638,12 +1638,12 @@ public:
|
|||||||
|
|
||||||
void tab()
|
void tab()
|
||||||
{
|
{
|
||||||
focusNextPrevChild(TRUE);
|
focusNextPrevChild(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void backTab()
|
void backTab()
|
||||||
{
|
{
|
||||||
focusNextPrevChild(FALSE);
|
focusNextPrevChild(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -182,9 +182,9 @@ void tst_QAbstractButton::cleanupTestCase()
|
|||||||
void tst_QAbstractButton::init()
|
void tst_QAbstractButton::init()
|
||||||
{
|
{
|
||||||
testWidget->setText("Test");
|
testWidget->setText("Test");
|
||||||
testWidget->setEnabled( TRUE );
|
testWidget->setEnabled( true );
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QKeySequence seq;
|
QKeySequence seq;
|
||||||
testWidget->setShortcut( seq );
|
testWidget->setShortcut( seq );
|
||||||
|
|
||||||
@ -257,16 +257,16 @@ void tst_QAbstractButton::setAutoRepeat()
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// check if we can toggle the mode
|
// check if we can toggle the mode
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QVERIFY( testWidget->autoRepeat() );
|
QVERIFY( testWidget->autoRepeat() );
|
||||||
|
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QVERIFY( !testWidget->autoRepeat() );
|
QVERIFY( !testWidget->autoRepeat() );
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// check that the button is down if we press space and not in autorepeat
|
// check that the button is down if we press space and not in autorepeat
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Space );
|
QTest::keyPress( testWidget, Qt::Key_Space );
|
||||||
|
|
||||||
QTest::qWait( REPEAT_DELAY );
|
QTest::qWait( REPEAT_DELAY );
|
||||||
@ -295,9 +295,9 @@ void tst_QAbstractButton::setAutoRepeat()
|
|||||||
QVERIFY(click_count > 1);
|
QVERIFY(click_count > 1);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
// check that pressing ENTER has no effect when autorepeat is FALSE
|
// check that pressing ENTER has no effect when autorepeat is false
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Enter );
|
QTest::keyPress( testWidget, Qt::Key_Enter );
|
||||||
|
|
||||||
QTest::qWait( REPEAT_DELAY );
|
QTest::qWait( REPEAT_DELAY );
|
||||||
@ -312,9 +312,9 @@ void tst_QAbstractButton::setAutoRepeat()
|
|||||||
QVERIFY( click_count == 0 );
|
QVERIFY( click_count == 0 );
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
// check that pressing ENTER has no effect when autorepeat is TRUE
|
// check that pressing ENTER has no effect when autorepeat is true
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Enter );
|
QTest::keyPress( testWidget, Qt::Key_Enter );
|
||||||
|
|
||||||
QTest::qWait( REPEAT_DELAY );
|
QTest::qWait( REPEAT_DELAY );
|
||||||
@ -427,11 +427,11 @@ void tst_QAbstractButton::setIcon()
|
|||||||
|
|
||||||
void tst_QAbstractButton::setEnabled()
|
void tst_QAbstractButton::setEnabled()
|
||||||
{
|
{
|
||||||
testWidget->setEnabled( FALSE );
|
testWidget->setEnabled( false );
|
||||||
QVERIFY( !testWidget->isEnabled() );
|
QVERIFY( !testWidget->isEnabled() );
|
||||||
// QTEST( testWidget, "disabled" );
|
// QTEST( testWidget, "disabled" );
|
||||||
|
|
||||||
testWidget->setEnabled( TRUE );
|
testWidget->setEnabled( true );
|
||||||
QVERIFY( testWidget->isEnabled() );
|
QVERIFY( testWidget->isEnabled() );
|
||||||
// QTEST( testWidget, "enabled" );
|
// QTEST( testWidget, "enabled" );
|
||||||
}
|
}
|
||||||
@ -443,14 +443,14 @@ void tst_QAbstractButton::isCheckable()
|
|||||||
|
|
||||||
void tst_QAbstractButton::setDown()
|
void tst_QAbstractButton::setDown()
|
||||||
{
|
{
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QTest::qWait(300);
|
QTest::qWait(300);
|
||||||
QVERIFY( testWidget->isDown() );
|
QVERIFY( testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
|
|
||||||
// add some debugging stuff
|
// add some debugging stuff
|
||||||
QWidget *grab = QWidget::keyboardGrabber();
|
QWidget *grab = QWidget::keyboardGrabber();
|
||||||
@ -466,13 +466,13 @@ void tst_QAbstractButton::setDown()
|
|||||||
|
|
||||||
void tst_QAbstractButton::isChecked()
|
void tst_QAbstractButton::isChecked()
|
||||||
{
|
{
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->toggle();
|
testWidget->toggle();
|
||||||
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
|
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
|
||||||
}
|
}
|
||||||
|
@ -121,9 +121,9 @@ void tst_QCheckBox::cleanupTestCase()
|
|||||||
|
|
||||||
void tst_QCheckBox::init()
|
void tst_QCheckBox::init()
|
||||||
{
|
{
|
||||||
testWidget->setTristate( FALSE );
|
testWidget->setTristate( false );
|
||||||
testWidget->setChecked( FALSE );
|
testWidget->setChecked( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QCheckBox::cleanup()
|
void tst_QCheckBox::cleanup()
|
||||||
@ -158,17 +158,17 @@ void tst_QCheckBox::onToggled( bool /*on*/ )
|
|||||||
|
|
||||||
void tst_QCheckBox::setChecked()
|
void tst_QCheckBox::setChecked()
|
||||||
{
|
{
|
||||||
testWidget->setChecked( TRUE );
|
testWidget->setChecked( true );
|
||||||
QVERIFY( testWidget->isChecked() );
|
QVERIFY( testWidget->isChecked() );
|
||||||
QVERIFY( testWidget->isChecked() );
|
QVERIFY( testWidget->isChecked() );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Checked );
|
QVERIFY( testWidget->checkState() == Qt::Checked );
|
||||||
|
|
||||||
testWidget->setChecked( FALSE );
|
testWidget->setChecked( false );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
||||||
|
|
||||||
testWidget->setChecked( FALSE );
|
testWidget->setChecked( false );
|
||||||
QTest::keyClick( testWidget, ' ' );
|
QTest::keyClick( testWidget, ' ' );
|
||||||
QVERIFY( testWidget->isChecked() );
|
QVERIFY( testWidget->isChecked() );
|
||||||
|
|
||||||
@ -178,34 +178,34 @@ void tst_QCheckBox::setChecked()
|
|||||||
|
|
||||||
void tst_QCheckBox::setTriState()
|
void tst_QCheckBox::setTriState()
|
||||||
{
|
{
|
||||||
testWidget->setTristate( TRUE );
|
testWidget->setTristate( true );
|
||||||
QVERIFY( testWidget->isTristate() );
|
QVERIFY( testWidget->isTristate() );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
||||||
|
|
||||||
testWidget->setCheckState(Qt::PartiallyChecked);
|
testWidget->setCheckState(Qt::PartiallyChecked);
|
||||||
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
|
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
|
||||||
|
|
||||||
testWidget->setChecked( TRUE );
|
testWidget->setChecked( true );
|
||||||
QVERIFY( testWidget->isChecked() );
|
QVERIFY( testWidget->isChecked() );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Checked );
|
QVERIFY( testWidget->checkState() == Qt::Checked );
|
||||||
|
|
||||||
testWidget->setChecked( FALSE );
|
testWidget->setChecked( false );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
||||||
|
|
||||||
testWidget->setCheckState(Qt::PartiallyChecked);
|
testWidget->setCheckState(Qt::PartiallyChecked);
|
||||||
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
|
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
|
||||||
|
|
||||||
testWidget->setTristate( FALSE );
|
testWidget->setTristate( false );
|
||||||
QVERIFY( !testWidget->isTristate() );
|
QVERIFY( !testWidget->isTristate() );
|
||||||
|
|
||||||
testWidget->setCheckState(Qt::PartiallyChecked);
|
testWidget->setCheckState(Qt::PartiallyChecked);
|
||||||
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
|
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
|
||||||
|
|
||||||
testWidget->setChecked( TRUE );
|
testWidget->setChecked( true );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Checked );
|
QVERIFY( testWidget->checkState() == Qt::Checked );
|
||||||
|
|
||||||
testWidget->setChecked( FALSE );
|
testWidget->setChecked( false );
|
||||||
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
QVERIFY( testWidget->checkState() == Qt::Unchecked );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,10 +237,10 @@ void tst_QCheckBox::setText()
|
|||||||
|
|
||||||
void tst_QCheckBox::setDown()
|
void tst_QCheckBox::setDown()
|
||||||
{
|
{
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QVERIFY( testWidget->isDown() );
|
QVERIFY( testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ void tst_QCheckBox::pressed()
|
|||||||
connect(testWidget, SIGNAL(released()), this, SLOT(onReleased()));
|
connect(testWidget, SIGNAL(released()), this, SLOT(onReleased()));
|
||||||
press_count = 0;
|
press_count = 0;
|
||||||
release_count = 0;
|
release_count = 0;
|
||||||
testWidget->setDown(FALSE);
|
testWidget->setDown(false);
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
QTest::keyPress( testWidget, Qt::Key_Space );
|
QTest::keyPress( testWidget, Qt::Key_Space );
|
||||||
@ -315,12 +315,12 @@ void tst_QCheckBox::stateChanged()
|
|||||||
QSignalSpy stateChangedSpy(testWidget, SIGNAL(stateChanged(int)));
|
QSignalSpy stateChangedSpy(testWidget, SIGNAL(stateChanged(int)));
|
||||||
connect(testWidget, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
|
connect(testWidget, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
|
||||||
cur_state = -1;
|
cur_state = -1;
|
||||||
testWidget->setChecked( TRUE );
|
testWidget->setChecked( true );
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
QCOMPARE( cur_state, (int)2 );
|
QCOMPARE( cur_state, (int)2 );
|
||||||
|
|
||||||
cur_state = -1;
|
cur_state = -1;
|
||||||
testWidget->setChecked( FALSE );
|
testWidget->setChecked( false );
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
QCOMPARE( cur_state, (int)0 );
|
QCOMPARE( cur_state, (int)0 );
|
||||||
|
|
||||||
|
@ -154,11 +154,11 @@ void tst_QCommandLinkButton::cleanupTestCase()
|
|||||||
|
|
||||||
void tst_QCommandLinkButton::init()
|
void tst_QCommandLinkButton::init()
|
||||||
{
|
{
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setText("Test");
|
testWidget->setText("Test");
|
||||||
testWidget->setDescription("Description text.");
|
testWidget->setDescription("Description text.");
|
||||||
testWidget->setEnabled( TRUE );
|
testWidget->setEnabled( true );
|
||||||
QKeySequence seq;
|
QKeySequence seq;
|
||||||
testWidget->setShortcut( seq );
|
testWidget->setShortcut( seq );
|
||||||
|
|
||||||
@ -215,17 +215,17 @@ void tst_QCommandLinkButton::setAutoRepeat()
|
|||||||
QVERIFY( !tmp.autoRepeat() );
|
QVERIFY( !tmp.autoRepeat() );
|
||||||
|
|
||||||
// check if we can toggle the mode
|
// check if we can toggle the mode
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QVERIFY( testWidget->autoRepeat() );
|
QVERIFY( testWidget->autoRepeat() );
|
||||||
|
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QVERIFY( !testWidget->autoRepeat() );
|
QVERIFY( !testWidget->autoRepeat() );
|
||||||
|
|
||||||
resetCounters();
|
resetCounters();
|
||||||
|
|
||||||
// check that the button is down if we press space and not in autorepeat
|
// check that the button is down if we press space and not in autorepeat
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Space );
|
QTest::keyPress( testWidget, Qt::Key_Space );
|
||||||
|
|
||||||
QTest::qWait( 300 );
|
QTest::qWait( 300 );
|
||||||
@ -242,8 +242,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
|
|||||||
// check that the button is down if we press space while in 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.
|
// we can't actually confirm how many times it is fired, more than 1 is enough.
|
||||||
|
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Space );
|
QTest::keyPress( testWidget, Qt::Key_Space );
|
||||||
QTest::qWait(900);
|
QTest::qWait(900);
|
||||||
QVERIFY( testWidget->isDown() );
|
QVERIFY( testWidget->isDown() );
|
||||||
@ -257,8 +257,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
|
|||||||
|
|
||||||
// check that pressing ENTER has no effect
|
// check that pressing ENTER has no effect
|
||||||
resetCounters();
|
resetCounters();
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Enter );
|
QTest::keyPress( testWidget, Qt::Key_Enter );
|
||||||
|
|
||||||
QTest::qWait( 300 );
|
QTest::qWait( 300 );
|
||||||
@ -272,8 +272,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
|
|||||||
|
|
||||||
// check that pressing ENTER has no effect
|
// check that pressing ENTER has no effect
|
||||||
resetCounters();
|
resetCounters();
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QTest::keyClick( testWidget, Qt::Key_Enter );
|
QTest::keyClick( testWidget, Qt::Key_Enter );
|
||||||
QTest::qWait( 300 );
|
QTest::qWait( 300 );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
@ -318,26 +318,26 @@ void tst_QCommandLinkButton::isCheckable()
|
|||||||
|
|
||||||
void tst_QCommandLinkButton::setDown()
|
void tst_QCommandLinkButton::setDown()
|
||||||
{
|
{
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QVERIFY( testWidget->isDown() );
|
QVERIFY( testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QTest::keyClick( testWidget, Qt::Key_Escape );
|
QTest::keyClick( testWidget, Qt::Key_Escape );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QCommandLinkButton::isChecked()
|
void tst_QCommandLinkButton::isChecked()
|
||||||
{
|
{
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->toggle();
|
testWidget->toggle();
|
||||||
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
|
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
|
||||||
}
|
}
|
||||||
@ -346,7 +346,7 @@ void tst_QCommandLinkButton::toggle()
|
|||||||
{
|
{
|
||||||
// the pushbutton shouldn't toggle the button.
|
// the pushbutton shouldn't toggle the button.
|
||||||
testWidget->toggle();
|
testWidget->toggle();
|
||||||
QVERIFY( testWidget->isChecked() == FALSE );
|
QVERIFY(!testWidget->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QCommandLinkButton::toggled()
|
void tst_QCommandLinkButton::toggled()
|
||||||
@ -432,7 +432,7 @@ void tst_QCommandLinkButton::clicked()
|
|||||||
|
|
||||||
press_count = 0;
|
press_count = 0;
|
||||||
release_count = 0;
|
release_count = 0;
|
||||||
testWidget->setDown(FALSE);
|
testWidget->setDown(false);
|
||||||
for (uint i=0; i<10; i++)
|
for (uint i=0; i<10; i++)
|
||||||
QTest::mouseClick( testWidget, Qt::LeftButton );
|
QTest::mouseClick( testWidget, Qt::LeftButton );
|
||||||
QCOMPARE( press_count, (uint)10 );
|
QCOMPARE( press_count, (uint)10 );
|
||||||
|
@ -181,7 +181,7 @@ void tst_QLabel::init()
|
|||||||
testWidget->setBuddy( 0 );
|
testWidget->setBuddy( 0 );
|
||||||
testWidget->setIndent( 0 );
|
testWidget->setIndent( 0 );
|
||||||
testWidget->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
testWidget->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||||
testWidget->setScaledContents( FALSE );
|
testWidget->setScaledContents( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QLabel::cleanup()
|
void tst_QLabel::cleanup()
|
||||||
|
@ -722,7 +722,7 @@ void tst_QMenuBar::check_homeKey()
|
|||||||
{
|
{
|
||||||
// I'm temporarily shutting up this testcase.
|
// I'm temporarily shutting up this testcase.
|
||||||
// Seems like the behaviour i'm expecting isn't ok.
|
// Seems like the behaviour i'm expecting isn't ok.
|
||||||
QVERIFY( TRUE );
|
QVERIFY( true );
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QEXPECT_FAIL( "0", "Popupmenu should respond to a Home key", Abort );
|
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.
|
// I'm temporarily silenting this testcase.
|
||||||
// Seems like the behaviour i'm expecting isn't ok.
|
// Seems like the behaviour i'm expecting isn't ok.
|
||||||
QVERIFY( TRUE );
|
QVERIFY( true );
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QEXPECT_FAIL( "0", "Popupmenu should respond to an End key", Abort );
|
QEXPECT_FAIL( "0", "Popupmenu should respond to an End key", Abort );
|
||||||
|
@ -152,10 +152,10 @@ void tst_QPushButton::cleanupTestCase()
|
|||||||
|
|
||||||
void tst_QPushButton::init()
|
void tst_QPushButton::init()
|
||||||
{
|
{
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setText("Test");
|
testWidget->setText("Test");
|
||||||
testWidget->setEnabled( TRUE );
|
testWidget->setEnabled( true );
|
||||||
QKeySequence seq;
|
QKeySequence seq;
|
||||||
testWidget->setShortcut( seq );
|
testWidget->setShortcut( seq );
|
||||||
|
|
||||||
@ -206,17 +206,17 @@ void tst_QPushButton::autoRepeat()
|
|||||||
QVERIFY( !tmp.autoRepeat() );
|
QVERIFY( !tmp.autoRepeat() );
|
||||||
|
|
||||||
// check if we can toggle the mode
|
// check if we can toggle the mode
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QVERIFY( testWidget->autoRepeat() );
|
QVERIFY( testWidget->autoRepeat() );
|
||||||
|
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QVERIFY( !testWidget->autoRepeat() );
|
QVERIFY( !testWidget->autoRepeat() );
|
||||||
|
|
||||||
resetCounters();
|
resetCounters();
|
||||||
|
|
||||||
// check that the button is down if we press space and not in autorepeat
|
// check that the button is down if we press space and not in autorepeat
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Space );
|
QTest::keyPress( testWidget, Qt::Key_Space );
|
||||||
|
|
||||||
QTest::qWait( 300 );
|
QTest::qWait( 300 );
|
||||||
@ -233,8 +233,8 @@ void tst_QPushButton::autoRepeat()
|
|||||||
// check that the button is down if we press space while in 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.
|
// we can't actually confirm how many times it is fired, more than 1 is enough.
|
||||||
|
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Space );
|
QTest::keyPress( testWidget, Qt::Key_Space );
|
||||||
QTest::qWait(900);
|
QTest::qWait(900);
|
||||||
QVERIFY( testWidget->isDown() );
|
QVERIFY( testWidget->isDown() );
|
||||||
@ -248,8 +248,8 @@ void tst_QPushButton::autoRepeat()
|
|||||||
|
|
||||||
// check that pressing ENTER has no effect
|
// check that pressing ENTER has no effect
|
||||||
resetCounters();
|
resetCounters();
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( FALSE );
|
testWidget->setAutoRepeat( false );
|
||||||
QTest::keyPress( testWidget, Qt::Key_Enter );
|
QTest::keyPress( testWidget, Qt::Key_Enter );
|
||||||
|
|
||||||
QTest::qWait( 300 );
|
QTest::qWait( 300 );
|
||||||
@ -263,8 +263,8 @@ void tst_QPushButton::autoRepeat()
|
|||||||
|
|
||||||
// check that pressing ENTER has no effect
|
// check that pressing ENTER has no effect
|
||||||
resetCounters();
|
resetCounters();
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->setAutoRepeat( TRUE );
|
testWidget->setAutoRepeat( true );
|
||||||
QTest::keyClick( testWidget, Qt::Key_Enter );
|
QTest::keyClick( testWidget, Qt::Key_Enter );
|
||||||
QTest::qWait( 300 );
|
QTest::qWait( 300 );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
@ -307,26 +307,26 @@ void tst_QPushButton::isCheckable()
|
|||||||
|
|
||||||
void tst_QPushButton::setDown()
|
void tst_QPushButton::setDown()
|
||||||
{
|
{
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QVERIFY( testWidget->isDown() );
|
QVERIFY( testWidget->isDown() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QTest::keyClick( testWidget, Qt::Key_Escape );
|
QTest::keyClick( testWidget, Qt::Key_Escape );
|
||||||
QVERIFY( !testWidget->isDown() );
|
QVERIFY( !testWidget->isDown() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QPushButton::isChecked()
|
void tst_QPushButton::isChecked()
|
||||||
{
|
{
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
testWidget->setDown( TRUE );
|
testWidget->setDown( true );
|
||||||
QVERIFY( !testWidget->isChecked() );
|
QVERIFY( !testWidget->isChecked() );
|
||||||
|
|
||||||
testWidget->setDown( FALSE );
|
testWidget->setDown( false );
|
||||||
testWidget->toggle();
|
testWidget->toggle();
|
||||||
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
|
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ void tst_QPushButton::toggle()
|
|||||||
{
|
{
|
||||||
// the pushbutton shouldn't toggle the button.
|
// the pushbutton shouldn't toggle the button.
|
||||||
testWidget->toggle();
|
testWidget->toggle();
|
||||||
QVERIFY( testWidget->isChecked() == FALSE );
|
QVERIFY( testWidget->isChecked() == false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QPushButton::toggled()
|
void tst_QPushButton::toggled()
|
||||||
@ -421,7 +421,7 @@ void tst_QPushButton::clicked()
|
|||||||
|
|
||||||
press_count = 0;
|
press_count = 0;
|
||||||
release_count = 0;
|
release_count = 0;
|
||||||
testWidget->setDown(FALSE);
|
testWidget->setDown(false);
|
||||||
for (uint i=0; i<10; i++)
|
for (uint i=0; i<10; i++)
|
||||||
QTest::mouseClick( testWidget, Qt::LeftButton );
|
QTest::mouseClick( testWidget, Qt::LeftButton );
|
||||||
QCOMPARE( press_count, (uint)10 );
|
QCOMPARE( press_count, (uint)10 );
|
||||||
|
@ -273,23 +273,23 @@ void tst_QToolBox::change()
|
|||||||
QCOMPARE( currentIndex, 1 );
|
QCOMPARE( currentIndex, 1 );
|
||||||
QCOMPARE( testWidget->currentIndex(), 1 );
|
QCOMPARE( testWidget->currentIndex(), 1 );
|
||||||
|
|
||||||
testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
|
testWidget->setItemEnabled( testWidget->currentIndex(), false );
|
||||||
QCOMPARE( currentIndex, 2 );
|
QCOMPARE( currentIndex, 2 );
|
||||||
QCOMPARE( testWidget->currentIndex(), 2 );
|
QCOMPARE( testWidget->currentIndex(), 2 );
|
||||||
|
|
||||||
currentIndex = -1;
|
currentIndex = -1;
|
||||||
testWidget->setItemEnabled( testWidget->indexOf(lastItem), FALSE );
|
testWidget->setItemEnabled( testWidget->indexOf(lastItem), false );
|
||||||
QCOMPARE( currentIndex, -1 );
|
QCOMPARE( currentIndex, -1 );
|
||||||
QCOMPARE( testWidget->currentIndex(), 2 );
|
QCOMPARE( testWidget->currentIndex(), 2 );
|
||||||
|
|
||||||
testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
|
testWidget->setItemEnabled( testWidget->currentIndex(), false );
|
||||||
QCOMPARE( currentIndex, 0 );
|
QCOMPARE( currentIndex, 0 );
|
||||||
|
|
||||||
currentIndex = -1;
|
currentIndex = -1;
|
||||||
testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
|
testWidget->setItemEnabled( testWidget->currentIndex(), false );
|
||||||
QCOMPARE( currentIndex, -1 );
|
QCOMPARE( currentIndex, -1 );
|
||||||
|
|
||||||
testWidget->setItemEnabled( 1, TRUE );
|
testWidget->setItemEnabled( 1, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QToolBox::clear()
|
void tst_QToolBox::clear()
|
||||||
|
@ -303,7 +303,7 @@ void tst_QWorkspace::windowActivatedWithMinimize()
|
|||||||
|
|
||||||
void tst_QWorkspace::accelActivated()
|
void tst_QWorkspace::accelActivated()
|
||||||
{
|
{
|
||||||
accelPressed = TRUE;
|
accelPressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QWorkspace::showWindows()
|
void tst_QWorkspace::showWindows()
|
||||||
|
@ -261,11 +261,11 @@ void tst_QDom::setContent()
|
|||||||
QStringList::Iterator it;
|
QStringList::Iterator it;
|
||||||
for ( it = featuresTrue.begin(); it != featuresTrue.end(); ++it ) {
|
for ( it = featuresTrue.begin(); it != featuresTrue.end(); ++it ) {
|
||||||
QVERIFY( reader.hasFeature( *it ) );
|
QVERIFY( reader.hasFeature( *it ) );
|
||||||
reader.setFeature( *it, TRUE );
|
reader.setFeature( *it, true );
|
||||||
}
|
}
|
||||||
for ( it = featuresFalse.begin(); it != featuresFalse.end(); ++it ) {
|
for ( it = featuresFalse.begin(); it != featuresFalse.end(); ++it ) {
|
||||||
QVERIFY( reader.hasFeature( *it ) );
|
QVERIFY( reader.hasFeature( *it ) );
|
||||||
reader.setFeature( *it, FALSE );
|
reader.setFeature( *it, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
QDomDocument domDoc;
|
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
|
if the node has attributes (i.e. QDomNode::attributes() returns a list with
|
||||||
attributes in it).
|
attributes in it).
|
||||||
*/
|
*/
|
||||||
@ -588,13 +588,13 @@ void tst_QDom::cloneNode_data()
|
|||||||
QTest::addColumn<QList<QVariant> >("pathToNode");
|
QTest::addColumn<QList<QVariant> >("pathToNode");
|
||||||
QTest::addColumn<bool>("deep");
|
QTest::addColumn<bool>("deep");
|
||||||
|
|
||||||
QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << (bool)FALSE;
|
QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << false;
|
||||||
QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << (bool)FALSE;
|
QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << false;
|
||||||
QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << (bool)FALSE;
|
QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << false;
|
||||||
|
|
||||||
QTest::newRow( "deep_01" ) << doc01 << nodeB1 << (bool)TRUE;
|
QTest::newRow( "deep_01" ) << doc01 << nodeB1 << true;
|
||||||
QTest::newRow( "deep_02" ) << doc01 << nodeC1 << (bool)TRUE;
|
QTest::newRow( "deep_02" ) << doc01 << nodeC1 << true;
|
||||||
QTest::newRow( "deep_03" ) << doc01 << nodeC2 << (bool)TRUE;
|
QTest::newRow( "deep_03" ) << doc01 << nodeC2 << true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDom::cloneNode()
|
void tst_QDom::cloneNode()
|
||||||
@ -732,14 +732,14 @@ void tst_QDom::ownerDocumentTask27424_data()
|
|||||||
QTest::addColumn<bool>("insertLevel2AfterCstr");
|
QTest::addColumn<bool>("insertLevel2AfterCstr");
|
||||||
QTest::addColumn<bool>("insertLevel3AfterCstr");
|
QTest::addColumn<bool>("insertLevel3AfterCstr");
|
||||||
|
|
||||||
QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE;
|
QTest::newRow( "000" ) << false << false << false;
|
||||||
QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE;
|
QTest::newRow( "001" ) << false << false << true;
|
||||||
QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE;
|
QTest::newRow( "010" ) << false << true << false;
|
||||||
QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE;
|
QTest::newRow( "011" ) << false << true << true;
|
||||||
QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE;
|
QTest::newRow( "100" ) << true << false << false;
|
||||||
QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE;
|
QTest::newRow( "101" ) << true << false << true;
|
||||||
QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE;
|
QTest::newRow( "110" ) << true << true << false;
|
||||||
QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE;
|
QTest::newRow( "111" ) << true << true << true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDom::ownerDocumentTask27424()
|
void tst_QDom::ownerDocumentTask27424()
|
||||||
@ -858,14 +858,14 @@ void tst_QDom::documentCreationTask27424_data()
|
|||||||
QTest::addColumn<bool>("insertLevel2AfterCstr");
|
QTest::addColumn<bool>("insertLevel2AfterCstr");
|
||||||
QTest::addColumn<bool>("insertLevel3AfterCstr");
|
QTest::addColumn<bool>("insertLevel3AfterCstr");
|
||||||
|
|
||||||
QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE;
|
QTest::newRow( "000" ) << false << false << false;
|
||||||
QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE;
|
QTest::newRow( "001" ) << false << false << true;
|
||||||
QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE;
|
QTest::newRow( "010" ) << false << true << false;
|
||||||
QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE;
|
QTest::newRow( "011" ) << false << true << true;
|
||||||
QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE;
|
QTest::newRow( "100" ) << true << false << false;
|
||||||
QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE;
|
QTest::newRow( "101" ) << true << false << true;
|
||||||
QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE;
|
QTest::newRow( "110" ) << true << true << false;
|
||||||
QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE;
|
QTest::newRow( "111" ) << true << true << true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDom::documentCreationTask27424()
|
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
|
they have the same informational content. Otherwise, this function returns
|
||||||
FALSE.
|
false.
|
||||||
*/
|
*/
|
||||||
bool tst_QDom::compareDocuments( const QDomDocument &doc1, const QDomDocument &doc2 )
|
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
|
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
|
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.
|
false, only \a node1 and \a node 2 are compared.
|
||||||
*/
|
*/
|
||||||
bool tst_QDom::compareNodes( const QDomNode &node1, const QDomNode &node2, bool deep )
|
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() )
|
if ( node1.isNull() && node2.isNull() )
|
||||||
return TRUE;
|
return true;
|
||||||
// ### I am not sure if this test is complete
|
// ### I am not sure if this test is complete
|
||||||
bool equal = node1.nodeName() == node2.nodeName();
|
bool equal = node1.nodeName() == node2.nodeName();
|
||||||
equal = equal && node1.nodeType() == node2.nodeType();
|
equal = equal && node1.nodeType() == node2.nodeType();
|
||||||
|
@ -124,7 +124,7 @@ bool ContentHandler::startDocument()
|
|||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "startDocument()\n";
|
m_result += "startDocument()\n";
|
||||||
++m_nest;
|
++m_nest;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::endDocument()
|
bool ContentHandler::endDocument()
|
||||||
@ -132,7 +132,7 @@ bool ContentHandler::endDocument()
|
|||||||
--m_nest;
|
--m_nest;
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "endDocument()\n";
|
m_result += "endDocument()\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::startElement(const QString &namespaceURI,
|
bool ContentHandler::startElement(const QString &namespaceURI,
|
||||||
@ -146,7 +146,7 @@ bool ContentHandler::startElement(const QString &namespaceURI,
|
|||||||
+ "\", qName=\"" + escapeStr(qName)
|
+ "\", qName=\"" + escapeStr(qName)
|
||||||
+ "\", atts=[" + formatAttributes(atts) + "])\n";
|
+ "\", atts=[" + formatAttributes(atts) + "])\n";
|
||||||
++m_nest;
|
++m_nest;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ContentHandler::escapeStr(const QString &s)
|
QString ContentHandler::escapeStr(const QString &s)
|
||||||
@ -183,14 +183,14 @@ bool ContentHandler::endElement(const QString &namespaceURI,
|
|||||||
m_result += "endElement(namespaceURI=\"" + escapeStr(namespaceURI)
|
m_result += "endElement(namespaceURI=\"" + escapeStr(namespaceURI)
|
||||||
+ "\", localName=\"" + escapeStr(localName)
|
+ "\", localName=\"" + escapeStr(localName)
|
||||||
+ "\", qName=\"" + escapeStr(qName) + "\")\n";
|
+ "\", qName=\"" + escapeStr(qName) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::characters(const QString &ch)
|
bool ContentHandler::characters(const QString &ch)
|
||||||
{
|
{
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "characters(ch=\"" + escapeStr(ch) + "\")\n";
|
m_result += "characters(ch=\"" + escapeStr(ch) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentHandler::setDocumentLocator(QXmlLocator *locator)
|
void ContentHandler::setDocumentLocator(QXmlLocator *locator)
|
||||||
@ -208,7 +208,7 @@ bool ContentHandler::startPrefixMapping (const QString &prefix, const QString &
|
|||||||
m_result += "startPrefixMapping(prefix=\"" + escapeStr(prefix)
|
m_result += "startPrefixMapping(prefix=\"" + escapeStr(prefix)
|
||||||
+ "\", uri=\"" + escapeStr(uri) + "\")\n";
|
+ "\", uri=\"" + escapeStr(uri) + "\")\n";
|
||||||
++m_nest;
|
++m_nest;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::endPrefixMapping(const QString &prefix)
|
bool ContentHandler::endPrefixMapping(const QString &prefix)
|
||||||
@ -216,14 +216,14 @@ bool ContentHandler::endPrefixMapping(const QString &prefix)
|
|||||||
--m_nest;
|
--m_nest;
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "endPrefixMapping(prefix=\"" + escapeStr(prefix) + "\")\n";
|
m_result += "endPrefixMapping(prefix=\"" + escapeStr(prefix) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::ignorableWhitespace(const QString & ch)
|
bool ContentHandler::ignorableWhitespace(const QString & ch)
|
||||||
{
|
{
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "ignorableWhitespace(ch=\"" + escapeStr(ch) + "\")\n";
|
m_result += "ignorableWhitespace(ch=\"" + escapeStr(ch) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::processingInstruction(const QString &target, const QString &data)
|
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 += nestPrefix();
|
||||||
m_result += "processingInstruction(target=\"" + escapeStr(target)
|
m_result += "processingInstruction(target=\"" + escapeStr(target)
|
||||||
+ "\", data=\"" + escapeStr(data) + "\")\n";
|
+ "\", data=\"" + escapeStr(data) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::skippedEntity (const QString & name)
|
bool ContentHandler::skippedEntity (const QString & name)
|
||||||
{
|
{
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "skippedEntity(name=\"" + escapeStr(name) + "\")\n";
|
m_result += "skippedEntity(name=\"" + escapeStr(name) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::warning(const QXmlParseException & exception)
|
bool ContentHandler::warning(const QXmlParseException & exception)
|
||||||
@ -256,7 +256,7 @@ bool ContentHandler::warning(const QXmlParseException & exception)
|
|||||||
+ "\", systemId=\"" + escapeStr(exception.systemId())
|
+ "\", systemId=\"" + escapeStr(exception.systemId())
|
||||||
+ "\", message=\"" + escapeStr(exception.message())
|
+ "\", message=\"" + escapeStr(exception.message())
|
||||||
+ "\"})\n";
|
+ "\"})\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::error(const QXmlParseException & exception)
|
bool ContentHandler::error(const QXmlParseException & exception)
|
||||||
@ -274,7 +274,7 @@ bool ContentHandler::error(const QXmlParseException & exception)
|
|||||||
+ "\", systemId=\"" + escapeStr(exception.systemId())
|
+ "\", systemId=\"" + escapeStr(exception.systemId())
|
||||||
+ "\", message=\"" + escapeStr(exception.message())
|
+ "\", message=\"" + escapeStr(exception.message())
|
||||||
+ "\"})\n";
|
+ "\"})\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::fatalError(const QXmlParseException & exception)
|
bool ContentHandler::fatalError(const QXmlParseException & exception)
|
||||||
@ -292,7 +292,7 @@ bool ContentHandler::fatalError(const QXmlParseException & exception)
|
|||||||
+ "\", systemId=\"" + escapeStr(exception.systemId())
|
+ "\", systemId=\"" + escapeStr(exception.systemId())
|
||||||
+ "\", message=\"" + escapeStr(exception.message())
|
+ "\", message=\"" + escapeStr(exception.message())
|
||||||
+ "\"})\n";
|
+ "\"})\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::notationDecl ( const QString & name,
|
bool ContentHandler::notationDecl ( const QString & name,
|
||||||
@ -303,7 +303,7 @@ bool ContentHandler::notationDecl ( const QString & name,
|
|||||||
m_result += "notationDecl(name=\"" + escapeStr(name) + "\", publicId=\""
|
m_result += "notationDecl(name=\"" + escapeStr(name) + "\", publicId=\""
|
||||||
+ escapeStr(publicId) + "\", systemId=\""
|
+ escapeStr(publicId) + "\", systemId=\""
|
||||||
+ escapeStr(systemId) + "\")\n";
|
+ escapeStr(systemId) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::unparsedEntityDecl ( const QString & name,
|
bool ContentHandler::unparsedEntityDecl ( const QString & name,
|
||||||
@ -317,7 +317,7 @@ bool ContentHandler::unparsedEntityDecl ( const QString & name,
|
|||||||
+ "\", systemId=\"" + escapeStr(systemId)
|
+ "\", systemId=\"" + escapeStr(systemId)
|
||||||
+ "\", notationName=\"" + escapeStr(notationName)
|
+ "\", notationName=\"" + escapeStr(notationName)
|
||||||
+ "\")\n";
|
+ "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::resolveEntity(const QString & publicId,
|
bool ContentHandler::resolveEntity(const QString & publicId,
|
||||||
@ -328,7 +328,7 @@ bool ContentHandler::resolveEntity(const QString & publicId,
|
|||||||
m_result += "resolveEntity(publicId=\"" + escapeStr(publicId)
|
m_result += "resolveEntity(publicId=\"" + escapeStr(publicId)
|
||||||
+ "\", systemId=\"" + escapeStr(systemId)
|
+ "\", systemId=\"" + escapeStr(systemId)
|
||||||
+ "\", ret={})\n";
|
+ "\", ret={})\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::startDTD ( const QString & name, const QString & publicId, const QString & systemId )
|
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)
|
+ "\", publicId=\"" + escapeStr(publicId)
|
||||||
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
|
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
|
||||||
++m_nest;
|
++m_nest;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::endDTD ()
|
bool ContentHandler::endDTD ()
|
||||||
@ -346,7 +346,7 @@ bool ContentHandler::endDTD ()
|
|||||||
--m_nest;
|
--m_nest;
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "endDTD()\n";
|
m_result += "endDTD()\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::startEntity ( const QString & name )
|
bool ContentHandler::startEntity ( const QString & name )
|
||||||
@ -354,7 +354,7 @@ bool ContentHandler::startEntity ( const QString & name )
|
|||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "startEntity(name=\"" + escapeStr(name) + "\")\n";
|
m_result += "startEntity(name=\"" + escapeStr(name) + "\")\n";
|
||||||
++m_nest;
|
++m_nest;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::endEntity ( const QString & name )
|
bool ContentHandler::endEntity ( const QString & name )
|
||||||
@ -362,7 +362,7 @@ bool ContentHandler::endEntity ( const QString & name )
|
|||||||
--m_nest;
|
--m_nest;
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "endEntity(name=\"" + escapeStr(name) + "\")\n";
|
m_result += "endEntity(name=\"" + escapeStr(name) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::startCDATA ()
|
bool ContentHandler::startCDATA ()
|
||||||
@ -370,7 +370,7 @@ bool ContentHandler::startCDATA ()
|
|||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "startCDATA()\n";
|
m_result += "startCDATA()\n";
|
||||||
++m_nest;
|
++m_nest;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::endCDATA ()
|
bool ContentHandler::endCDATA ()
|
||||||
@ -378,14 +378,14 @@ bool ContentHandler::endCDATA ()
|
|||||||
--m_nest;
|
--m_nest;
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "endCDATA()\n";
|
m_result += "endCDATA()\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::comment ( const QString & ch )
|
bool ContentHandler::comment ( const QString & ch )
|
||||||
{
|
{
|
||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "comment(ch=\"" + escapeStr(ch) + "\")\n";
|
m_result += "comment(ch=\"" + escapeStr(ch) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::attributeDecl ( const QString & eName,
|
bool ContentHandler::attributeDecl ( const QString & eName,
|
||||||
@ -399,7 +399,7 @@ bool ContentHandler::attributeDecl ( const QString & eName,
|
|||||||
+ escapeStr(aName) + "\", type=\"" + escapeStr(type)
|
+ escapeStr(aName) + "\", type=\"" + escapeStr(type)
|
||||||
+ "\", valueDefault=\"" + escapeStr(valueDefault)
|
+ "\", valueDefault=\"" + escapeStr(valueDefault)
|
||||||
+ "\", value=\"" + escapeStr(value) + "\")\n";
|
+ "\", value=\"" + escapeStr(value) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::internalEntityDecl ( const QString & name,
|
bool ContentHandler::internalEntityDecl ( const QString & name,
|
||||||
@ -408,7 +408,7 @@ bool ContentHandler::internalEntityDecl ( const QString & name,
|
|||||||
m_result += nestPrefix();
|
m_result += nestPrefix();
|
||||||
m_result += "internatlEntityDecl(name=\"" + escapeStr(name)
|
m_result += "internatlEntityDecl(name=\"" + escapeStr(name)
|
||||||
+ "\", value=\"" + escapeStr(value) + "\")\n";
|
+ "\", value=\"" + escapeStr(value) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentHandler::externalEntityDecl ( const QString & name,
|
bool ContentHandler::externalEntityDecl ( const QString & name,
|
||||||
@ -419,7 +419,7 @@ bool ContentHandler::externalEntityDecl ( const QString & name,
|
|||||||
m_result += "externalEntityDecl(name=\"" + escapeStr(name)
|
m_result += "externalEntityDecl(name=\"" + escapeStr(name)
|
||||||
+ "\", publicId=\"" + escapeStr(publicId)
|
+ "\", publicId=\"" + escapeStr(publicId)
|
||||||
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
|
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Parser::Parser()
|
Parser::Parser()
|
||||||
|
Loading…
Reference in New Issue
Block a user