diff options
Diffstat (limited to 'tests/auto')
114 files changed, 785 insertions, 104 deletions
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index a6d76ea7b6..a477d6bc6c 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -270,7 +270,9 @@ static int NColorRoles[] = { QPalette::ToolTipText + 1, // Qt_5_0 QPalette::ToolTipText + 1, // Qt_5_1 QPalette::ToolTipText + 1, // Qt_5_2 - 0 // add the correct value for Qt_5_3 here later + QPalette::ToolTipText + 1, // Qt_5_3 + QPalette::ToolTipText + 1, // Qt_5_4 + 0 // add the correct value for Qt_5_5 here later }; // Testing get/set functions diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp index 80144dba20..07e011f449 100644 --- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp +++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp @@ -163,7 +163,8 @@ public: QDebug operator<< (QDebug s, const MyPoint& point) { const QDebugStateSaver saver(s); - return s.nospace() << "MyPoint(" << point.v1 << ", " << point.v2 << ")"; + s.nospace() << "MyPoint(" << point.v1 << ", " << point.v2 << ")"; + return s; } class MyLine @@ -199,10 +200,19 @@ void tst_QDebug::debugSpaceHandling() const d << 1 << 2; MyLine line(MyPoint(10, 11), MyPoint (12, 13)); d << line; + d << "bar"; // With the old implementation of MyPoint doing dbg.nospace() << ...; dbg.space() we ended up with // MyLine(MyPoint(10, 11) , MyPoint(12, 13) ) } - QCOMPARE(s_msg, QString::fromLatin1(" foo key=value 1 2 MyLine(MyPoint(10, 11), MyPoint(12, 13))")); + QCOMPARE(s_msg, QString::fromLatin1(" foo key=value 1 2 MyLine(MyPoint(10, 11), MyPoint(12, 13)) bar")); + + QVERIFY(qDebug().autoInsertSpaces()); + qDebug() << QPoint(21, 22) << QRect(23, 24, 25, 26) << QLine(27, 28, 29, 30); + QCOMPARE(s_msg, QString::fromLatin1("QPoint(21,22) QRect(23,24 25x26) QLine(QPoint(27,28),QPoint(29,30))")); + qDebug() << QPointF(21, 22) << QRectF(23, 24, 25, 26) << QLineF(27, 28, 29, 30); + QCOMPARE(s_msg, QString::fromLatin1("QPointF(21,22) QRectF(23,24 25x26) QLineF(QPointF(27,28),QPointF(29,30))")); + qDebug() << QMimeType() << QMimeDatabase().mimeTypeForName("application/pdf") << "foo"; + QCOMPARE(s_msg, QString::fromLatin1("QMimeType(invalid) QMimeType(\"application/pdf\") foo")); } void tst_QDebug::stateSaver() const @@ -214,7 +224,7 @@ void tst_QDebug::stateSaver() const QDebugStateSaver saver(d); d.nospace() << hex << right << qSetFieldWidth(3) << qSetPadChar('0') << 42; } - d.space() << 42; + d << 42; } QCOMPARE(s_msg, QString::fromLatin1("02a 42")); } diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 5b1a2cf076..9bcce60e93 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -74,6 +74,7 @@ private slots: void useOfForwardDeclared(); void memoryManagement(); void dropLastReferenceOfForwardDeclared(); + void lock(); void downCast(); void functionCallDownCast(); void upCast(); @@ -391,12 +392,56 @@ void tst_QSharedPointer::swap() QVERIFY(p2 != control); QVERIFY(p2.isNull()); QVERIFY(*p1 == 42); + + QWeakPointer<int> w1, w2 = control; + + QVERIFY(w1.isNull()); + QVERIFY(!w2.isNull()); + QVERIFY(w2.lock() == control); + QVERIFY(!w1.lock()); + + w1.swap(w2); + QVERIFY(w2.isNull()); + QVERIFY(!w1.isNull()); + QVERIFY(w1.lock() == control); + QVERIFY(!w2.lock()); + + qSwap(w1, w2); + QVERIFY(w1.isNull()); + QVERIFY(w2.lock() == control); + + p1.reset(); + p2.reset(); + control.reset(); + + QVERIFY(w1.isNull()); + QVERIFY(w2.isNull()); } void tst_QSharedPointer::useOfForwardDeclared() { // this just a compile test: use the forward-declared class QSharedPointer<ForwardDeclared> sp; + + // copying should work, too: + QSharedPointer<ForwardDeclared> sp2 = sp; + + // and assignment: + QSharedPointer<ForwardDeclared> sp3; + sp3 = sp; + + // move assignment: + QSharedPointer<ForwardDeclared> sp4; + sp4 = qMove(sp); + + // and move constuction: + QSharedPointer<ForwardDeclared> sp5 = qMove(sp2); + + // swapping: + sp4.swap(sp3); + qSwap(sp4, sp3); + + // and, of course, destruction } @@ -474,6 +519,22 @@ void tst_QSharedPointer::dropLastReferenceOfForwardDeclared() QCOMPARE(forwardDeclaredDestructorRunCount, 1); } +void tst_QSharedPointer::lock() +{ + QSharedPointer<int> sp = QSharedPointer<int>::create(); + QVERIFY(sp); + QWeakPointer<int> wp = sp; + QVERIFY(sp == wp); + QVERIFY(sp == wp.lock()); + QVERIFY(sp == wp.toStrongRef()); + + sp.reset(); + QVERIFY(!wp); + QVERIFY(sp != wp); // this is why op(shared_ptr, weak_ptr) is a bad idea (apart from MT races)... + QVERIFY(sp == wp.lock()); + QVERIFY(sp == wp.toStrongRef()); +} + class DerivedData: public Data { public: @@ -846,6 +907,7 @@ void tst_QSharedPointer::objectCast() ptr.clear(); QVERIFY(ptr.isNull()); QVERIFY(weakptr.toStrongRef().isNull()); + QVERIFY(weakptr.lock().isNull()); // verify that the object casts fail without crash QSharedPointer<OtherObject> otherptr = qSharedPointerObjectCast<OtherObject>(weakptr); diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index 246560e47f..d5506f3391 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -296,9 +296,11 @@ void tst_QStringList::removeDuplicates_data() QTest::addColumn<QString>("before"); QTest::addColumn<QString>("after"); QTest::addColumn<int>("count"); + QTest::addColumn<bool>("detached"); - QTest::newRow("empty-1") << "Hello,Hello" << "Hello" << 1; - QTest::newRow("empty-2") << "Hello,World" << "Hello,World" << 0; + QTest::newRow("empty-1") << "Hello,Hello" << "Hello" << 1 << true; + QTest::newRow("empty-2") << "Hello,World" << "Hello,World" << 0 << false; + QTest::newRow("middle") << "Hello,World,Hello" << "Hello,World" << 1 << true; } void tst_QStringList::removeDuplicates() @@ -306,13 +308,16 @@ void tst_QStringList::removeDuplicates() QFETCH(QString, before); QFETCH(QString, after); QFETCH(int, count); + QFETCH(bool, detached); QStringList lbefore = before.split(','); + const QStringList oldlbefore = lbefore; QStringList lafter = after.split(','); int removed = lbefore.removeDuplicates(); QCOMPARE(removed, count); QCOMPARE(lbefore, lafter); + QCOMPARE(detached, !oldlbefore.isSharedWith(lbefore)); } void tst_QStringList::streamingOperator() @@ -321,8 +326,13 @@ void tst_QStringList::streamingOperator() list << "hei"; list << list << "hopp" << list; + QList<QString> slist = list; + list << slist; + QCOMPARE(list, QStringList() << "hei" << "hei" << "hopp" + << "hei" << "hei" << "hopp" + << "hei" << "hei" << "hopp" << "hei" << "hei" << "hopp"); QStringList list2; diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp index c9545c8eb4..f85d2dee0c 100644 --- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp +++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp @@ -225,7 +225,9 @@ private slots: void fromListCustom() const; void fromStdVector() const; void indexOf() const; - void insert() const; + void insertInt() const; + void insertMovable() const; + void insertCustom() const; void isEmpty() const; void last() const; void lastIndexOf() const; @@ -293,6 +295,7 @@ private: template<typename T> void eraseReserved() const; template<typename T> void fill() const; template<typename T> void fromList() const; + template<typename T> void insert() const; template<typename T> void prepend() const; template<typename T> void remove() const; template<typename T> void size() const; @@ -1210,32 +1213,87 @@ void tst_QVector::indexOf() const QVERIFY(myvec.indexOf("A", 4) == -1); } +template <typename T> void tst_QVector::insert() const { - QVector<QString> myvec; - myvec << "A" << "B" << "C"; + QVector<T> myvec; + const T + tA = SimpleValue<T>::at(0), + tB = SimpleValue<T>::at(1), + tC = SimpleValue<T>::at(2), + tX = SimpleValue<T>::at(3), + tZ = SimpleValue<T>::at(4), + tT = SimpleValue<T>::at(5), + ti = SimpleValue<T>::at(6); + myvec << tA << tB << tC; + QVector<T> myvec2 = myvec; // first position - QCOMPARE(myvec.at(0), QLatin1String("A")); - myvec.insert(0, QLatin1String("X")); - QCOMPARE(myvec.at(0), QLatin1String("X")); - QCOMPARE(myvec.at(1), QLatin1String("A")); + QCOMPARE(myvec.at(0), tA); + myvec.insert(0, tX); + QCOMPARE(myvec.at(0), tX); + QCOMPARE(myvec.at(1), tA); + + QCOMPARE(myvec2.at(0), tA); + myvec2.insert(myvec2.begin(), tX); + QCOMPARE(myvec2.at(0), tX); + QCOMPARE(myvec2.at(1), tA); // middle - myvec.insert(1, QLatin1String("Z")); - QCOMPARE(myvec.at(0), QLatin1String("X")); - QCOMPARE(myvec.at(1), QLatin1String("Z")); - QCOMPARE(myvec.at(2), QLatin1String("A")); + myvec.insert(1, tZ); + QCOMPARE(myvec.at(0), tX); + QCOMPARE(myvec.at(1), tZ); + QCOMPARE(myvec.at(2), tA); + + myvec2.insert(myvec2.begin() + 1, tZ); + QCOMPARE(myvec2.at(0), tX); + QCOMPARE(myvec2.at(1), tZ); + QCOMPARE(myvec2.at(2), tA); // end - myvec.insert(5, QLatin1String("T")); - QCOMPARE(myvec.at(5), QLatin1String("T")); - QCOMPARE(myvec.at(4), QLatin1String("C")); + myvec.insert(5, tT); + QCOMPARE(myvec.at(5), tT); + QCOMPARE(myvec.at(4), tC); + + myvec2.insert(myvec2.end(), tT); + QCOMPARE(myvec2.at(5), tT); + QCOMPARE(myvec2.at(4), tC); // insert a lot of garbage in the middle - myvec.insert(2, 2, QLatin1String("infinity")); - QCOMPARE(myvec, QVector<QString>() << "X" << "Z" << "infinity" << "infinity" - << "A" << "B" << "C" << "T"); + myvec.insert(2, 2, ti); + QCOMPARE(myvec, QVector<T>() << tX << tZ << ti << ti + << tA << tB << tC << tT); + + myvec2.insert(myvec2.begin() + 2, 2, ti); + QCOMPARE(myvec2, myvec); + + // insert from references to the same container: + myvec.insert(0, 1, myvec[5]); // inserts tB + myvec2.insert(0, 1, myvec2[5]); // inserts tB + QCOMPARE(myvec, QVector<T>() << tB << tX << tZ << ti << ti + << tA << tB << tC << tT); + QCOMPARE(myvec2, myvec); + + myvec.insert(0, 1, const_cast<const QVector<T>&>(myvec)[0]); // inserts tB + myvec2.insert(0, 1, const_cast<const QVector<T>&>(myvec2)[0]); // inserts tB + QCOMPARE(myvec, QVector<T>() << tB << tB << tX << tZ << ti << ti + << tA << tB << tC << tT); + QCOMPARE(myvec2, myvec); +} + +void tst_QVector::insertInt() const +{ + insert<int>(); +} + +void tst_QVector::insertMovable() const +{ + insert<Movable>(); +} + +void tst_QVector::insertCustom() const +{ + insert<Custom>(); } void tst_QVector::isEmpty() const @@ -1365,13 +1423,28 @@ void tst_QVector::remove() const T val1 = SimpleValue<T>::at(1); T val2 = SimpleValue<T>::at(2); T val3 = SimpleValue<T>::at(3); + T val4 = SimpleValue<T>::at(4); + myvec << val1 << val2 << val3; + myvec << val1 << val2 << val3; myvec << val1 << val2 << val3; // remove middle myvec.remove(1); - QCOMPARE(myvec, QVector<T>() << val1 << val3); + QCOMPARE(myvec, QVector<T>() << val1 << val3 << val1 << val2 << val3 << val1 << val2 << val3); + + // removeOne() + QVERIFY(!myvec.removeOne(val4)); + QVERIFY(myvec.removeOne(val2)); + QCOMPARE(myvec, QVector<T>() << val1 << val3 << val1 << val3 << val1 << val2 << val3); + + // removeAll() + QCOMPARE(myvec.removeAll(val4), 0); + QCOMPARE(myvec.removeAll(val1), 3); + QCOMPARE(myvec, QVector<T>() << val3 << val3 << val2 << val3); + QCOMPARE(myvec.removeAll(val2), 1); + QCOMPARE(myvec, QVector<T>() << val3 << val3 << val3); // remove rest - myvec.remove(0, 2); + myvec.remove(0, 3); QCOMPARE(myvec, QVector<T>()); } diff --git a/tests/auto/gui/image/qpicture/tst_qpicture.cpp b/tests/auto/gui/image/qpicture/tst_qpicture.cpp index 2e766c5bf5..986431941f 100644 --- a/tests/auto/gui/image/qpicture/tst_qpicture.cpp +++ b/tests/auto/gui/image/qpicture/tst_qpicture.cpp @@ -45,6 +45,7 @@ #include <qpicture.h> #include <qpainter.h> #include <qimage.h> +#include <qpaintengine.h> #ifndef QT_NO_WIDGETS #include <qdesktopwidget.h> #include <qapplication.h> @@ -64,7 +65,7 @@ private slots: void paintingActive(); void boundingRect(); void swap(); - void operator_lt_lt(); + void serialization(); #ifndef QT_NO_WIDGETS void save_restore(); @@ -169,36 +170,94 @@ void tst_QPicture::swap() QCOMPARE(p2.boundingRect(), QRect(0,0,5,5)); } -// operator<< and operator>> -void tst_QPicture::operator_lt_lt() +Q_DECLARE_METATYPE(QDataStream::Version) +Q_DECLARE_METATYPE(QPicture) + +void ensureSerializesCorrectly(const QPicture &picture, QDataStream::Version version) + { + QDataStream stream; + + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + stream.setDevice(&buffer); + stream.setVersion(version); + stream << picture; + buffer.close(); + + buffer.open(QIODevice::ReadOnly); + QPicture readpicture; + stream >> readpicture; + QVERIFY2(memcmp(picture.data(), readpicture.data(), picture.size()) == 0, + qPrintable(QString::fromLatin1("Picture data does not compare equal for QDataStream version %1").arg(version))); +} + +class PaintEngine : public QPaintEngine { - // streaming of null pictures - { - QPicture pic1, pic2; - QByteArray ba( 100, 0 ); - QDataStream str1( &ba, QIODevice::WriteOnly ); - str1 << pic1; - QDataStream str2( &ba, QIODevice::ReadOnly ); - str2 >> pic2; - QVERIFY( pic2.isNull() ); +public: + PaintEngine() : QPaintEngine() {} + bool begin(QPaintDevice *) { return true; } + bool end() { return true; } + void updateState(const QPaintEngineState &) {} + void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) {} + Type type() const { return Raster; } + + QFont font() { return state->font(); } +}; + +class Picture : public QPicture +{ +public: + Picture() : QPicture() {} + QPaintEngine *paintEngine() const { return (QPaintEngine*)&mPaintEngine; } +private: + PaintEngine mPaintEngine; +}; + +void tst_QPicture::serialization() +{ + QDataStream stream; + const int thisVersion = stream.version(); + + for (int version = QDataStream::Qt_1_0; version <= thisVersion; ++version) { + const QDataStream::Version versionEnum = static_cast<QDataStream::Version>(version); + + { + // streaming of null pictures + ensureSerializesCorrectly(QPicture(), versionEnum); + } + { + // picture with a simple line, checking bitwise equality + QPicture picture; + QPainter painter(&picture); + painter.drawLine(10, 20, 30, 40); + ensureSerializesCorrectly(picture, versionEnum); + } } - // picture with a simple line, checking bitwise equality { - QPicture pic1, pic2; - QPainter p( &pic1 ); - p.drawLine( 10, 20, 30, 40 ); - p.end(); - QByteArray ba( 10 * pic1.size(), 0 ); - QDataStream str1( &ba, QIODevice::WriteOnly ); - str1 << pic1; - QDataStream str2( &ba, QIODevice::ReadOnly ); - str2 >> pic2; - QCOMPARE( pic1.size(), pic2.size() ); - QVERIFY( memcmp( pic1.data(), pic2.data(), pic1.size() ) == 0 ); + // Test features that were added after Qt 4.5, as that was hard-coded as the major + // version for a while, which was incorrect. In this case, we'll test font hints. + QPicture picture; + QPainter painter; + QFont font; + font.setStyleName("Blah"); + font.setHintingPreference(QFont::PreferFullHinting); + painter.begin(&picture); + painter.setFont(font); + painter.drawText(20, 20, "Hello"); + painter.end(); + + Picture customPicture; + painter.begin(&customPicture); + picture.play(&painter); + const QFont actualFont = ((PaintEngine*)customPicture.paintEngine())->font(); + painter.end(); + QCOMPARE(actualFont.styleName(), QStringLiteral("Blah")); + QCOMPARE(actualFont.hintingPreference(), QFont::PreferFullHinting); } } + #ifndef QT_NO_WIDGETS static QPointF scalePoint(const QPointF &point, QPaintDevice *sourceDevice, QPaintDevice *destDevice) { diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp index 1b1f5575b1..2e1d55ced4 100644 --- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp @@ -530,10 +530,19 @@ static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData); void tst_QColor::setNamedColor() { for (int i = 0; i < rgbTblSize; ++i) { - QColor color; - color.setNamedColor(QLatin1String(rgbTbl[i].name)); QColor expected; expected.setRgba(rgbTbl[i].value); + + QColor color; + color.setNamedColor(QLatin1String(rgbTbl[i].name)); + QCOMPARE(color, expected); + + // name should be case insensitive + color.setNamedColor(QString(rgbTbl[i].name).toUpper()); + QCOMPARE(color, expected); + + // spaces should be ignored + color.setNamedColor(QString(rgbTbl[i].name).insert(1, ' ')); QCOMPARE(color, expected); } } diff --git a/tests/auto/gui/painting/qpen/tst_qpen.cpp b/tests/auto/gui/painting/qpen/tst_qpen.cpp index 07c996d026..a373c51710 100644 --- a/tests/auto/gui/painting/qpen/tst_qpen.cpp +++ b/tests/auto/gui/painting/qpen/tst_qpen.cpp @@ -57,6 +57,8 @@ public: private slots: void getSetCheck(); void swap(); + void move(); + void move_assign(); void operator_eq_eq(); void operator_eq_eq_data(); @@ -101,6 +103,57 @@ void tst_QPen::swap() QCOMPARE(p2.color(), QColor(Qt::black)); } +void tst_QPen::move() +{ + QPen p1(Qt::black); + + // check that moving does the right thing: + QPen p2 = qMove(p1); // could be move or copy construction, so don't check p1's state + QCOMPARE(p2.color(), QColor(Qt::black)); + + // this, executed ehre, would crash: + // QVERIFY(p1.style() != Qt::NoPen); + + // check that moved-from QPen p1 can still be safely copied: + const QPen p3 = p1; + + // check that moved-from QPen p1 can still be safely assigned to: + const QPen p4(Qt::yellow); + p1 = p4; + QCOMPARE(p1.color(), QColor(Qt::yellow)); + + // check that moved-from QPens p2, p3 can still be safely destroyed: + QPen p5 = qMove(p2); + + // intentionally no more statements beyond this point +} + +void tst_QPen::move_assign() +{ + QPen p1(Qt::black), p2(Qt::white); + + // check that moving does the right thing: + p2 = qMove(p1); // could be move or copy assignment, so don't check p1's state + QCOMPARE(p2.color(), QColor(Qt::black)); + + // check that move-assigned-from QPen p1 can still be used, albeit + // with undocumented state (it's p2's original state): + QVERIFY(p1.style() != Qt::NoPen); + + // check that moved-from QPen p1 can still be safely copied: + const QPen p3 = p1; + + // check that moved-from QPen p1 can still be safely assigned to: + const QPen p4(Qt::yellow); + p1 = p4; + QCOMPARE(p1.color(), QColor(Qt::yellow)); + + // check that moved-from QPens p2, p3 can still be safely destroyed: + QPen p5; + p5 = qMove(p2); + + // intentionally no more statements beyond this point +} tst_QPen::tst_QPen() diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 4c88212c72..6f75a1f8bb 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -76,7 +76,8 @@ private slots: void isCopyOf(); void italicOblique(); void insertAndRemoveSubstitutions(); - void serializeSpacing(); + void serialize_data(); + void serialize(); void lastResortFont(); void styleName(); void defaultFamily_data(); @@ -534,7 +535,6 @@ void tst_QFont::insertAndRemoveSubstitutions() QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); } - static QFont copyFont(const QFont &font1) // copy using a QDataStream { QBuffer buffer; @@ -549,29 +549,115 @@ static QFont copyFont(const QFont &font1) // copy using a QDataStream return font2; } -void tst_QFont::serializeSpacing() +Q_DECLARE_METATYPE(QDataStream::Version) + +void tst_QFont::serialize_data() { - QFont font; - QCOMPARE(font.letterSpacing(), 0.); - QCOMPARE(font.wordSpacing(), 0.); + QTest::addColumn<QFont>("font"); + // The version in which the tested feature was added. + QTest::addColumn<QDataStream::Version>("minimumStreamVersion"); + + QFont basicFont; + // Versions <= Qt 2.1 had broken point size serialization, + // so we set an integer point size. + basicFont.setPointSize(9); + + QFont font = basicFont; + QTest::newRow("defaultConstructed") << font << QDataStream::Qt_1_0; font.setLetterSpacing(QFont::AbsoluteSpacing, 105); - QCOMPARE(font.letterSpacing(), 105.); - QCOMPARE(font.letterSpacingType(), QFont::AbsoluteSpacing); - QCOMPARE(font.wordSpacing(), 0.); - QFont font2 = copyFont(font); - QCOMPARE(font2.letterSpacing(), 105.); - QCOMPARE(font2.letterSpacingType(), QFont::AbsoluteSpacing); - QCOMPARE(font2.wordSpacing(), 0.); + QTest::newRow("letterSpacing") << font << QDataStream::Qt_4_5; + font = basicFont; font.setWordSpacing(50.0); - QCOMPARE(font.letterSpacing(), 105.); - QCOMPARE(font.wordSpacing(), 50.); + QTest::newRow("wordSpacing") << font << QDataStream::Qt_4_5; + + font = basicFont; + font.setPointSize(20); + QTest::newRow("pointSize") << font << QDataStream::Qt_1_0; + + font = basicFont; + font.setPixelSize(32); + QTest::newRow("pixelSize") << font << QDataStream::Qt_3_0; + + font = basicFont; + font.setStyleHint(QFont::Monospace); + QTest::newRow("styleHint") << font << QDataStream::Qt_1_0; + + font = basicFont; + font.setStretch(4000); + QTest::newRow("stretch") << font << QDataStream::Qt_4_3; + + font = basicFont; + font.setWeight(99); + QTest::newRow("weight") << font << QDataStream::Qt_1_0; + + font = basicFont; + font.setUnderline(true); + QTest::newRow("underline") << font << QDataStream::Qt_1_0; + + font = basicFont; + font.setStrikeOut(true); + QTest::newRow("strikeOut") << font << QDataStream::Qt_1_0; + + font = basicFont; + font.setFixedPitch(true); + // This fails for versions less than this, as ignorePitch is set to false + // whenever setFixedPitch() is called, but ignorePitch is considered an + // extended bit, which were apparently not available until 4.4. + QTest::newRow("fixedPitch") << font << QDataStream::Qt_4_4; + + font = basicFont; + font.setLetterSpacing(QFont::AbsoluteSpacing, 10); + // Fails for 4.4 because letterSpacing wasn't read until 4.5. + QTest::newRow("letterSpacing") << font << QDataStream::Qt_4_5; + + font = basicFont; + font.setRawMode(true); + QTest::newRow("rawMode") << font << QDataStream::Qt_1_0; + + font = basicFont; + font.setKerning(false); + QTest::newRow("kerning") << font << QDataStream::Qt_4_0; + + font = basicFont; + font.setStyleStrategy(QFont::NoFontMerging); + // This wasn't read properly until 5.4. + QTest::newRow("styleStrategy") << font << QDataStream::Qt_5_4; + + font = basicFont; + font.setHintingPreference(QFont::PreferFullHinting); + // This wasn't read until 5.4. + QTest::newRow("hintingPreference") << font << QDataStream::Qt_5_4; + + font = basicFont; + font.setStyleName("Regular Black Condensed"); + // This wasn't read until 5.4. + QTest::newRow("styleName") << font << QDataStream::Qt_5_4; +} - QFont font3 = copyFont(font); - QCOMPARE(font3.letterSpacing(), 105.); - QCOMPARE(font3.letterSpacingType(), QFont::AbsoluteSpacing); - QCOMPARE(font3.wordSpacing(), 50.); +void tst_QFont::serialize() +{ + QFETCH(QFont, font); + QFETCH(QDataStream::Version, minimumStreamVersion); + + QDataStream stream; + const int thisVersion = stream.version(); + + for (int version = minimumStreamVersion; version <= thisVersion; ++version) { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + stream.setDevice(&buffer); + stream.setVersion(version); + stream << font; + buffer.close(); + + buffer.open(QIODevice::ReadOnly); + QFont readFont; + stream >> readFont; + QVERIFY2(readFont == font, qPrintable(QString::fromLatin1("Fonts do not compare equal for QDataStream version ") + + QString::fromLatin1("%1:\nactual: %2\nexpected: %3").arg(version).arg(readFont.toString()).arg(font.toString()))); + } } // QFont::lastResortFont() may abort with qFatal() on QWS/QPA diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp index ae6e450301..08c7148342 100644 --- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp @@ -312,16 +312,24 @@ void tst_QRawFont::advances() bool supportsSubPixelPositions = font_d->fontEngine->supportsSubPixelPositions(); QVector<QPointF> advances = font.advancesForGlyphIndexes(glyphIndices); - for (int i=0; i<glyphIndices.size(); ++i) { -#ifdef Q_OS_WIN - // In Windows, freetype engine returns advance of 9 when full hinting is used (default) for - // some of the glyphs. - if (font_d->fontEngine->type() == QFontEngine::Freetype - && (hintingPreference == QFont::PreferFullHinting || hintingPreference == QFont::PreferDefaultHinting) - && (i == 0 || i == 5)) { - QEXPECT_FAIL("", "Advance for some glyphs is not the expected with Windows Freetype engine (9 instead of 8)", Continue); - } + + // On Windows and QNX, freetype engine returns advance of 9 for some of the glyphs + // when full hinting is used (default on Windows). + bool mayFail = false; +#if defined (Q_OS_WIN) + mayFail = font_d->fontEngine->type() == QFontEngine::Freetype + && (hintingPreference == QFont::PreferFullHinting + || hintingPreference == QFont::PreferDefaultHinting); +#elif defined(Q_OS_QNX) + mayFail = font_d->fontEngine->type() == QFontEngine::Freetype + && hintingPreference == QFont::PreferFullHinting; #endif + + for (int i = 0; i < glyphIndices.size(); ++i) { + if (mayFail && (i == 0 || i == 5)) { + QEXPECT_FAIL("", "FreeType engine reports unexpected advance " + "for some glyphs (9 instead of 8)", Continue); + } QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0)); if (supportsSubPixelPositions) QVERIFY(advances.at(i).x() > 8.0); @@ -339,16 +347,11 @@ void tst_QRawFont::advances() QVERIFY(font.advancesForGlyphIndexes(glyphIndices.constData(), advances.data(), numGlyphs)); - for (int i=0; i<glyphIndices.size(); ++i) { -#ifdef Q_OS_WIN - // In Windows, freetype engine returns advance of 9 when full hinting is used (default) for - // some of the glyphs. - if (font_d->fontEngine->type() == QFontEngine::Freetype - && (hintingPreference == QFont::PreferFullHinting || hintingPreference == QFont::PreferDefaultHinting) - && (i == 0 || i == 5)) { - QEXPECT_FAIL("", "Advance for some glyphs is not the expected with Windows Freetype engine (9 instead of 8)", Continue); + for (int i = 0; i < glyphIndices.size(); ++i) { + if (mayFail && (i == 0 || i == 5)) { + QEXPECT_FAIL("", "FreeType engine reports unexpected advance " + "for some glyphs (9 instead of 8)", Continue); } -#endif QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0)); if (supportsSubPixelPositions) QVERIFY(advances.at(i).x() > 8.0); diff --git a/tests/auto/testlib/selftests/expected_assert.lightxml b/tests/auto/testlib/selftests/expected_assert.lightxml index d2d4ae5153..b40ff41da3 100644 --- a/tests/auto/testlib/selftests/expected_assert.lightxml +++ b/tests/auto/testlib/selftests/expected_assert.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_assert.xml b/tests/auto/testlib/selftests/expected_assert.xml index 9e5ea760ae..9770b3cd57 100644 --- a/tests/auto/testlib/selftests/expected_assert.xml +++ b/tests/auto/testlib/selftests/expected_assert.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Assert"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_assert.xunitxml b/tests/auto/testlib/selftests/expected_assert.xunitxml index 0aebe72745..96daa33dcf 100644 --- a/tests/auto/testlib/selftests/expected_assert.xunitxml +++ b/tests/auto/testlib/selftests/expected_assert.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testNumber1"/> diff --git a/tests/auto/testlib/selftests/expected_badxml.lightxml b/tests/auto/testlib/selftests/expected_badxml.lightxml index e4c79e3bb0..94f479a79a 100644 --- a/tests/auto/testlib/selftests/expected_badxml.lightxml +++ b/tests/auto/testlib/selftests/expected_badxml.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_badxml.xml b/tests/auto/testlib/selftests/expected_badxml.xml index 0811db0f3a..c1266bfeed 100644 --- a/tests/auto/testlib/selftests/expected_badxml.xml +++ b/tests/auto/testlib/selftests/expected_badxml.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BadXml"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_badxml.xunitxml b/tests/auto/testlib/selftests/expected_badxml.xunitxml index a696da58c9..49048fdad6 100644 --- a/tests/auto/testlib/selftests/expected_badxml.xunitxml +++ b/tests/auto/testlib/selftests/expected_badxml.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="badDataTag"> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml index 08872be733..6fe511462c 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xml b/tests/auto/testlib/selftests/expected_benchlibcounting.xml index ee6fd98ef2..d945511eec 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcounting.xml +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibCounting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml b/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml index 83e429aa3a..05d1da9874 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="passingBenchmark"> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml index cba91a374f..0bc00569e9 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml index 7d28975ead..f543e2775c 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibEventCounter"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml index 60dca28d4f..ce0a81110d 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="events"> diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml index 97422240d9..11296ad9c2 100644 --- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml index 24c2e51084..3dd56b4af7 100644 --- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml +++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibTickCounter"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml index 28c8f11143..779d3bdcbc 100644 --- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="threeBillionTicks"> diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml b/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml index b2e819b26d..c75a6c944d 100644 --- a/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.xml b/tests/auto/testlib/selftests/expected_benchlibwalltime.xml index 6ae355783a..a2f0edecc6 100644 --- a/tests/auto/testlib/selftests/expected_benchlibwalltime.xml +++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.xml @@ -2,6 +2,7 @@ <TestCase name="tst_BenchlibWalltime"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml b/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml index e4ffca4d09..6a0510c4c9 100644 --- a/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml +++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="waitForOneThousand"> diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml index 3a776ea7cb..4a376b5c8b 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.lightxml +++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml index 970544e4b6..aefb1b5f4c 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xml +++ b/tests/auto/testlib/selftests/expected_cmptest.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Cmptest"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml index 7874c6c52e..7502d3cc54 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml +++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="compare_boolfuncs"/> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml index c11017f022..894ae7ae23 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.xml b/tests/auto/testlib/selftests/expected_commandlinedata.xml index 20dc0c6a7c..b2aa98f6a7 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.xml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_DataTable"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml b/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml index 45b833cf19..5072a7e6f4 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="fiveTablePasses"> diff --git a/tests/auto/testlib/selftests/expected_counting.lightxml b/tests/auto/testlib/selftests/expected_counting.lightxml index e5fe1ee3cf..836c35fb85 100644 --- a/tests/auto/testlib/selftests/expected_counting.lightxml +++ b/tests/auto/testlib/selftests/expected_counting.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_counting.xml b/tests/auto/testlib/selftests/expected_counting.xml index e015dddcc6..892fd762c6 100644 --- a/tests/auto/testlib/selftests/expected_counting.xml +++ b/tests/auto/testlib/selftests/expected_counting.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Counting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_counting.xunitxml b/tests/auto/testlib/selftests/expected_counting.xunitxml index 72bf047ba8..cb3a7815af 100644 --- a/tests/auto/testlib/selftests/expected_counting.xunitxml +++ b/tests/auto/testlib/selftests/expected_counting.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"/> diff --git a/tests/auto/testlib/selftests/expected_datatable.lightxml b/tests/auto/testlib/selftests/expected_datatable.lightxml index 6cc2d1c46f..c14a6a1940 100644 --- a/tests/auto/testlib/selftests/expected_datatable.lightxml +++ b/tests/auto/testlib/selftests/expected_datatable.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datatable.xml b/tests/auto/testlib/selftests/expected_datatable.xml index 79963db0a4..297cb0d5de 100644 --- a/tests/auto/testlib/selftests/expected_datatable.xml +++ b/tests/auto/testlib/selftests/expected_datatable.xml @@ -2,6 +2,7 @@ <TestCase name="tst_DataTable"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datatable.xunitxml b/tests/auto/testlib/selftests/expected_datatable.xunitxml index 6bac80e0a2..89fc7ee819 100644 --- a/tests/auto/testlib/selftests/expected_datatable.xunitxml +++ b/tests/auto/testlib/selftests/expected_datatable.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="singleTestFunction1"/> diff --git a/tests/auto/testlib/selftests/expected_datetime.lightxml b/tests/auto/testlib/selftests/expected_datetime.lightxml index 02c60d04f9..48ad0933f7 100644 --- a/tests/auto/testlib/selftests/expected_datetime.lightxml +++ b/tests/auto/testlib/selftests/expected_datetime.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datetime.xml b/tests/auto/testlib/selftests/expected_datetime.xml index 03aec4430e..30afde60ec 100644 --- a/tests/auto/testlib/selftests/expected_datetime.xml +++ b/tests/auto/testlib/selftests/expected_datetime.xml @@ -2,6 +2,7 @@ <TestCase name="tst_DateTime"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_datetime.xunitxml b/tests/auto/testlib/selftests/expected_datetime.xunitxml index 00bd43f904..901462b6bf 100644 --- a/tests/auto/testlib/selftests/expected_datetime.xunitxml +++ b/tests/auto/testlib/selftests/expected_datetime.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="dateTime"> diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml b/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml index 6c9675a2aa..2b802aabaf 100644 --- a/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml +++ b/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> @@ -7,7 +8,7 @@ <Duration msecs="0"/> </TestFunction> <TestFunction name="throwException"> -<Incident type="fail" file="/home/frederik/dev/qt/qt-src-dev/qtbase/src/testlib/qtestcase.cpp" line="2229"> +<Incident type="fail" file="qtestcase.cpp" line="2235"> <Description><![CDATA[Caught unhandled exception]]></Description> </Incident> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.xml b/tests/auto/testlib/selftests/expected_exceptionthrow.xml index 87d9d2d431..a265d5ba5f 100644 --- a/tests/auto/testlib/selftests/expected_exceptionthrow.xml +++ b/tests/auto/testlib/selftests/expected_exceptionthrow.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Exception"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> @@ -9,7 +10,7 @@ <Duration msecs="0"/> </TestFunction> <TestFunction name="throwException"> -<Incident type="fail" file="/home/frederik/dev/qt/qt-src-dev/qtbase/src/testlib/qtestcase.cpp" line="2229"> +<Incident type="fail" file="qtestcase.cpp" line="2235"> <Description><![CDATA[Caught unhandled exception]]></Description> </Incident> <Duration msecs="0"/> diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml b/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml index ab0d379255..7d10bf6f04 100644 --- a/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml +++ b/tests/auto/testlib/selftests/expected_exceptionthrow.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="throwException"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.lightxml b/tests/auto/testlib/selftests/expected_expectfail.lightxml index e5fcca5875..cd5ab78fbe 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.lightxml +++ b/tests/auto/testlib/selftests/expected_expectfail.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.xml b/tests/auto/testlib/selftests/expected_expectfail.xml index 14fee2129e..a98b97810c 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.xml +++ b/tests/auto/testlib/selftests/expected_expectfail.xml @@ -2,6 +2,7 @@ <TestCase name="tst_ExpectFail"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.xunitxml b/tests/auto/testlib/selftests/expected_expectfail.xunitxml index 45c260c77f..47483d71bf 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.xunitxml +++ b/tests/auto/testlib/selftests/expected_expectfail.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="xfail" name="xfailAndContinue"> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.lightxml b/tests/auto/testlib/selftests/expected_failcleanup.lightxml index cfc18ef5da..b2db64c4e2 100644 --- a/tests/auto/testlib/selftests/expected_failcleanup.lightxml +++ b/tests/auto/testlib/selftests/expected_failcleanup.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.xml b/tests/auto/testlib/selftests/expected_failcleanup.xml index 3aa7aa265d..476e56c4f4 100644 --- a/tests/auto/testlib/selftests/expected_failcleanup.xml +++ b/tests/auto/testlib/selftests/expected_failcleanup.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FailCleanup"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.xunitxml b/tests/auto/testlib/selftests/expected_failcleanup.xunitxml index 6e35566be8..813e284ee0 100644 --- a/tests/auto/testlib/selftests/expected_failcleanup.xunitxml +++ b/tests/auto/testlib/selftests/expected_failcleanup.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="aTestFunction"/> diff --git a/tests/auto/testlib/selftests/expected_failinit.lightxml b/tests/auto/testlib/selftests/expected_failinit.lightxml index c0d193998d..5a940fc36b 100644 --- a/tests/auto/testlib/selftests/expected_failinit.lightxml +++ b/tests/auto/testlib/selftests/expected_failinit.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinit.xml b/tests/auto/testlib/selftests/expected_failinit.xml index 70ad613f3f..51e1a7fce4 100644 --- a/tests/auto/testlib/selftests/expected_failinit.xml +++ b/tests/auto/testlib/selftests/expected_failinit.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FailInit"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinit.xunitxml b/tests/auto/testlib/selftests/expected_failinit.xunitxml index 3c2e31be29..3715725ea5 100644 --- a/tests/auto/testlib/selftests/expected_failinit.xunitxml +++ b/tests/auto/testlib/selftests/expected_failinit.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="fail" name="initTestCase"> <failure message="'false' returned FALSE. ()" result="fail"/> diff --git a/tests/auto/testlib/selftests/expected_failinitdata.lightxml b/tests/auto/testlib/selftests/expected_failinitdata.lightxml index 285471470f..f9da42c060 100644 --- a/tests/auto/testlib/selftests/expected_failinitdata.lightxml +++ b/tests/auto/testlib/selftests/expected_failinitdata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinitdata.xml b/tests/auto/testlib/selftests/expected_failinitdata.xml index e86e102202..e843863bfc 100644 --- a/tests/auto/testlib/selftests/expected_failinitdata.xml +++ b/tests/auto/testlib/selftests/expected_failinitdata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FailInitData"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_failinitdata.xunitxml b/tests/auto/testlib/selftests/expected_failinitdata.xunitxml index f32ccd5e81..d245bc0dff 100644 --- a/tests/auto/testlib/selftests/expected_failinitdata.xunitxml +++ b/tests/auto/testlib/selftests/expected_failinitdata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="fail" name="initTestCase"> <failure message="'false' returned FALSE. ()" result="fail"/> diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.lightxml b/tests/auto/testlib/selftests/expected_fetchbogus.lightxml index c5587cf031..c62a93eb49 100644 --- a/tests/auto/testlib/selftests/expected_fetchbogus.lightxml +++ b/tests/auto/testlib/selftests/expected_fetchbogus.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.xml b/tests/auto/testlib/selftests/expected_fetchbogus.xml index 40295bdebc..c20de137a2 100644 --- a/tests/auto/testlib/selftests/expected_fetchbogus.xml +++ b/tests/auto/testlib/selftests/expected_fetchbogus.xml @@ -2,6 +2,7 @@ <TestCase name="tst_FetchBogus"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml b/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml index fe31b4b600..77ccbd896a 100644 --- a/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml +++ b/tests/auto/testlib/selftests/expected_fetchbogus.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="fetchBogus"> diff --git a/tests/auto/testlib/selftests/expected_findtestdata.lightxml b/tests/auto/testlib/selftests/expected_findtestdata.lightxml index 4c1c7298ed..e3c3cea7bc 100644 --- a/tests/auto/testlib/selftests/expected_findtestdata.lightxml +++ b/tests/auto/testlib/selftests/expected_findtestdata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_findtestdata.xml b/tests/auto/testlib/selftests/expected_findtestdata.xml index b1f33abaf6..6abaa15103 100644 --- a/tests/auto/testlib/selftests/expected_findtestdata.xml +++ b/tests/auto/testlib/selftests/expected_findtestdata.xml @@ -2,6 +2,7 @@ <TestCase name="FindTestData"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_findtestdata.xunitxml b/tests/auto/testlib/selftests/expected_findtestdata.xunitxml index 60283a1064..c1138da6cb 100644 --- a/tests/auto/testlib/selftests/expected_findtestdata.xunitxml +++ b/tests/auto/testlib/selftests/expected_findtestdata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="paths"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml index fd128d2c61..7d4c43905c 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.lightxml +++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml index 0867619fde..5e5d4d8922 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xml +++ b/tests/auto/testlib/selftests/expected_globaldata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_globaldata"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.xunitxml b/tests/auto/testlib/selftests/expected_globaldata.xunitxml index e8cd03a59c..bdd7e3f00a 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xunitxml +++ b/tests/auto/testlib/selftests/expected_globaldata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"> <!-- message="initTestCase initTestCase (null)" type="qdebug" --> diff --git a/tests/auto/testlib/selftests/expected_longstring.lightxml b/tests/auto/testlib/selftests/expected_longstring.lightxml index 45c6d3f78d..f8796bed4a 100644 --- a/tests/auto/testlib/selftests/expected_longstring.lightxml +++ b/tests/auto/testlib/selftests/expected_longstring.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_longstring.xml b/tests/auto/testlib/selftests/expected_longstring.xml index efc29d6def..6623b7cd88 100644 --- a/tests/auto/testlib/selftests/expected_longstring.xml +++ b/tests/auto/testlib/selftests/expected_longstring.xml @@ -2,6 +2,7 @@ <TestCase name="tst_LongString"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_longstring.xunitxml b/tests/auto/testlib/selftests/expected_longstring.xunitxml index 6486817dbb..269c06fe08 100644 --- a/tests/auto/testlib/selftests/expected_longstring.xunitxml +++ b/tests/auto/testlib/selftests/expected_longstring.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="failWithLongString"> diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.lightxml b/tests/auto/testlib/selftests/expected_maxwarnings.lightxml index ce6d828eb2..49db189352 100644 --- a/tests/auto/testlib/selftests/expected_maxwarnings.lightxml +++ b/tests/auto/testlib/selftests/expected_maxwarnings.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.xml b/tests/auto/testlib/selftests/expected_maxwarnings.xml index 758af9d6d5..614b054fad 100644 --- a/tests/auto/testlib/selftests/expected_maxwarnings.xml +++ b/tests/auto/testlib/selftests/expected_maxwarnings.xml @@ -2,6 +2,7 @@ <TestCase name="MaxWarnings"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml b/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml index b1b0215cef..329fae5f1d 100644 --- a/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml +++ b/tests/auto/testlib/selftests/expected_maxwarnings.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="warn"> diff --git a/tests/auto/testlib/selftests/expected_singleskip.lightxml b/tests/auto/testlib/selftests/expected_singleskip.lightxml index 685396a243..ce09c0a9ad 100644 --- a/tests/auto/testlib/selftests/expected_singleskip.lightxml +++ b/tests/auto/testlib/selftests/expected_singleskip.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_singleskip.xml b/tests/auto/testlib/selftests/expected_singleskip.xml index c10626ca41..0c5cdade3d 100644 --- a/tests/auto/testlib/selftests/expected_singleskip.xml +++ b/tests/auto/testlib/selftests/expected_singleskip.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SingleSkip"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_singleskip.xunitxml b/tests/auto/testlib/selftests/expected_singleskip.xunitxml index 70968fa1c4..2b2da2f504 100644 --- a/tests/auto/testlib/selftests/expected_singleskip.xunitxml +++ b/tests/auto/testlib/selftests/expected_singleskip.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase name="myTest"> diff --git a/tests/auto/testlib/selftests/expected_skip.lightxml b/tests/auto/testlib/selftests/expected_skip.lightxml index 408bc44871..ee83d263b5 100644 --- a/tests/auto/testlib/selftests/expected_skip.lightxml +++ b/tests/auto/testlib/selftests/expected_skip.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skip.xml b/tests/auto/testlib/selftests/expected_skip.xml index b220722b6c..2c830bc9fb 100644 --- a/tests/auto/testlib/selftests/expected_skip.xml +++ b/tests/auto/testlib/selftests/expected_skip.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Skip"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skip.xunitxml b/tests/auto/testlib/selftests/expected_skip.xunitxml index 956d51f531..63e582f96a 100644 --- a/tests/auto/testlib/selftests/expected_skip.xunitxml +++ b/tests/auto/testlib/selftests/expected_skip.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase name="test"> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.lightxml b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml index 49c9d148f5..dbbc30c0db 100644 --- a/tests/auto/testlib/selftests/expected_skipcleanup.lightxml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.xml b/tests/auto/testlib/selftests/expected_skipcleanup.xml index 0bf1fe53a3..7b787ebb3d 100644 --- a/tests/auto/testlib/selftests/expected_skipcleanup.xml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SkipCleanup"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml b/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml index b8f67e2d07..9934584ec5 100644 --- a/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="aTestFunction"/> diff --git a/tests/auto/testlib/selftests/expected_skipinit.lightxml b/tests/auto/testlib/selftests/expected_skipinit.lightxml index e06c745205..3682068825 100644 --- a/tests/auto/testlib/selftests/expected_skipinit.lightxml +++ b/tests/auto/testlib/selftests/expected_skipinit.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinit.xml b/tests/auto/testlib/selftests/expected_skipinit.xml index 6a62b93614..9d6a38b82f 100644 --- a/tests/auto/testlib/selftests/expected_skipinit.xml +++ b/tests/auto/testlib/selftests/expected_skipinit.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SkipInit"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinit.xunitxml b/tests/auto/testlib/selftests/expected_skipinit.xunitxml index f62df71d96..bab08c375c 100644 --- a/tests/auto/testlib/selftests/expected_skipinit.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipinit.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase name="initTestCase"> <!-- message="Skip inside initTestCase. This should skip all tests in the class." type="skip" --> diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.lightxml b/tests/auto/testlib/selftests/expected_skipinitdata.lightxml index 41abd5dccd..26afcb4ab1 100644 --- a/tests/auto/testlib/selftests/expected_skipinitdata.lightxml +++ b/tests/auto/testlib/selftests/expected_skipinitdata.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.xml b/tests/auto/testlib/selftests/expected_skipinitdata.xml index 8efe12195e..9ab84f21a1 100644 --- a/tests/auto/testlib/selftests/expected_skipinitdata.xml +++ b/tests/auto/testlib/selftests/expected_skipinitdata.xml @@ -2,6 +2,7 @@ <TestCase name="tst_SkipInitData"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml b/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml index 699d50f7a7..e61d50b06b 100644 --- a/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipinitdata.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase name="initTestCase"> <!-- message="Skip inside initTestCase_data. This should skip all tests in the class." type="skip" --> diff --git a/tests/auto/testlib/selftests/expected_strcmp.lightxml b/tests/auto/testlib/selftests/expected_strcmp.lightxml index f0d266d400..298e910be8 100644 --- a/tests/auto/testlib/selftests/expected_strcmp.lightxml +++ b/tests/auto/testlib/selftests/expected_strcmp.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_strcmp.xml b/tests/auto/testlib/selftests/expected_strcmp.xml index 20ffee0611..29208f9a87 100644 --- a/tests/auto/testlib/selftests/expected_strcmp.xml +++ b/tests/auto/testlib/selftests/expected_strcmp.xml @@ -2,6 +2,7 @@ <TestCase name="tst_StrCmp"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_strcmp.xunitxml b/tests/auto/testlib/selftests/expected_strcmp.xunitxml index dde9ff5299..14bef9ec47 100644 --- a/tests/auto/testlib/selftests/expected_strcmp.xunitxml +++ b/tests/auto/testlib/selftests/expected_strcmp.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="compareCharStars"/> diff --git a/tests/auto/testlib/selftests/expected_subtest.lightxml b/tests/auto/testlib/selftests/expected_subtest.lightxml index 467fabb7ac..2e484aafef 100644 --- a/tests/auto/testlib/selftests/expected_subtest.lightxml +++ b/tests/auto/testlib/selftests/expected_subtest.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_subtest.xml b/tests/auto/testlib/selftests/expected_subtest.xml index 1107bcb070..f011489ec8 100644 --- a/tests/auto/testlib/selftests/expected_subtest.xml +++ b/tests/auto/testlib/selftests/expected_subtest.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Subtest"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_subtest.xunitxml b/tests/auto/testlib/selftests/expected_subtest.xunitxml index 753711f837..b49c006940 100644 --- a/tests/auto/testlib/selftests/expected_subtest.xunitxml +++ b/tests/auto/testlib/selftests/expected_subtest.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"> <!-- message="initTestCase initTestCase (null)" type="qdebug" --> diff --git a/tests/auto/testlib/selftests/expected_verbose1.lightxml b/tests/auto/testlib/selftests/expected_verbose1.lightxml index 45dca139fa..6d7ce13ea0 100644 --- a/tests/auto/testlib/selftests/expected_verbose1.lightxml +++ b/tests/auto/testlib/selftests/expected_verbose1.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose1.xml b/tests/auto/testlib/selftests/expected_verbose1.xml index 7a182183c1..b5ae1286cb 100644 --- a/tests/auto/testlib/selftests/expected_verbose1.xml +++ b/tests/auto/testlib/selftests/expected_verbose1.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Counting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose1.xunitxml b/tests/auto/testlib/selftests/expected_verbose1.xunitxml index 72bf047ba8..cb3a7815af 100644 --- a/tests/auto/testlib/selftests/expected_verbose1.xunitxml +++ b/tests/auto/testlib/selftests/expected_verbose1.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"/> diff --git a/tests/auto/testlib/selftests/expected_verbose2.lightxml b/tests/auto/testlib/selftests/expected_verbose2.lightxml index 0ead76884c..85f9ec45af 100644 --- a/tests/auto/testlib/selftests/expected_verbose2.lightxml +++ b/tests/auto/testlib/selftests/expected_verbose2.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose2.xml b/tests/auto/testlib/selftests/expected_verbose2.xml index 6d592f4a52..94fef3eed7 100644 --- a/tests/auto/testlib/selftests/expected_verbose2.xml +++ b/tests/auto/testlib/selftests/expected_verbose2.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Counting"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verbose2.xunitxml b/tests/auto/testlib/selftests/expected_verbose2.xunitxml index 6dabbd34fc..6764a5564f 100644 --- a/tests/auto/testlib/selftests/expected_verbose2.xunitxml +++ b/tests/auto/testlib/selftests/expected_verbose2.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"> diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml index fb8f61503e..d38363fb6e 100644 --- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml +++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml index a89528cfb8..8c57fe5c0f 100644 --- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml +++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml @@ -2,6 +2,7 @@ <TestCase name="tst_VerifyExceptionThrown"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml index f49746a9af..003a31a1cc 100644 --- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml +++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testCorrectStdTypes"/> diff --git a/tests/auto/testlib/selftests/expected_warnings.lightxml b/tests/auto/testlib/selftests/expected_warnings.lightxml index bbc96b7010..31b3d842aa 100644 --- a/tests/auto/testlib/selftests/expected_warnings.lightxml +++ b/tests/auto/testlib/selftests/expected_warnings.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_warnings.xml b/tests/auto/testlib/selftests/expected_warnings.xml index acb80e4f2a..a3821f84df 100644 --- a/tests/auto/testlib/selftests/expected_warnings.xml +++ b/tests/auto/testlib/selftests/expected_warnings.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Warnings"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_warnings.xunitxml b/tests/auto/testlib/selftests/expected_warnings.xunitxml index 7be47174c6..7ea66522c6 100644 --- a/tests/auto/testlib/selftests/expected_warnings.xunitxml +++ b/tests/auto/testlib/selftests/expected_warnings.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testWarnings"> diff --git a/tests/auto/testlib/selftests/expected_xunit.lightxml b/tests/auto/testlib/selftests/expected_xunit.lightxml index 6660cf4e7a..95ab8f03f0 100644 --- a/tests/auto/testlib/selftests/expected_xunit.lightxml +++ b/tests/auto/testlib/selftests/expected_xunit.lightxml @@ -1,5 +1,6 @@ <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_xunit.xml b/tests/auto/testlib/selftests/expected_xunit.xml index af9fe1f502..f56ca947be 100644 --- a/tests/auto/testlib/selftests/expected_xunit.xml +++ b/tests/auto/testlib/selftests/expected_xunit.xml @@ -2,6 +2,7 @@ <TestCase name="tst_Xunit"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QtBuild/> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> </Environment> <TestFunction name="initTestCase"> diff --git a/tests/auto/testlib/selftests/expected_xunit.xunitxml b/tests/auto/testlib/selftests/expected_xunit.xunitxml index 7d133da7a5..395b6efdd9 100644 --- a/tests/auto/testlib/selftests/expected_xunit.xunitxml +++ b/tests/auto/testlib/selftests/expected_xunit.xunitxml @@ -3,6 +3,7 @@ <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + <property value="" name="QtBuild"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testFunc1"> diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py index 1c09faf4db..8c1de0d8b4 100755 --- a/tests/auto/testlib/selftests/generate_expected_output.py +++ b/tests/auto/testlib/selftests/generate_expected_output.py @@ -56,8 +56,11 @@ isWindows = sys.platform == 'win32' replacements = [ (qtver, r'@INSERT_QT_VERSION_HERE@'), + (r'Config: Using QtTest library.*', r'Config: Using QtTest library'), # Build string in text logs (rootPath.encode('unicode-escape').decode('utf-8'), r''), (r'( *)<Duration msecs="[\d\.]+"/>', r'\1<Duration msecs="0"/>'), + (r'( *)<QtBuild>[^<]+</QtBuild>', r'\1<QtBuild/>'), # Build element in xml, lightxml + (r'<property value="[^"]+" name="QtBuild"/>', r'<property value="" name="QtBuild"/>') # Build in xunitxml ] extraArgs = { diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 8167a96eaa..e73bdc5223 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -169,12 +169,17 @@ QString tst_Selftests::logName(const QString &logger) const return (logger.startsWith("stdout") ? "" : QString(tempDir.path() + "/test_output." + logger)); } +static QString expectedFileNameFromTest(const QString &subdir, const QString &logger) +{ + return QStringLiteral("expected_") + subdir + QLatin1Char('.') + logFormat(logger); +} + // Load the expected test output for the nominated test (subdir) and logger // as an array of lines. If there is no expected output file, return an // empty array. -static QList<QByteArray> expectedResult(const QString &subdir, const QString &logger) +static QList<QByteArray> expectedResult(const QString &fileName) { - QFile file(":/expected_" + subdir + "." + logFormat(logger)); + QFile file(QStringLiteral(":/") + fileName); if (!file.open(QIODevice::ReadOnly)) return QList<QByteArray>(); return splitLines(file.readAll()); @@ -619,7 +624,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge for (int n = 0; n < loggers.count(); ++n) { QString logger = loggers[n]; QList<QByteArray> res = splitLines(actualOutputs[n]); - QList<QByteArray> exp = expectedResult(subdir, logger); + const QString expectedFileName = expectedFileNameFromTest(subdir, logger); + QList<QByteArray> exp = expectedResult(expectedFileName); #if defined (Q_CC_MSVC) || defined(Q_CC_MINGW) // MSVC, MinGW format double numbers differently if (n == 0 && subdir == QStringLiteral("float")) { @@ -638,7 +644,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge QList<QByteArray> tmp; int i = 1; do { - tmp = expectedResult(subdir + QString("_%1").arg(i++), logger); + tmp = expectedResult(expectedFileNameFromTest(subdir + QLatin1Char('_') + QString::number(i++), logger)); if (tmp.count()) expArr += tmp; } while (tmp.count()); @@ -667,8 +673,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge qDebug() << ">>>>>>"; QVERIFY2(res.count() == exp.count(), - qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3).") - .arg(res.count()).arg(exp.count()).arg(loggers.at(n)))); + qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3, %4).") + .arg(res.count()).arg(exp.count()).arg(loggers.at(n), expectedFileName))); } } @@ -711,6 +717,12 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge if (line.endsWith(" : failure location")) continue; + if (line.startsWith("Config: Using QtTest library") // Text build string + || line.startsWith(" <QtBuild") // XML, Light XML build string + || (line.startsWith(" <property value=") && line.endsWith("name=\"QtBuild\"/>"))) { // XUNIT-XML build string + continue; + } + const QString output(QString::fromLatin1(line)); const QString expected(QString::fromLatin1(exp.at(i)).replace("@INSERT_QT_VERSION_HERE@", QT_VERSION_STR)); @@ -740,8 +752,8 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge .arg(i).arg(loggers.at(n), output))); } else { QVERIFY2(output == expected, - qPrintable(QString::fromLatin1("Mismatch at line %1 (%2): '%3' != '%4'") - .arg(i).arg(loggers.at(n), output, expected))); + qPrintable(QString::fromLatin1("Mismatch at line %1 (%2, %3): '%4' != '%5'") + .arg(i + 1).arg(loggers.at(n), expectedFileName, output, expected))); } benchmark = line.startsWith("RESULT : "); diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 84466b92d1..f686b5854c 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -377,6 +377,8 @@ private slots: void itemClipsChildrenToShape5(); void itemClipsTextChildToShape(); void itemClippingDiscovery(); + void itemContainsChildrenInShape(); + void itemContainsChildrenInShape2(); void ancestorFlags(); void untransformable(); void contextMenuEventPropagation(); @@ -5845,6 +5847,102 @@ void tst_QGraphicsItem::itemClippingDiscovery() QCOMPARE(scene.itemAt(90, 90), (QGraphicsItem *)0); } +class ItemCountsBoundingRectCalls : public QGraphicsRectItem +{ +public: + ItemCountsBoundingRectCalls(const QRectF & rect, QGraphicsItem *parent = 0) + : QGraphicsRectItem(rect, parent), boundingRectCalls(0) {} + QRectF boundingRect () const { + ++boundingRectCalls; + return QGraphicsRectItem::boundingRect(); + } + mutable int boundingRectCalls; +}; + +void tst_QGraphicsItem::itemContainsChildrenInShape() +{ + ItemCountsBoundingRectCalls *parent = new ItemCountsBoundingRectCalls(QRectF(0,0, 10, 10)); + ItemCountsBoundingRectCalls *childOutsideShape = new ItemCountsBoundingRectCalls(QRectF(0,0, 10, 10), parent); + childOutsideShape->setPos(20,0); + + QGraphicsScene scene; + scene.setItemIndexMethod(QGraphicsScene::NoIndex); + scene.addItem(parent); + + QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls); + + int oldParentBoundingRectCalls = parent->boundingRectCalls; + int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; + + // First test that both items are searched if no optimization flags are set + QGraphicsItem* item = scene.itemAt(25,5); + + QVERIFY(item == childOutsideShape); + QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); + QVERIFY(childOutsideShape->boundingRectCalls > oldChildBoundingRectCalls); + QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls); + + oldParentBoundingRectCalls = parent->boundingRectCalls; + oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; + + // Repeat the test to make sure that no caching/indexing is in effect + item = scene.itemAt(25,5); + + QVERIFY(item == childOutsideShape); + QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); + QVERIFY(childOutsideShape->boundingRectCalls > oldChildBoundingRectCalls); + QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls); + + oldParentBoundingRectCalls = parent->boundingRectCalls; + oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; + + // Set the optimization flag and make sure that the child is not returned + // and that the child's boundingRect() method is never called. + parent->setFlag(QGraphicsItem::ItemContainsChildrenInShape); + item = scene.itemAt(25,5); + + QVERIFY(!(item)); + QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); + QVERIFY(childOutsideShape->boundingRectCalls == oldChildBoundingRectCalls); + QVERIFY(parent->boundingRectCalls > childOutsideShape->boundingRectCalls); +} + +void tst_QGraphicsItem::itemContainsChildrenInShape2() +{ + //The tested flag behaves almost identically to ItemClipsChildrenToShape + //in terms of optimizations but does not enforce the clip. + //This test makes sure there is no clip. + QGraphicsScene scene; + QGraphicsItem *rect = scene.addRect(0, 0, 50, 50, QPen(Qt::NoPen), QBrush(Qt::yellow)); + + QGraphicsItem *ellipse = scene.addEllipse(0, 0, 100, 100, QPen(Qt::NoPen), QBrush(Qt::green)); + ellipse->setParentItem(rect); + + QGraphicsItem *clippedEllipse = scene.addEllipse(0, 0, 50, 50, QPen(Qt::NoPen), QBrush(Qt::blue)); + clippedEllipse->setParentItem(ellipse); + + QGraphicsItem *clippedEllipse2 = scene.addEllipse(0, 0, 25, 25, QPen(Qt::NoPen), QBrush(Qt::red)); + clippedEllipse2->setParentItem(clippedEllipse); + + QVERIFY(!(ellipse->flags() & QGraphicsItem::ItemClipsChildrenToShape)); + QVERIFY(!(ellipse->flags() & QGraphicsItem::ItemContainsChildrenInShape)); + ellipse->setFlags(QGraphicsItem::ItemContainsChildrenInShape); + QVERIFY(!(ellipse->flags() & QGraphicsItem::ItemClipsChildrenToShape)); + QVERIFY((ellipse->flags() & QGraphicsItem::ItemContainsChildrenInShape)); + + QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); + image.fill(0); + QPainter painter(&image); + painter.setRenderHint(QPainter::Antialiasing); + scene.render(&painter); + painter.end(); + + QCOMPARE(image.pixel(2, 2), QColor(Qt::yellow).rgba()); + QCOMPARE(image.pixel(12, 12), QColor(Qt::red).rgba()); + QCOMPARE(image.pixel(2, 25), QColor(Qt::blue).rgba()); + QCOMPARE(image.pixel(2, 50), QColor(Qt::green).rgba()); +} + void tst_QGraphicsItem::ancestorFlags() { QGraphicsItem *level1 = new QGraphicsRectItem; @@ -5965,11 +6063,27 @@ void tst_QGraphicsItem::ancestorFlags() // Nobody handles child events level21->setHandlesChildEvents(false); - for (int i = 0; i < 2; ++i) { - QGraphicsItem::GraphicsItemFlag flag = !i ? QGraphicsItem::ItemClipsChildrenToShape - : QGraphicsItem::ItemIgnoresTransformations; - int ancestorFlag = !i ? QGraphicsItemPrivate::AncestorClipsChildren - : QGraphicsItemPrivate::AncestorIgnoresTransformations; + for (int i = 0; i < 3; ++i) { + QGraphicsItem::GraphicsItemFlag flag; + int ancestorFlag; + + switch (i) { + case(0): + flag = QGraphicsItem::ItemClipsChildrenToShape; + ancestorFlag = QGraphicsItemPrivate::AncestorClipsChildren; + break; + case(1): + flag = QGraphicsItem::ItemIgnoresTransformations; + ancestorFlag = QGraphicsItemPrivate::AncestorIgnoresTransformations; + break; + case(2): + flag = QGraphicsItem::ItemContainsChildrenInShape; + ancestorFlag = QGraphicsItemPrivate::AncestorContainsChildren; + break; + default: + qFatal("Unknown ancestor flag, please fix!"); + break; + } QCOMPARE(int(level1->d_ptr->ancestorFlags), 0); QCOMPARE(int(level21->d_ptr->ancestorFlags), 0); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index dfc8465210..a4752126bc 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -267,6 +267,7 @@ private slots: void removeFullyTransparentItem(); void zeroScale(); void focusItemChangedSignal(); + void minimumRenderSize(); // task specific tests below me void task139710_bspTreeCrash(); @@ -4678,6 +4679,78 @@ void tst_QGraphicsScene::focusItemChangedSignal() } +class ItemCountsPaintCalls : public QGraphicsRectItem +{ +public: + ItemCountsPaintCalls(const QRectF & rect, QGraphicsItem *parent = 0) + : QGraphicsRectItem(rect, parent), repaints(0) {} + void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) + { + QGraphicsRectItem::paint(painter, option, widget); + ++repaints; + } + int repaints; +}; + +void tst_QGraphicsScene::minimumRenderSize() +{ + Q_CHECK_PAINTEVENTS + + ItemCountsPaintCalls *bigParent = new ItemCountsPaintCalls(QRectF(0,0,100,100)); + ItemCountsPaintCalls *smallChild = new ItemCountsPaintCalls(QRectF(0,0,10,10), bigParent); + ItemCountsPaintCalls *smallerGrandChild = new ItemCountsPaintCalls(QRectF(0,0,1,1), smallChild); + QGraphicsScene scene; + scene.addItem(bigParent); + + CustomView view; + view.setScene(&scene); + view.show(); + QVERIFY(QTest::qWaitForWindowExposed(&view)); + qApp->processEvents(); + + // Initially, everything should be repainted the same number of times + int viewRepaints = 0; + QTRY_VERIFY(view.repaints > viewRepaints); + viewRepaints = view.repaints; + + QVERIFY(viewRepaints == bigParent->repaints); + QVERIFY(viewRepaints == smallChild->repaints); + QVERIFY(viewRepaints == smallerGrandChild->repaints); + + // Setting a minimum render size should cause a repaint + scene.setMinimumRenderSize(0.5); + qApp->processEvents(); + + QTRY_VERIFY(view.repaints > viewRepaints); + viewRepaints = view.repaints; + + QVERIFY(viewRepaints == bigParent->repaints); + QVERIFY(viewRepaints == smallChild->repaints); + QVERIFY(viewRepaints == smallerGrandChild->repaints); + + // Scaling should cause a repaint of big items only. + view.scale(0.1, 0.1); + qApp->processEvents(); + + QTRY_VERIFY(view.repaints > viewRepaints); + viewRepaints = view.repaints; + + QVERIFY(viewRepaints == bigParent->repaints); + QVERIFY(viewRepaints == smallChild->repaints); + QVERIFY(smallChild->repaints > smallerGrandChild->repaints); + + // Scaling further should cause even fewer items to be repainted + view.scale(0.1, 0.1); // Stacks with previous scale + qApp->processEvents(); + + QTRY_VERIFY(view.repaints > viewRepaints); + viewRepaints = view.repaints; + + QVERIFY(viewRepaints == bigParent->repaints); + QVERIFY(bigParent->repaints > smallChild->repaints); + QVERIFY(smallChild->repaints > smallerGrandChild->repaints); +} + void tst_QGraphicsScene::taskQTBUG_15977_renderWithDeviceCoordinateCache() { QGraphicsScene scene; diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index 21034e8f1b..350ae23d8a 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -393,18 +393,31 @@ void tst_QSpinBox::valueChangedHelper(int value) actualValues << value; } +class MySpinBox: public QSpinBox +{ +public: + MySpinBox(QWidget *parent = 0) : QSpinBox(parent) {} + + void changeEvent(QEvent *ev) { + eventsReceived.append(ev->type()); + } + QList<QEvent::Type> eventsReceived; +}; + void tst_QSpinBox::setReadOnly() { - QSpinBox spin(0); + MySpinBox spin(0); spin.show(); QTest::keyClick(&spin, Qt::Key_Up); QCOMPARE(spin.value(), 1); spin.setReadOnly(true); + QCOMPARE(spin.eventsReceived, QList<QEvent::Type>() << QEvent::ReadOnlyChange); QTest::keyClick(&spin, Qt::Key_Up); QCOMPARE(spin.value(), 1); spin.stepBy(1); QCOMPARE(spin.value(), 2); spin.setReadOnly(false); + QCOMPARE(spin.eventsReceived, QList<QEvent::Type>() << QEvent::ReadOnlyChange << QEvent::ReadOnlyChange); QTest::keyClick(&spin, Qt::Key_Up); QCOMPARE(spin.value(), 3); } |