diff options
author | kh <qtc-committer@nokia.com> | 2009-07-29 16:32:57 (GMT) |
---|---|---|
committer | kh <qtc-committer@nokia.com> | 2009-07-29 16:32:57 (GMT) |
commit | 91005e4878c76630390fd17afec2f283fcd5121d (patch) | |
tree | c9a997a7c542da025ff00549ea80bd517557c577 /tests | |
parent | f21a36efaab400e086a8c1e87f91da595e4a4443 (diff) | |
parent | b2b626a936d778b89f8fbf33ac914d99876ec4b3 (diff) | |
download | Qt-91005e4878c76630390fd17afec2f283fcd5121d.zip Qt-91005e4878c76630390fd17afec2f283fcd5121d.tar.gz Qt-91005e4878c76630390fd17afec2f283fcd5121d.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests')
39 files changed, 678 insertions, 204 deletions
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp index b7e4717..c004be1 100644 --- a/tests/auto/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/qbytearray/tst_qbytearray.cpp @@ -236,7 +236,7 @@ void tst_QByteArray::qUncompress() #elif defined Q_OS_SOLARIS QSKIP("Corrupt data causes this tests to lock up on Solaris", SkipAll); #elif defined Q_OS_QNX - QSKIP("Currupt data cuases this test to lock up on QNX", SkipAll); + QSKIP("Corrupt data causes this test to lock up on QNX", SkipAll); #endif QTEST(::qUncompress(in), "out"); diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index e5b23ab..e900ed0 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -51,7 +51,9 @@ #include "../network-settings.h" - +#if defined(Q_OS_VXWORKS) +#define Q_NO_SYMLINKS +#endif //TESTED_CLASS= //TESTED_FILES= @@ -370,6 +372,20 @@ void tst_QDir::compare() QVERIFY(dir == QDir::currentPath()); } +static QStringList filterLinks(const QStringList &list) +{ +#ifndef Q_NO_SYMLINKS + return list; +#else + QStringList result; + foreach (QString str, list) { + if (!str.endsWith(QLatin1String(".lnk"))) + result.append(str); + } + return result; +#endif +} + void tst_QDir::entryList_data() { QTest::addColumn<QString>("dirName"); // relative from current path or abs @@ -411,94 +427,95 @@ void tst_QDir::entryList_data() QTest::newRow("nofilter") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::Files") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Files) << int(QDir::Name) - << QString("file,linktofile.lnk,writable").split(','); + << filterLinks(QString("file,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::Dirs") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Dirs) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::Dirs | QDir::NoDotAndDotDot") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Dirs | QDir::NoDotAndDotDot) << int(QDir::Name) - << QString("directory,linktodirectory.lnk").split(','); + << filterLinks(QString("directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::AllDirs") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::AllDirs | QDir::Dirs") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs | QDir::Dirs) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk").split(',')); QTest::newRow("QDir::AllDirs | QDir::Files") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs | QDir::Files) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::NoSymLinks) << int(QDir::Name) - << QString(".,..,directory,file,writable").split(','); + << filterLinks(QString(".,..,directory,file,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::NoSymLinks | QDir::NoDotAndDotDot") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::NoSymLinks | QDir::NoDotAndDotDot) << int(QDir::Name) - << QString("directory,file,writable").split(','); + << filterLinks(QString("directory,file,writable").split(',')); QTest::newRow("QDir::Files | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Files | QDir::NoSymLinks) << int(QDir::Name) - << QString("file,writable").split(','); + << filterLinks(QString("file,writable").split(',')); QTest::newRow("QDir::Dirs | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Dirs | QDir::NoSymLinks) << int(QDir::Name) - << QString(".,..,directory").split(','); + << filterLinks(QString(".,..,directory").split(',')); QTest::newRow("QDir::Drives | QDir::Files | QDir::NoDotAndDotDot") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Drives | QDir::Files | QDir::NoDotAndDotDot) << int(QDir::Name) - << QString("file,linktofile.lnk,writable").split(','); + << filterLinks(QString("file,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::System") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::System) << int(QDir::Name) - << QStringList("brokenlink.lnk"); + << filterLinks(QStringList("brokenlink.lnk")); QTest::newRow("QDir::Hidden") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::Hidden) << int(QDir::Name) << QStringList(); QTest::newRow("QDir::System | QDir::Hidden") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::System | QDir::Hidden) << int(QDir::Name) - << QStringList("brokenlink.lnk"); + << filterLinks(QStringList("brokenlink.lnk")); QTest::newRow("QDir::AllDirs | QDir::NoSymLinks") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllDirs | QDir::NoSymLinks) << int(QDir::Name) - << QString(".,..,directory").split(','); + << filterLinks(QString(".,..,directory").split(',')); #ifdef QT3_SUPPORT QTest::newRow("QDir::All | QDir::Hidden | QDir::System") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::All | QDir::Hidden | QDir::System) << int(QDir::Name) - << QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::All | QDir::Readable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::All | QDir::Readable) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::All | QDir::Writable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::All | QDir::Writable) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk,writable").split(',')); #else QTest::newRow("QDir::AllEntries | QDir::Hidden | QDir::System") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::Hidden | QDir::System) << int(QDir::Name) - << QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,brokenlink.lnk,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::Readable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::Readable) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("QDir::AllEntries | QDir::Writable") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::AllEntries | QDir::Writable) << int(QDir::Name) - << QString(".,..,directory,linktodirectory.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,linktodirectory.lnk,writable").split(',')); #endif QTest::newRow("Namefilters b*") << SRCDIR "entrylist/" << QStringList("d*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("directory").split(','); + << filterLinks(QString("directory").split(',')); QTest::newRow("Namefilters f*") << SRCDIR "entrylist/" << QStringList("f*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("file").split(','); + << filterLinks(QString("file").split(',')); QTest::newRow("Namefilters link*") << SRCDIR "entrylist/" << QStringList("link*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("linktodirectory.lnk,linktofile.lnk").split(','); + << filterLinks(QString("linktodirectory.lnk,linktofile.lnk").split(',')); QTest::newRow("Namefilters *to*") << SRCDIR "entrylist/" << QStringList("*to*") << int(QDir::NoFilter) << int(QDir::Name) - << QString("directory,linktodirectory.lnk,linktofile.lnk").split(','); + << filterLinks(QString("directory,linktodirectory.lnk,linktofile.lnk").split(',')); QTest::newRow("Sorting QDir::Name") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name) - << QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(','); + << filterLinks(QString(".,..,directory,file,linktodirectory.lnk,linktofile.lnk,writable").split(',')); QTest::newRow("Sorting QDir::Name | QDir::Reversed") << SRCDIR "entrylist/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name | QDir::Reversed) - << QString("writable,linktofile.lnk,linktodirectory.lnk,file,directory,..,.").split(','); + << filterLinks(QString("writable,linktofile.lnk,linktodirectory.lnk,file,directory,..,.").split(',')); + QTest::newRow("Sorting QDir::Type") << SRCDIR "types/" << QStringList("*") << int(QDir::NoFilter) << int(QDir::Type) << QString(".,..,a,b,c,d,e,f,a.a,b.a,c.a,d.a,e.a,f.a,a.b,b.b,c.b,d.b,e.b,f.b,a.c,b.c,c.c,d.c,e.c,f.c").split(','); @@ -635,6 +652,7 @@ void tst_QDir::entryListSimple() void tst_QDir::entryListWithSymLinks() { +#ifndef Q_NO_SYMLINKS QFile::remove("myLinkToDir.lnk"); QFile::remove("myLinkToFile.lnk"); QFile::remove("testfile.cpp"); @@ -667,6 +685,7 @@ void tst_QDir::entryListWithSymLinks() QFile::remove("myLinkToFile.lnk"); QFile::remove("testfile.cpp"); dir.rmdir("myDir"); +#endif } void tst_QDir::canonicalPath_data() diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp index 2d5758e..79e44d1 100644 --- a/tests/auto/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp @@ -48,6 +48,10 @@ #include <qfileinfo.h> #include <qstringlist.h> +#if defined(Q_OS_VXWORKS) +#define Q_NO_SYMLINKS +#endif + Q_DECLARE_METATYPE(QDirIterator::IteratorFlags) Q_DECLARE_METATYPE(QDir::Filters) @@ -87,6 +91,7 @@ tst_QDirIterator::tst_QDirIterator() QFile::remove("entrylist/directory/entrylist3.lnk"); QFile::remove("entrylist/directory/entrylist4.lnk"); +#ifndef Q_NO_SYMLINKS #ifdef Q_OS_WIN // ### Sadly, this is a platform difference right now. QFile::link("entrylist/file", "entrylist/linktofile.lnk"); @@ -97,6 +102,7 @@ tst_QDirIterator::tst_QDirIterator() QFile::link("directory", "entrylist/linktodirectory.lnk"); QFile::link("nothing", "entrylist/brokenlink.lnk"); #endif +#endif QFile("entrylist/writable").open(QIODevice::ReadWrite); } @@ -135,9 +141,13 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/..," #endif "entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/directory," +#ifndef Q_NO_SYMLINKS "entrylist/linktodirectory.lnk," +#endif "entrylist/writable").split(','); QTest::newRow("QDir::Subdirectories | QDir::FollowSymlinks") @@ -151,10 +161,14 @@ void tst_QDirIterator::iterateRelativeDirectory_data() "entrylist/directory/..," #endif "entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/directory," "entrylist/directory/dummy," +#ifndef Q_NO_SYMLINKS "entrylist/linktodirectory.lnk," +#endif "entrylist/writable").split(','); QTest::newRow("QDir::Subdirectories / QDir::Files") @@ -162,14 +176,18 @@ void tst_QDirIterator::iterateRelativeDirectory_data() << QDir::Filters(QDir::Files) << QStringList("*") << QString("entrylist/directory/dummy," "entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/writable").split(','); QTest::newRow("QDir::Subdirectories | QDir::FollowSymlinks / QDir::Files") << QString("entrylist") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories | QDirIterator::FollowSymlinks) << QDir::Filters(QDir::Files) << QStringList("*") << QString("entrylist/file," +#ifndef Q_NO_SYMLINKS "entrylist/linktofile.lnk," +#endif "entrylist/directory/dummy," "entrylist/writable").split(','); } diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro index 5466dfa..7738fb7 100644 --- a/tests/auto/qdom/qdom.pro +++ b/tests/auto/qdom/qdom.pro @@ -10,4 +10,8 @@ wince*: { DEPLOYMENT += addFiles DEPLOYMENT_PLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs + DEFINES += SRCDIR=\\\"\\\" +} +else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index cea0bfb..5b4787f 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -290,17 +290,17 @@ void tst_QDom::toString_01_data() { QTest::addColumn<QString>("fileName"); - QTest::newRow( "01" ) << QString("testdata/toString_01/doc01.xml"); - QTest::newRow( "02" ) << QString("testdata/toString_01/doc02.xml"); - QTest::newRow( "03" ) << QString("testdata/toString_01/doc03.xml"); - QTest::newRow( "04" ) << QString("testdata/toString_01/doc04.xml"); - QTest::newRow( "05" ) << QString("testdata/toString_01/doc05.xml"); + QTest::newRow( "01" ) << QString(SRCDIR "testdata/toString_01/doc01.xml"); + QTest::newRow( "02" ) << QString(SRCDIR "testdata/toString_01/doc02.xml"); + QTest::newRow( "03" ) << QString(SRCDIR "testdata/toString_01/doc03.xml"); + QTest::newRow( "04" ) << QString(SRCDIR "testdata/toString_01/doc04.xml"); + QTest::newRow( "05" ) << QString(SRCDIR "testdata/toString_01/doc05.xml"); - QTest::newRow( "euc-jp" ) << QString("testdata/toString_01/doc_euc-jp.xml"); - QTest::newRow( "iso-2022-jp" ) << QString("testdata/toString_01/doc_iso-2022-jp.xml"); - QTest::newRow( "little-endian" ) << QString("testdata/toString_01/doc_little-endian.xml"); - QTest::newRow( "utf-16" ) << QString("testdata/toString_01/doc_utf-16.xml"); - QTest::newRow( "utf-8" ) << QString("testdata/toString_01/doc_utf-8.xml"); + QTest::newRow( "euc-jp" ) << QString(SRCDIR "testdata/toString_01/doc_euc-jp.xml"); + QTest::newRow( "iso-2022-jp" ) << QString(SRCDIR "testdata/toString_01/doc_iso-2022-jp.xml"); + QTest::newRow( "little-endian" ) << QString(SRCDIR "testdata/toString_01/doc_little-endian.xml"); + QTest::newRow( "utf-16" ) << QString(SRCDIR "testdata/toString_01/doc_utf-16.xml"); + QTest::newRow( "utf-8" ) << QString(SRCDIR "testdata/toString_01/doc_utf-8.xml"); } @@ -474,7 +474,7 @@ void tst_QDom::initTestCase() QSKIP("Our current test machine, arsia, is too slow for this auto test.", SkipAll); #endif - QFile file("testdata/excludedCodecs.txt"); + QFile file(SRCDIR "testdata/excludedCodecs.txt"); QVERIFY(file.open(QIODevice::ReadOnly|QIODevice::Text)); QByteArray codecName; @@ -550,18 +550,18 @@ void tst_QDom::saveWithSerialization_data() const { QTest::addColumn<QString>("fileName"); - QTest::newRow("doc01.xml") << QString("testdata/toString_01/doc01.xml"); - QTest::newRow("doc01.xml") << QString("testdata/toString_01/doc01.xml"); - QTest::newRow("doc02.xml") << QString("testdata/toString_01/doc02.xml"); - QTest::newRow("doc03.xml") << QString("testdata/toString_01/doc03.xml"); - QTest::newRow("doc04.xml") << QString("testdata/toString_01/doc04.xml"); - QTest::newRow("doc05.xml") << QString("testdata/toString_01/doc05.xml"); + QTest::newRow("doc01.xml") << QString(SRCDIR "testdata/toString_01/doc01.xml"); + QTest::newRow("doc01.xml") << QString(SRCDIR "testdata/toString_01/doc01.xml"); + QTest::newRow("doc02.xml") << QString(SRCDIR "testdata/toString_01/doc02.xml"); + QTest::newRow("doc03.xml") << QString(SRCDIR "testdata/toString_01/doc03.xml"); + QTest::newRow("doc04.xml") << QString(SRCDIR "testdata/toString_01/doc04.xml"); + QTest::newRow("doc05.xml") << QString(SRCDIR "testdata/toString_01/doc05.xml"); - QTest::newRow("doc_euc-jp.xml") << QString("testdata/toString_01/doc_euc-jp.xml"); - QTest::newRow("doc_iso-2022-jp.xml") << QString("testdata/toString_01/doc_iso-2022-jp.xml"); - QTest::newRow("doc_little-endian.xml") << QString("testdata/toString_01/doc_little-endian.xml"); - QTest::newRow("doc_utf-16.xml") << QString("testdata/toString_01/doc_utf-16.xml"); - QTest::newRow("doc_utf-8.xml") << QString("testdata/toString_01/doc_utf-8.xml"); + QTest::newRow("doc_euc-jp.xml") << QString(SRCDIR "testdata/toString_01/doc_euc-jp.xml"); + QTest::newRow("doc_iso-2022-jp.xml") << QString(SRCDIR "testdata/toString_01/doc_iso-2022-jp.xml"); + QTest::newRow("doc_little-endian.xml") << QString(SRCDIR "testdata/toString_01/doc_little-endian.xml"); + QTest::newRow("doc_utf-16.xml") << QString(SRCDIR "testdata/toString_01/doc_utf-16.xml"); + QTest::newRow("doc_utf-8.xml") << QString(SRCDIR "testdata/toString_01/doc_utf-8.xml"); } void tst_QDom::cloneNode_data() @@ -1386,7 +1386,7 @@ void tst_QDom::roundTripAttributes() const doc.save(stream, 0); stream.flush(); - const QByteArray expected("<localName xmlns=\"\" attr=\" 
	 \" />\n"); + const QByteArray expected("<localName xmlns=\"\" attr=\" 
	 \"/>\n"); QCOMPARE(QString::fromLatin1(serialized.constData()), QString::fromLatin1(expected.constData())); } @@ -1671,7 +1671,7 @@ void tst_QDom::appendDocumentNode() const doc.appendChild(elem); Q_ASSERT(!xml.isNull()); - const QString expected(QLatin1String("<document>\n<test_elem name=\"value\" />\n</document>\n")); + const QString expected(QLatin1String("<document>\n<test_elem name=\"value\"/>\n</document>\n")); elem.appendChild(xml); QCOMPARE(doc.childNodes().count(), 1); @@ -1780,7 +1780,7 @@ void tst_QDom::doubleNamespaceDeclarations() const { QDomDocument doc; - QFile file("doubleNamespaces.xml" ); + QFile file(SRCDIR "doubleNamespaces.xml" ); QVERIFY(file.open(QIODevice::ReadOnly)); QXmlSimpleReader reader; @@ -1788,8 +1788,8 @@ void tst_QDom::doubleNamespaceDeclarations() const QXmlInputSource source(&file); QVERIFY(doc.setContent(&source, &reader)); - QVERIFY(doc.toString(0) == QString::fromLatin1("<a>\n<b p:c=\"\" xmlns:p=\"NS\" p:d=\"\" />\n</a>\n") || - doc.toString(0) == QString::fromLatin1("<a>\n<b p:c=\"\" p:d=\"\" xmlns:p=\"NS\" />\n</a>\n")); + QVERIFY(doc.toString(0) == QString::fromLatin1("<a>\n<b p:c=\"\" xmlns:p=\"NS\" p:d=\"\"/>\n</a>\n") || + doc.toString(0) == QString::fromLatin1("<a>\n<b p:c=\"\" p:d=\"\" xmlns:p=\"NS\"/>\n</a>\n")); } void tst_QDom::setContentQXmlReaderOverload() const diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index 89f3541..55f3b5c 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -3,6 +3,8 @@ CONFIG += qttest_p4 include(../../src/qfiledialog.pri) include(../../../../modeltest/modeltest.pri) +QT = core gui + SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 9f1693d..7f6f322 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -44,6 +44,7 @@ #include <private/qtextcontrol_p.h> #include <private/qgraphicsitem_p.h> +#include <private/qgraphicsview_p.h> #include <QStyleOptionGraphicsItem> #include <QAbstractTextDocumentLayout> #include <QBitmap> @@ -6884,44 +6885,21 @@ void tst_QGraphicsItem::update() void tst_QGraphicsItem::setTransformProperties_data() { QTest::addColumn<QPointF>("origin"); - QTest::addColumn<qreal>("rotationX"); - QTest::addColumn<qreal>("rotationY"); - QTest::addColumn<qreal>("rotationZ"); - QTest::addColumn<qreal>("scaleX"); - QTest::addColumn<qreal>("scaleY"); - QTest::addColumn<qreal>("shearX"); - QTest::addColumn<qreal>("shearY"); + QTest::addColumn<qreal>("rotation"); + QTest::addColumn<qreal>("scale"); - QTest::newRow("nothing") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0) - << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); + QTest::newRow("nothing") << QPointF() << qreal(0.0) << qreal(1.0); - QTest::newRow("rotationZ") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(42.2) - << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); + QTest::newRow("rotation") << QPointF() << qreal(42.2) << qreal(1.0); - QTest::newRow("rotationXY") << QPointF() << qreal(12.5) << qreal(53.6) << qreal(0.0) - << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); + QTest::newRow("rotation dicentred") << QPointF(qreal(22.3), qreal(-56.2)) + << qreal(-2578.2) + << qreal(1.0); - QTest::newRow("rotationXYZ") << QPointF() << qreal(-25) << qreal(12) << qreal(556) - << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); + QTest::newRow("Scale") << QPointF() << qreal(0.0) + << qreal(6); - QTest::newRow("rotationXYZ dicentred") << QPointF(-53, 25.2) - << qreal(-2578.2) << qreal(4565.2) << qreal(56) - << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); - - QTest::newRow("Scale") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0) - << qreal(6) << qreal(0.5) << qreal(0.0) << qreal(0.0); - - QTest::newRow("Shear") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0) - << qreal(1.0) << qreal(1.0) << qreal(2.2) << qreal(0.5); - - QTest::newRow("Scale and Shear") << QPointF() << qreal(0.0) << qreal(0.0) << qreal(0.0) - << qreal(5.2) << qreal(2.1) << qreal(5.2) << qreal(5.5); - - QTest::newRow("Everything") << QPointF() << qreal(41) << qreal(-23) << qreal(0.56) - << qreal(8.2) << qreal(-0.2) << qreal(-12) << qreal(-0.8); - - QTest::newRow("Everything dicentred") << QPointF(qreal(22.3), qreal(-56.2)) << qreal(-175) << qreal(196) << qreal(-1260) - << qreal(4) << qreal(2) << qreal(2.56) << qreal(0.8); + QTest::newRow("Everything dicentred") << QPointF(qreal(22.3), qreal(-56.2)) << qreal(-175) << qreal(196); } /** @@ -6932,92 +6910,61 @@ void tst_QGraphicsItem::setTransformProperties_data() void tst_QGraphicsItem::setTransformProperties() { QFETCH(QPointF,origin); - QFETCH(qreal,rotationX); - QFETCH(qreal,rotationY); - QFETCH(qreal,rotationZ); - QFETCH(qreal,scaleX); - QFETCH(qreal,scaleY); - QFETCH(qreal,shearX); - QFETCH(qreal,shearY); + QFETCH(qreal,rotation); + QFETCH(qreal,scale); QTransform result; result.translate(origin.x(), origin.y()); - result.rotate(rotationX, Qt::XAxis); - result.rotate(rotationY, Qt::YAxis); - result.rotate(rotationZ, Qt::ZAxis); - result.shear(shearX, shearY); - result.scale(scaleX, scaleY); + result.rotate(rotation, Qt::ZAxis); + result.scale(scale, scale); result.translate(-origin.x(), -origin.y()); QGraphicsScene scene; QGraphicsRectItem *item = new QGraphicsRectItem(QRectF(0, 0, 100, 100)); scene.addItem(item); - item->setRotation(rotationX, rotationY, rotationZ); - item->setScale(scaleX, scaleY); - item->setShear(shearX, shearY); - item->setTransformOrigin(origin); + item->setRotation(rotation); + item->setScale(scale); + item->setTransformOriginPoint(origin); - QCOMPARE(item->xRotation(), rotationX); - QCOMPARE(item->yRotation(), rotationY); - QCOMPARE(item->zRotation(), rotationZ); - QCOMPARE(item->xScale(), scaleX); - QCOMPARE(item->yScale(), scaleY); - QCOMPARE(item->horizontalShear(), shearX); - QCOMPARE(item->verticalShear(), shearY); - QCOMPARE(item->transformOrigin(), origin); + QCOMPARE(item->rotation(), rotation); + QCOMPARE(item->scale(), scale); + QCOMPARE(item->transformOriginPoint(), origin); QCOMPARE(QTransform(), item->transform()); QCOMPARE(result, item->sceneTransform()); //----------------------------------------------------------------- //Change the rotation Z - item->setZRotation(45); + item->setRotation(45); QTransform result2; result2.translate(origin.x(), origin.y()); - result2.rotate(rotationX, Qt::XAxis); - result2.rotate(rotationY, Qt::YAxis); - result2.rotate(45, Qt::ZAxis); - result2.shear(shearX, shearY); - result2.scale(scaleX, scaleY); + result2.rotate(45); + result2.scale(scale, scale); result2.translate(-origin.x(), -origin.y()); - QCOMPARE(item->xRotation(), rotationX); - QCOMPARE(item->yRotation(), rotationY); - QCOMPARE(item->zRotation(), 45.0); - QCOMPARE(item->xScale(), scaleX); - QCOMPARE(item->yScale(), scaleY); - QCOMPARE(item->horizontalShear(), shearX); - QCOMPARE(item->verticalShear(), shearY); - QCOMPARE(item->transformOrigin(), origin); + QCOMPARE(item->rotation(), 45.); + QCOMPARE(item->scale(), scale); + QCOMPARE(item->transformOriginPoint(), origin); QCOMPARE(QTransform(), item->transform()); QCOMPARE(result2, item->sceneTransform()); //----------------------------------------------------------------- - // calling setTransform() and setPos shoukld change the sceneTransform + // calling setTransform() and setPos should change the sceneTransform item->setTransform(result); item->setPos(100, -150.5); - QCOMPARE(item->xRotation(), rotationX); - QCOMPARE(item->yRotation(), rotationY); - QCOMPARE(item->zRotation(), 45.0); - QCOMPARE(item->xScale(), scaleX); - QCOMPARE(item->yScale(), scaleY); - QCOMPARE(item->horizontalShear(), shearX); - QCOMPARE(item->verticalShear(), shearY); - QCOMPARE(item->transformOrigin(), origin); + QCOMPARE(item->rotation(), 45.); + QCOMPARE(item->scale(), scale); + QCOMPARE(item->transformOriginPoint(), origin); QCOMPARE(result, item->transform()); - QTransform result3; + QTransform result3(result); result3.translate(origin.x(), origin.y()); - result3 = result * result3; - result3.rotate(rotationX, Qt::XAxis); - result3.rotate(rotationY, Qt::YAxis); - result3.rotate(45, Qt::ZAxis); - result3.shear(shearX, shearY); - result3.scale(scaleX, scaleY); + result3.rotate(45); + result3.scale(scale, scale); result3.translate(-origin.x(), -origin.y()); result3 *= QTransform::fromTranslate(100, -150.5); //the pos; @@ -7034,10 +6981,9 @@ void tst_QGraphicsItem::setTransformProperties() item1->setPos(12.3, -5); item2->setPos(12.3, -5); - item1->setRotation(rotationX, rotationY, rotationZ); - item1->setScale(scaleX, scaleY); - item1->setShear(shearX, shearY); - item1->setTransformOrigin(origin); + item1->setRotation(rotation); + item1->setScale(scale); + item1->setTransformOriginPoint(origin); item2->setTransform(result); @@ -7046,36 +6992,6 @@ void tst_QGraphicsItem::setTransformProperties() QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); QCOMPARE_TRANSFORM(item2->itemTransform(item1), QTransform()); } - - {//with center origin on the item - QGraphicsRectItem *item1 = new QGraphicsRectItem(QRectF(50.2, -150, 230.5, 119)); - scene.addItem(item1); - QGraphicsRectItem *item2 = new QGraphicsRectItem(QRectF(50.2, -150, 230.5, 119)); - scene.addItem(item2); - - item1->setPos(12.3, -5); - item2->setPos(12.3, -5); - item1->setTransformOrigin(origin); - item2->setTransformOrigin(origin); - - item1->setRotation(rotationX, rotationY, rotationZ); - item1->setScale(scaleX, scaleY); - item1->setShear(shearX, shearY); - - QTransform tr; - tr.rotate(rotationX, Qt::XAxis); - tr.rotate(rotationY, Qt::YAxis); - tr.rotate(rotationZ, Qt::ZAxis); - tr.shear(shearX, shearY); - tr.scale(scaleX, scaleY); - - item2->setTransform(tr); - - QCOMPARE_TRANSFORM(item1->sceneTransform(), item2->sceneTransform()); - - QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); - QCOMPARE_TRANSFORM(item2->itemTransform(item1), QTransform()); - } } class MyStyleOptionTester : public QGraphicsRectItem diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index f7ea4ce..4ef1cdd 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -255,6 +255,7 @@ private slots: void sendEvent(); void inputMethod_data(); void inputMethod(); + void dispatchHoverOnPress(); // task specific tests below me void task139710_bspTreeCrash(); @@ -3719,5 +3720,73 @@ void tst_QGraphicsScene::inputMethod() QCOMPARE(item->queryCalls, 0); } +void tst_QGraphicsScene::dispatchHoverOnPress() +{ + QGraphicsScene scene; + EventTester *tester1 = new EventTester; + tester1->setAcceptHoverEvents(true); + EventTester *tester2 = new EventTester; + tester2->setAcceptHoverEvents(true); + tester2->setPos(30, 30); + scene.addItem(tester1); + scene.addItem(tester2); + + tester1->eventTypes.clear(); + tester2->eventTypes.clear(); + + { + QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress); + me.setButton(Qt::LeftButton); + me.setButtons(Qt::LeftButton); + QGraphicsSceneMouseEvent me2(QEvent::GraphicsSceneMouseRelease); + me2.setButton(Qt::LeftButton); + qApp->sendEvent(&scene, &me); + qApp->sendEvent(&scene, &me2); + QCOMPARE(tester1->eventTypes, QList<QEvent::Type>() + << QEvent::GraphicsSceneHoverEnter + << QEvent::GraphicsSceneHoverMove + << QEvent::GrabMouse + << QEvent::GraphicsSceneMousePress + << QEvent::UngrabMouse); + tester1->eventTypes.clear(); + qApp->sendEvent(&scene, &me); + qApp->sendEvent(&scene, &me2); + QCOMPARE(tester1->eventTypes, QList<QEvent::Type>() + << QEvent::GraphicsSceneHoverMove + << QEvent::GrabMouse + << QEvent::GraphicsSceneMousePress + << QEvent::UngrabMouse); + } + { + QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress); + me.setScenePos(QPointF(30, 30)); + me.setButton(Qt::LeftButton); + me.setButtons(Qt::LeftButton); + QGraphicsSceneMouseEvent me2(QEvent::GraphicsSceneMouseRelease); + me2.setScenePos(QPointF(30, 30)); + me2.setButton(Qt::LeftButton); + tester1->eventTypes.clear(); + qApp->sendEvent(&scene, &me); + qApp->sendEvent(&scene, &me2); + qDebug() << tester1->eventTypes; + QCOMPARE(tester1->eventTypes, QList<QEvent::Type>() + << QEvent::GraphicsSceneHoverLeave); + QCOMPARE(tester2->eventTypes, QList<QEvent::Type>() + << QEvent::GraphicsSceneHoverEnter + << QEvent::GraphicsSceneHoverMove + << QEvent::GrabMouse + << QEvent::GraphicsSceneMousePress + << QEvent::UngrabMouse); + tester2->eventTypes.clear(); + qApp->sendEvent(&scene, &me); + qApp->sendEvent(&scene, &me2); + QCOMPARE(tester2->eventTypes, QList<QEvent::Type>() + << QEvent::GraphicsSceneHoverMove + << QEvent::GrabMouse + << QEvent::GraphicsSceneMousePress + << QEvent::UngrabMouse); + } +} + QTEST_MAIN(tst_QGraphicsScene) #include "tst_qgraphicsscene.moc" diff --git a/tests/auto/qgraphicstransform/qgraphicstransform.pro b/tests/auto/qgraphicstransform/qgraphicstransform.pro new file mode 100644 index 0000000..709cff6 --- /dev/null +++ b/tests/auto/qgraphicstransform/qgraphicstransform.pro @@ -0,0 +1,2 @@ +load(qttest_p4) +SOURCES += tst_qgraphicstransform.cpp diff --git a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp new file mode 100644 index 0000000..672b1f1 --- /dev/null +++ b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtTest/QtTest> +#include <qgraphicsitem.h> +#include <qgraphicstransform.h> +#include "../../shared/util.h" + +class tst_QGraphicsTransform : public QObject { + Q_OBJECT + +public slots: + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + +private slots: + void scale(); + void rotation(); + void rotation3d(); +}; + + +// This will be called before the first test function is executed. +// It is only called once. +void tst_QGraphicsTransform::initTestCase() +{ +} + +// This will be called after the last test function is executed. +// It is only called once. +void tst_QGraphicsTransform::cleanupTestCase() +{ +} + +// This will be called before each test function is executed. +void tst_QGraphicsTransform::init() +{ +} + +// This will be called after every test function. +void tst_QGraphicsTransform::cleanup() +{ +} + + +void tst_QGraphicsTransform::scale() +{ + QGraphicsScale scale; + scale.setOrigin(QPointF(10, 10)); + + QTransform t; + scale.applyTo(&t); + + QCOMPARE(t, QTransform()); + QCOMPARE(scale.transform(), QTransform()); + + scale.setXScale(10); + scale.setOrigin(QPointF(0, 0)); + + QTransform res; + res.scale(10, 1); + + QCOMPARE(scale.transform(), res); + QCOMPARE(scale.transform().map(QPointF(10, 10)), QPointF(100, 10)); + + scale.setOrigin(QPointF(10, 10)); + QCOMPARE(scale.transform().map(QPointF(10, 10)), QPointF(10, 10)); + QCOMPARE(scale.transform().map(QPointF(11, 10)), QPointF(20, 10)); +} + +void tst_QGraphicsTransform::rotation() +{ + QGraphicsRotation rotation; + rotation.setOrigin(QPointF(10, 10)); + + QTransform t; + rotation.applyTo(&t); + + QCOMPARE(t, QTransform()); + QCOMPARE(rotation.transform(), QTransform()); + + rotation.setAngle(40); + rotation.setOrigin(QPointF(0, 0)); + + QTransform res; + res.rotate(40); + + QCOMPARE(rotation.transform(), res); + + rotation.setOrigin(QPointF(10, 10)); + rotation.setAngle(90); + QCOMPARE(rotation.transform().map(QPointF(10, 10)), QPointF(10, 10)); + QCOMPARE(rotation.transform().map(QPointF(20, 10)), QPointF(10, 20)); +} + +void tst_QGraphicsTransform::rotation3d() +{ + QGraphicsRotation3D rotation; + rotation.setOrigin(QPointF(10, 10)); + + QTransform t; + rotation.applyTo(&t); + + QCOMPARE(t, QTransform()); + QCOMPARE(rotation.transform(), QTransform()); + + rotation.setAngle(180); + + QCOMPARE(t, QTransform()); + QCOMPARE(rotation.transform(), QTransform()); + + rotation.setOrigin(QPointF(0, 0)); + + QCOMPARE(t, QTransform()); + QCOMPARE(rotation.transform(), QTransform()); +} + + +QTEST_MAIN(tst_QGraphicsTransform) +#include "tst_qgraphicstransform.moc" + diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 78d13d3..2cfedb1 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1315,6 +1315,12 @@ void tst_QGraphicsWidget::focusNextPrevChild() void tst_QGraphicsWidget::verifyFocusChain() { QGraphicsScene scene; + QGraphicsView view(&scene); + view.show(); +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&view); +#endif + QTest::qWait(250); { // parent/child focus SubQGraphicsWidget *w = new SubQGraphicsWidget(0, Qt::Window); @@ -1448,6 +1454,11 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&view); +#endif + QTest::qWait(250); + // delete item in focus chain with no focus and verify chain SubQGraphicsWidget *parent = new SubQGraphicsWidget(0, Qt::Window); SubQGraphicsWidget *w = new SubQGraphicsWidget(0, Qt::Window); diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro index 9186140..9c2f5cb 100644 --- a/tests/auto/qhttp/qhttp.pro +++ b/tests/auto/qhttp/qhttp.pro @@ -13,6 +13,8 @@ wince*: { addFiles.path = . DEPLOYMENT = addFiles webFiles cgi DEFINES += SRCDIR=\\\"\\\" +} else:vxworks*: { + DEFINES += SRCDIR=\\\"\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro index ea15cfe..56718d0 100644 --- a/tests/auto/qline/qline.pro +++ b/tests/auto/qline/qline.pro @@ -1,6 +1,6 @@ load(qttest_p4) QT -= gui SOURCES += tst_qline.cpp -unix:!mac:LIBS+=-lm +unix:!mac:!vxworks:LIBS+=-lm diff --git a/tests/auto/qmetaobject/qmetaobject.pro b/tests/auto/qmetaobject/qmetaobject.pro index 22119bc..1df54f7 100644 --- a/tests/auto/qmetaobject/qmetaobject.pro +++ b/tests/auto/qmetaobject/qmetaobject.pro @@ -1,4 +1,7 @@ load(qttest_p4) + +QT = core gui + SOURCES += tst_qmetaobject.cpp diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 788be1e..03b1474 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -2642,6 +2642,8 @@ void tst_QNetworkReply::ioPutToFileFromProcess() QCOMPARE(file.size(), qint64(data.size())); QByteArray contents = file.readAll(); QCOMPARE(contents, data); + + delete reply; #endif } diff --git a/tests/auto/qnumeric/tst_qnumeric.cpp b/tests/auto/qnumeric/tst_qnumeric.cpp index fb01e1b..0c83db4 100644 --- a/tests/auto/qnumeric/tst_qnumeric.cpp +++ b/tests/auto/qnumeric/tst_qnumeric.cpp @@ -41,6 +41,7 @@ #include <QtTest/QtTest> +#include <QtGlobal> #include <math.h> @@ -97,8 +98,12 @@ void tst_QNumeric::qNan() if (0 > nan) QFAIL("compiler thinks 0 > nan"); +# if defined(Q_CC_DIAB) + QWARN("!(0 < nan) would fail due to a bug in dcc"); +# else if (0 < nan) QFAIL("compiler thinks 0 < nan"); +# endif #endif QVERIFY(qIsNaN(nan)); QVERIFY(qIsNaN(nan + 1)); diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 98c7a30..6684125 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -121,10 +121,10 @@ signals: private slots: void checkStopWatch() { -#ifndef Q_OS_WINCE - if (stopWatch.elapsed() >= OneMinute) -#else +#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) if (stopWatch.elapsed() >= OneMinute / 2) +#else + if (stopWatch.elapsed() >= OneMinute) #endif quit(); @@ -138,7 +138,7 @@ void tst_QObjectRace::moveToThreadRace() { RaceObject *object = new RaceObject; - enum { ThreadCount = 10 }; + enum { ThreadCount = 6 }; RaceThread *threads[ThreadCount]; for (int i = 0; i < ThreadCount; ++i) { threads[i] = new RaceThread; diff --git a/tests/auto/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/qreadwritelock/tst_qreadwritelock.cpp index 78ddc99..f298812 100644 --- a/tests/auto/qreadwritelock/tst_qreadwritelock.cpp +++ b/tests/auto/qreadwritelock/tst_qreadwritelock.cpp @@ -719,6 +719,8 @@ void tst_QReadWriteLock::multipleReadersLoop() int wait=0; #if defined (Q_OS_HPUX) const int numthreads=50; +#elif defined(Q_OS_VXWORKS) + const int numthreads=40; #else const int numthreads=75; #endif diff --git a/tests/auto/qregexp/qregexp.pro b/tests/auto/qregexp/qregexp.pro index 0712496..d467cda 100644 --- a/tests/auto/qregexp/qregexp.pro +++ b/tests/auto/qregexp/qregexp.pro @@ -2,6 +2,9 @@ load(qttest_p4) QT = core + +QT = core + SOURCES += tst_qregexp.cpp QT -= gui diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index cdbbbd2..8f3ca5c 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -15,6 +15,7 @@ runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runt QMAKE_EXTRA_TARGETS = runtime_resource ALL_DEPS += $${runtime_resource.target} +QT = core wince*:{ deploy.sources += runtime_resource.rcc parentdir.txt test.sources = testqrc/* diff --git a/tests/auto/qresourceengine/tst_resourceengine.cpp b/tests/auto/qresourceengine/tst_resourceengine.cpp index a5e701a..e133a72 100644 --- a/tests/auto/qresourceengine/tst_resourceengine.cpp +++ b/tests/auto/qresourceengine/tst_resourceengine.cpp @@ -108,7 +108,7 @@ void tst_ResourceEngine::checkStructure_data() << QLatin1String("runtime_resource") << QLatin1String("searchpath1") << QLatin1String("searchpath2") << QLatin1String("secondary_root") - << QLatin1String("test") << QLatin1String("trolltech") + << QLatin1String("test") << QLatin1String("withoutslashes")) << QLocale::c() << qlonglong(0); diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index b5aa621..7c74b32 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += script +QT = core gui script SOURCES += tst_qscriptengine.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 57c5167..830cfc7 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -122,6 +122,8 @@ private slots: void reentrancy(); void incDecNonObjectProperty(); void installTranslatorFunctions(); + void functionScopes(); + void nativeFunctionScopes(); }; tst_QScriptEngine::tst_QScriptEngine() @@ -891,6 +893,35 @@ void tst_QScriptEngine::getSetGlobalObject() QVERIFY(eng.globalObject().strictlyEquals(obj)); QVERIFY(eng.currentContext()->thisObject().strictlyEquals(obj)); QVERIFY(eng.currentContext()->activationObject().strictlyEquals(obj)); + + QVERIFY(!obj.property("foo").isValid()); + eng.evaluate("var foo = 123"); + { + QScriptValue ret = obj.property("foo"); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + } + + QVERIFY(!obj.property("bar").isValid()); + eng.evaluate("bar = 456"); + { + QScriptValue ret = obj.property("bar"); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 456); + } + + QVERIFY(!obj.property("baz").isValid()); + eng.evaluate("this['baz'] = 789"); + { + QScriptValue ret = obj.property("baz"); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 789); + } + + { + QScriptValue ret = eng.evaluate("(function() { return this; })()"); + QVERIFY(ret.strictlyEquals(obj)); + } } void tst_QScriptEngine::checkSyntax_data() @@ -3578,5 +3609,108 @@ void tst_QScriptEngine::installTranslatorFunctions() } } +void tst_QScriptEngine::functionScopes() +{ + QScriptEngine eng; + { + // top-level functions have only the global object in their scope + QScriptValue fun = eng.evaluate("(function() {})"); + QVERIFY(fun.isFunction()); + QVERIFY(fun.scope().isObject()); + QVERIFY(fun.scope().strictlyEquals(eng.globalObject())); + QVERIFY(!eng.globalObject().scope().isValid()); + } + { + QScriptValue fun = eng.globalObject().property("Object"); + QVERIFY(fun.isFunction()); + // native built-in functions don't have scope + QVERIFY(!fun.scope().isValid()); + } + { + // closure + QScriptValue fun = eng.evaluate("(function(arg) { var foo = arg; return function() { return foo; }; })(123)"); + QVERIFY(fun.isFunction()); + { + QScriptValue ret = fun.call(); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + } + QScriptValue scope = fun.scope(); + QVERIFY(scope.isObject()); + { + QScriptValue ret = scope.property("foo"); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + QCOMPARE(scope.propertyFlags("foo"), QScriptValue::Undeletable); + } + { + QScriptValue ret = scope.property("arg"); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + QCOMPARE(scope.propertyFlags("arg"), QScriptValue::Undeletable | QScriptValue::SkipInEnumeration); + } + + scope.setProperty("foo", 456); + { + QScriptValue ret = fun.call(); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 456); + } + + scope = scope.scope(); + QVERIFY(scope.isObject()); + QVERIFY(scope.strictlyEquals(eng.globalObject())); + } +} + +static QScriptValue counter_inner(QScriptContext *ctx, QScriptEngine *) +{ + QScriptValue outerAct = ctx->callee().scope(); + double count = outerAct.property("count").toNumber(); + outerAct.setProperty("count", count+1); + return count; +} + +static QScriptValue counter(QScriptContext *ctx, QScriptEngine *eng) +{ + QScriptValue act = ctx->activationObject(); + act.setProperty("count", ctx->argument(0).toInt32()); + QScriptValue result = eng->newFunction(counter_inner); + result.setScope(act); + return result; +} + +static QScriptValue counter_hybrid(QScriptContext *ctx, QScriptEngine *eng) +{ + QScriptValue act = ctx->activationObject(); + act.setProperty("count", ctx->argument(0).toInt32()); + return eng->evaluate("function() { return count++; }"); +} + +void tst_QScriptEngine::nativeFunctionScopes() +{ + QScriptEngine eng; + { + QScriptValue fun = eng.newFunction(counter); + QScriptValue cnt = fun.call(QScriptValue(), QScriptValueList() << 123); + QVERIFY(cnt.isFunction()); + { + QScriptValue ret = cnt.call(); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + } + } + { + QScriptValue fun = eng.newFunction(counter_hybrid); + QScriptValue cnt = fun.call(QScriptValue(), QScriptValueList() << 123); + QVERIFY(cnt.isFunction()); + { + QScriptValue ret = cnt.call(); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + } + } +} + QTEST_MAIN(tst_QScriptEngine) #include "tst_qscriptengine.moc" diff --git a/tests/auto/qscriptqobject/qscriptqobject.pro b/tests/auto/qscriptqobject/qscriptqobject.pro index e4e2b56..be3a980 100644 --- a/tests/auto/qscriptqobject/qscriptqobject.pro +++ b/tests/auto/qscriptqobject/qscriptqobject.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += script +QT = core gui script SOURCES += tst_qscriptqobject.cpp diff --git a/tests/auto/qscriptvalue/qscriptvalue.pro b/tests/auto/qscriptvalue/qscriptvalue.pro index 98fd63d..9efde80 100644 --- a/tests/auto/qscriptvalue/qscriptvalue.pro +++ b/tests/auto/qscriptvalue/qscriptvalue.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += script +QT = core gui script SOURCES += tst_qscriptvalue.cpp diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index ff2df7a..7939b4c 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2148,6 +2148,14 @@ void tst_QScriptValue::getSetScope() QCOMPARE(object2.scope().strictlyEquals(object), true); + object.setProperty("foo", 123); + QVERIFY(!object2.property("foo").isValid()); + { + QScriptValue ret = object2.property("foo", QScriptValue::ResolveScope); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 123); + } + QScriptValue inv; inv.setScope(object); QCOMPARE(inv.scope().isValid(), false); diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index dd53e3c..ae5155e 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -231,6 +231,9 @@ extern int forwardDeclaredDestructorRunCount; void tst_QSharedPointer::forwardDeclaration1() { +#if defined(Q_CC_SUN) + QSKIP("This type of forward declaration is not valid with this compiler", SkipAll); +#else externalForwardDeclaration(); struct Wrapper { QSharedPointer<ForwardDeclared> pointer; }; @@ -242,6 +245,7 @@ void tst_QSharedPointer::forwardDeclaration1() QVERIFY(!w.pointer.isNull()); } QCOMPARE(forwardDeclaredDestructorRunCount, 1); +#endif } #include "forwarddeclared.h" diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h index 9c8c313..8253541 100644 --- a/tests/auto/qsqldatabase/tst_databases.h +++ b/tests/auto/qsqldatabase/tst_databases.h @@ -335,7 +335,7 @@ public: if(table2.compare(table.section('.', -1, -1), Qt::CaseInsensitive) == 0) { table=db.driver()->escapeIdentifier(table2, QSqlDriver::TableName); wasDropped = q.exec( "drop table " + table); - dbtables.removeAll(table); + dbtables.removeAll(table2); } } } @@ -430,8 +430,8 @@ public: return "IDENTITY"; /* if ( db.driverName().startsWith( "QPSQL" ) ) return "SERIAL";*/ - if ( db.driverName().startsWith( "QDB2" ) ) - return "GENERATED BY DEFAULT AS IDENTITY"; +// if ( db.driverName().startsWith( "QDB2" ) ) +// return "GENERATED BY DEFAULT AS IDENTITY"; return QString(); } @@ -483,6 +483,10 @@ public: { return db.driverName().startsWith("QMYSQL") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("MySQL") ); } + static bool isDB2( QSqlDatabase db ) + { + return db.driverName().startsWith("QDB2") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("db2") ); + } // -1 on fail, else Oracle version static int getOraVersion( QSqlDatabase db ) diff --git a/tests/auto/qstring/qstring.pro b/tests/auto/qstring/qstring.pro index 02253c2..eb52d90 100644 --- a/tests/auto/qstring/qstring.pro +++ b/tests/auto/qstring/qstring.pro @@ -1,8 +1,6 @@ load(qttest_p4) SOURCES += tst_qstring.cpp -QT -= gui - QT = core DEFINES += QT_NO_CAST_TO_ASCII diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro index 6924309..6a96889 100644 --- a/tests/auto/qtcpsocket/qtcpsocket.pro +++ b/tests/auto/qtcpsocket/qtcpsocket.pro @@ -3,3 +3,4 @@ TEMPLATE = subdirs !wince*: SUBDIRS = test stressTest wince*: SUBDIRS = test +vxworks*: SUBDIRS = test diff --git a/tests/auto/qtcpsocket/test/test.pro b/tests/auto/qtcpsocket/test/test.pro index fecbf11..696375d 100644 --- a/tests/auto/qtcpsocket/test/test.pro +++ b/tests/auto/qtcpsocket/test/test.pro @@ -9,6 +9,7 @@ wince*: { } } QT += network +vxworks:QT -= gui DEFINES += TEST_QNETWORK_PROXY diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 9e55764..6b0a5be 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -60,10 +60,12 @@ #include <QHostAddress> #include <QHostInfo> #include <QMap> +#ifndef Q_OS_VXWORKS #include <QMessageBox> +#include <QPushButton> +#endif #include <QPointer> #include <QProcess> -#include <QPushButton> #include <QStringList> #include <QTcpServer> #include <QTcpSocket> @@ -172,9 +174,7 @@ private slots: void connectToLocalHostNoService(); #endif void waitForConnectedInHostLookupSlot(); -#ifndef Q_OS_WIN void waitForConnectedInHostLookupSlot2(); -#endif void readyReadSignalsAfterWaitForReadyRead(); #ifdef Q_OS_LINUX void linuxKernelBugLocalSocket(); @@ -1573,6 +1573,7 @@ void tst_QTcpSocket::remoteCloseErrorSlot() void tst_QTcpSocket::messageBoxSlot() { +#if !defined(Q_OS_VXWORKS) // no gui QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender()); socket->deleteLater(); QMessageBox box; @@ -1583,10 +1584,14 @@ void tst_QTcpSocket::messageBoxSlot() // Fire a non-0 singleshot to leave time for the delete QTimer::singleShot(250, this, SLOT(exitLoopSlot())); +#endif } //---------------------------------------------------------------------------------- void tst_QTcpSocket::openMessageBoxInErrorSlot() { +#if defined(Q_OS_VXWORKS) // no gui + QSKIP("no default gui available on VxWorks", SkipAll); +#else QTcpSocket *socket = newSocket(); QPointer<QTcpSocket> p(socket); connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(messageBoxSlot())); @@ -1594,6 +1599,7 @@ void tst_QTcpSocket::openMessageBoxInErrorSlot() socket->connectToHost("hostnotfoundhostnotfound.troll.no", 9999); // Host not found, fyi enterLoop(30); QVERIFY(!p); +#endif } //---------------------------------------------------------------------------------- @@ -1712,9 +1718,11 @@ public slots: }; //---------------------------------------------------------------------------------- -#ifndef Q_OS_WIN void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() { +#if defined(Q_OS_WIN) || defined(Q_OS_VXWORKS) + QSKIP("waitForConnectedInHostLookupSlot2 is not run on Windows and VxWorks", SkipAll); +#else Foo foo; QPushButton top("Go", 0); @@ -1730,8 +1738,8 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() QVERIFY(foo.attemptedToConnect); QCOMPARE(foo.count, 1); -} #endif +} //---------------------------------------------------------------------------------- void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() @@ -1965,7 +1973,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect_data() void tst_QTcpSocket::suddenRemoteDisconnect() { -#if defined(Q_OS_WINCE) +#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) QSKIP("stressTest subprocess needs Qt3Support", SkipAll); #else QFETCH(QString, client); @@ -2022,6 +2030,9 @@ void tst_QTcpSocket::connectToMultiIP() { QSKIP("TODO: setup DNS in the new network", SkipAll); +#if defined(Q_OS_VXWORKS) + QSKIP("VxSim in standard config doesn't even run a DNS resolver", SkipAll); +#else QFETCH_GLOBAL(bool, ssl); if (ssl) return; @@ -2049,6 +2060,7 @@ void tst_QTcpSocket::connectToMultiIP() QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError); delete socket; +#endif } //---------------------------------------------------------------------------------- diff --git a/tests/auto/qthreadonce/tst_qthreadonce.cpp b/tests/auto/qthreadonce/tst_qthreadonce.cpp index 590de0f..5d9062d 100644 --- a/tests/auto/qthreadonce/tst_qthreadonce.cpp +++ b/tests/auto/qthreadonce/tst_qthreadonce.cpp @@ -134,7 +134,7 @@ void tst_QThreadOnce::sameThread() void tst_QThreadOnce::multipleThreads() { -#ifdef Q_OS_WINCE +#if defined(Q_OS_WINCE) || defined(Q_OS_VXWORKS) const int NumberOfThreads = 20; #else const int NumberOfThreads = 100; diff --git a/tests/auto/qthreadpool/tst_qthreadpool.cpp b/tests/auto/qthreadpool/tst_qthreadpool.cpp index 1111ecc..d4c131d 100644 --- a/tests/auto/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/qthreadpool/tst_qthreadpool.cpp @@ -205,7 +205,8 @@ void tst_QThreadPool::runTask() ran = false; manager.start(new TestTask()); // Hang if task is not runned. - while (ran == false); + while (ran == false) + QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers } /* @@ -215,7 +216,8 @@ void tst_QThreadPool::singleton() { ran = false; QThreadPool::globalInstance()->start(new TestTask()); - while (ran == false); + while (ran == false) + QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers } int *value = 0; diff --git a/tests/auto/qxml/tst_qxml.cpp b/tests/auto/qxml/tst_qxml.cpp index 13de82f..1bc5ef5 100644 --- a/tests/auto/qxml/tst_qxml.cpp +++ b/tests/auto/qxml/tst_qxml.cpp @@ -57,6 +57,7 @@ Q_OBJECT private slots: void getSetCheck(); void interpretedAs0D() const; + void exception(); }; class MyXmlEntityResolver : public QXmlEntityResolver @@ -213,5 +214,30 @@ void tst_QXml::interpretedAs0D() const QCOMPARE(myHandler.attrName, QChar(0x010D) + QString::fromLatin1("reated-by")); } +void tst_QXml::exception() +{ +#ifndef QT_NO_EXCEPTIONS + QString message = QString::fromLatin1("message"); + int column = 3; + int line = 2; + QString publicId = QString::fromLatin1("publicId"); + QString systemId = QString::fromLatin1("systemId"); + + try { + QXmlParseException e(message, column, line, publicId, systemId); + throw e; + } + catch (QXmlParseException e) { + QCOMPARE(e.message(), message); + QCOMPARE(e.columnNumber(), column); + QCOMPARE(e.lineNumber(), line); + QCOMPARE(e.publicId(), publicId); + QCOMPARE(e.systemId(), systemId); + } +#else + QSKIP("Exceptions not available", SkipAll); +#endif +} + QTEST_MAIN(tst_QXml) #include "tst_qxml.moc" diff --git a/tests/auto/qxmlsimplereader/parser/main.cpp b/tests/auto/qxmlsimplereader/parser/main.cpp index 4834428..ffb2ecd 100644 --- a/tests/auto/qxmlsimplereader/parser/main.cpp +++ b/tests/auto/qxmlsimplereader/parser/main.cpp @@ -42,6 +42,7 @@ #include <string.h> #include <errno.h> +#include <stdlib.h> #include <qfile.h> #include <qstring.h> diff --git a/tests/auto/selftests/cmptest/tst_cmptest.cpp b/tests/auto/selftests/cmptest/tst_cmptest.cpp index 59dd678..7395210 100644 --- a/tests/auto/selftests/cmptest/tst_cmptest.cpp +++ b/tests/auto/selftests/cmptest/tst_cmptest.cpp @@ -50,6 +50,8 @@ class tst_Cmptest: public QObject private slots: void compare_boolfuncs(); void compare_pointerfuncs(); + void compare_tostring(); + void compare_tostring_data(); }; static bool boolfunc() { return true; } @@ -76,6 +78,50 @@ void tst_Cmptest::compare_pointerfuncs() QCOMPARE(&i, intptr()); } +Q_DECLARE_METATYPE(QVariant) + +class PhonyClass +{}; + +void tst_Cmptest::compare_tostring_data() +{ + QTest::addColumn<QVariant>("actual"); + QTest::addColumn<QVariant>("expected"); + + QTest::newRow("int, string") + << QVariant::fromValue(123) + << QVariant::fromValue(QString("hi")) + ; + + QTest::newRow("both invalid") + << QVariant() + << QVariant() + ; + + QTest::newRow("null hash, invalid") + << QVariant(QVariant::Hash) + << QVariant() + ; + + QTest::newRow("string, null user type") + << QVariant::fromValue(QString::fromLatin1("A simple string")) + << QVariant(QVariant::Type(qRegisterMetaType<PhonyClass>("PhonyClass"))) + ; + + QTest::newRow("both non-null user type") + << QVariant(qRegisterMetaType<PhonyClass>("PhonyClass"), (const void*)0) + << QVariant(qRegisterMetaType<PhonyClass>("PhonyClass"), (const void*)0) + ; +} + +void tst_Cmptest::compare_tostring() +{ + QFETCH(QVariant, actual); + QFETCH(QVariant, expected); + + QCOMPARE(actual, expected); +} + QTEST_MAIN(tst_Cmptest) #include "tst_cmptest.moc" diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt index dc89d9d..f70eba5 100644 --- a/tests/auto/selftests/expected_cmptest.txt +++ b/tests/auto/selftests/expected_cmptest.txt @@ -1,8 +1,24 @@ ********* Start testing of tst_Cmptest ********* -Config: Using QTest library 4.1.0, Qt 4.1.0 +Config: Using QTest library 4.6.0, Qt 4.6.0 PASS : tst_Cmptest::initTestCase() PASS : tst_Cmptest::compare_boolfuncs() PASS : tst_Cmptest::compare_pointerfuncs() +FAIL! : tst_Cmptest::compare_tostring(int, string) Compared values are not the same + Actual (actual): QVariant(int,123) + Expected (expected): QVariant(QString,hi) + Loc: [/home/rmcgover/depot/qt/master/tests/auto/selftests/cmptest/tst_cmptest.cpp(122)] +FAIL! : tst_Cmptest::compare_tostring(null hash, invalid) Compared values are not the same + Actual (actual): QVariant(QVariantHash) + Expected (expected): QVariant() + Loc: [/home/rmcgover/depot/qt/master/tests/auto/selftests/cmptest/tst_cmptest.cpp(122)] +FAIL! : tst_Cmptest::compare_tostring(string, null user type) Compared values are not the same + Actual (actual): QVariant(QString,A simple string) + Expected (expected): QVariant(PhonyClass) + Loc: [/home/rmcgover/depot/qt/master/tests/auto/selftests/cmptest/tst_cmptest.cpp(122)] +FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values are not the same + Actual (actual): QVariant(PhonyClass,<value not representable as string>) + Expected (expected): QVariant(PhonyClass,<value not representable as string>) + Loc: [/home/rmcgover/depot/qt/master/tests/auto/selftests/cmptest/tst_cmptest.cpp(122)] PASS : tst_Cmptest::cleanupTestCase() -Totals: 4 passed, 0 failed, 0 skipped +Totals: 4 passed, 4 failed, 0 skipped ********* Finished testing of tst_Cmptest ********* diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp index 1afc82e..2cbdfb9 100644 --- a/tests/manual/qdesktopwidget/main.cpp +++ b/tests/manual/qdesktopwidget/main.cpp @@ -130,7 +130,7 @@ private slots: screenNumber->setBrush(fillBrush); screenNumber->setFont(QFont("Arial Black", 18)); screenNumber->setTransform(QTransform().scale(10, 10)); - screenNumber->setTransformOrigin(screenNumber->boundingRect().center()); + screenNumber->setTransformOriginPoint(screenNumber->boundingRect().center()); QSizeF center = (workRect.size() - screenNumber->boundingRect().size()) / 2; screenNumber->setPos(center.width(), center.height()); |