aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-13 00:41:58 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-13 00:41:58 +0200
commitd54d28981c90d23d7fa0cfc5a9e3049e3e4df6b5 (patch)
tree0eb2f54f16b014f6eaa362095393d1bd058adb52 /tests
parent580f2872f09cf7ad83ec9ae5dca686683a3cac80 (diff)
parent6f15de1d2da9c83d7fca1d5c8243c0d69a1390ee (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4ssa_p.h tests/benchmarks/qml/qqmlimage/qqmlimage.pro tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp Change-Id: Iad11ce7fdf0c6d200fdebc16a94081bd8069a87a
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp29
-rw-r--r--tests/auto/qml/qqmlecmascript/data/DestructionHelper.qml3
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp102
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp42
-rw-r--r--tests/auto/qmltest/listview/tst_listview.qml4
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp1
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp31
-rw-r--r--tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp8
-rw-r--r--tests/auto/quick/qquickpathview/data/qtbug37815.qml77
-rw-r--r--tests/auto/quick/qquickpathview/data/qtbug53464.qml77
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp50
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp13
-rw-r--r--tests/benchmarks/qml/creation/creation.pro2
-rw-r--r--tests/benchmarks/qml/creation/tst_creation.cpp57
-rw-r--r--tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp147
-rw-r--r--tests/benchmarks/qml/qml.pro5
-rw-r--r--tests/benchmarks/qml/qqmlimage/image.pngbin611 -> 0 bytes
-rw-r--r--tests/benchmarks/qml/qqmlimage/qqmlimage.pro11
-rw-r--r--tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp95
19 files changed, 396 insertions, 358 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index e0cde6c86f..f49fd391ac 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -61,6 +61,7 @@ private slots:
void qtbug_22535();
void evalAfterInvalidate();
void qobjectDerived();
+ void qtbug_49232();
private:
QQmlEngine engine;
@@ -200,6 +201,8 @@ class TestObject : public QObject
Q_PROPERTY(int a READ a NOTIFY aChanged)
Q_PROPERTY(int b READ b NOTIFY bChanged)
Q_PROPERTY(int c READ c NOTIFY cChanged)
+ Q_PROPERTY(char d READ d NOTIFY dChanged)
+ Q_PROPERTY(uchar e READ e NOTIFY eChanged)
public:
TestObject() : _a(10), _b(10), _c(10) {}
@@ -213,15 +216,25 @@ public:
int c() const { return _c; }
void setC(int c) { _c = c; emit cChanged(); }
+ char d() const { return _d; }
+ void setD(char d) { _d = d; emit dChanged(); }
+
+ uchar e() const { return _e; }
+ void setE(uchar e) { _e = e; emit eChanged(); }
+
signals:
void aChanged();
void bChanged();
void cChanged();
+ void dChanged();
+ void eChanged();
private:
int _a;
int _b;
int _c;
+ char _d;
+ uchar _e;
};
#define TEST_CONTEXT_PROPERTY(ctxt, name, value) \
@@ -694,6 +707,22 @@ void tst_qqmlcontext::qobjectDerived()
QCOMPARE(command.count, 2);
}
+void tst_qqmlcontext::qtbug_49232()
+{
+ TestObject testObject;
+ testObject.setD('a');
+ testObject.setE(97);
+
+ QQmlEngine engine;
+ engine.rootContext()->setContextProperty("TestObject", &testObject);
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick 2.0; QtObject { property int valueOne: TestObject.d; property int valueTwo: TestObject.e }", QUrl());
+ QScopedPointer<QObject> obj(component.create());
+
+ QCOMPARE(obj->property("valueOne"), QVariant('a'));
+ QCOMPARE(obj->property("valueTwo"), QVariant(97));
+}
+
QTEST_MAIN(tst_qqmlcontext)
#include "tst_qqmlcontext.moc"
diff --git a/tests/auto/qml/qqmlecmascript/data/DestructionHelper.qml b/tests/auto/qml/qqmlecmascript/data/DestructionHelper.qml
new file mode 100644
index 0000000000..8bb0a3554e
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/DestructionHelper.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+WeakReferenceMutator {
+}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 2c9f08c82a..b6d2e303cb 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -44,6 +44,8 @@
#include <private/qv4scopedvalue_p.h>
#include <private/qv4alloca_p.h>
#include <private/qv4runtime_p.h>
+#include <private/qv4object_p.h>
+#include <private/qqmlcomponentattached_p.h>
#ifdef Q_CC_MSVC
#define NO_INLINE __declspec(noinline)
@@ -282,6 +284,7 @@ private slots:
void replaceBinding();
void deleteRootObjectInCreation();
void onDestruction();
+ void onDestructionViaGC();
void bindingSuppression();
void signalEmitted();
void threadSignal();
@@ -7150,6 +7153,105 @@ void tst_qqmlecmascript::onDestruction()
}
}
+class WeakReferenceMutator : public QObject
+{
+ Q_OBJECT
+public:
+ WeakReferenceMutator()
+ : resultPtr(Q_NULLPTR)
+ , weakRef(Q_NULLPTR)
+ {}
+
+ void init(QV4::ExecutionEngine *v4, QV4::WeakValue *weakRef, bool *resultPtr)
+ {
+ QV4::QObjectWrapper::wrap(v4, this);
+ QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership);
+
+ this->resultPtr = resultPtr;
+ this->weakRef = weakRef;
+
+ QObject::connect(QQmlComponent::qmlAttachedProperties(this), &QQmlComponentAttached::destruction, this, &WeakReferenceMutator::reviveFirstWeakReference);
+ }
+
+private slots:
+ void reviveFirstWeakReference() {
+ *resultPtr = weakRef->valueRef() && weakRef->isNullOrUndefined();
+ if (!*resultPtr)
+ return;
+ QV4::ExecutionEngine *v4 = QV8Engine::getV4(qmlEngine(this));
+ weakRef->set(v4, v4->newObject());
+ *resultPtr = weakRef->valueRef() && !weakRef->isNullOrUndefined();
+ }
+
+public:
+ bool *resultPtr;
+
+ QV4::WeakValue *weakRef;
+};
+
+QT_BEGIN_NAMESPACE
+
+namespace QV4 {
+
+namespace Heap {
+struct WeakReferenceSentinel : public Object {
+ WeakReferenceSentinel(WeakValue *weakRef, bool *resultPtr)
+ : weakRef(weakRef)
+ , resultPtr(resultPtr) {
+
+ }
+
+ ~WeakReferenceSentinel() {
+ *resultPtr = weakRef->isNullOrUndefined();
+ }
+
+ WeakValue *weakRef;
+ bool *resultPtr;
+};
+} // namespace Heap
+
+struct WeakReferenceSentinel : public Object {
+ V4_OBJECT2(WeakReferenceSentinel, Object)
+ V4_NEEDS_DESTROY
+};
+
+} // namespace QV4
+
+QT_END_NAMESPACE
+
+DEFINE_OBJECT_VTABLE(QV4::WeakReferenceSentinel);
+
+void tst_qqmlecmascript::onDestructionViaGC()
+{
+ qmlRegisterType<WeakReferenceMutator>("Test", 1, 0, "WeakReferenceMutator");
+
+ QQmlEngine engine;
+ QV4::ExecutionEngine *v4 = QV8Engine::getV4(&engine);
+
+ QQmlComponent component(&engine, testFileUrl("DestructionHelper.qml"));
+
+ QScopedPointer<QV4::WeakValue> weakRef;
+
+ bool mutatorResult = false;
+ bool sentinelResult = false;
+
+ {
+ weakRef.reset(new QV4::WeakValue);
+ weakRef->set(v4, v4->newObject());
+ QVERIFY(!weakRef->isNullOrUndefined());
+
+ QPointer<WeakReferenceMutator> weakReferenceMutator = qobject_cast<WeakReferenceMutator *>(component.create());
+ QVERIFY2(!weakReferenceMutator.isNull(), qPrintable(component.errorString()));
+ weakReferenceMutator->init(v4, weakRef.data(), &mutatorResult);
+
+ v4->memoryManager->allocObject<QV4::WeakReferenceSentinel>(weakRef.data(), &sentinelResult);
+ }
+ gc(engine);
+
+ QVERIFY2(mutatorResult, "We failed to re-assign the weak reference a new value during GC");
+ QVERIFY2(sentinelResult, "The weak reference was not cleared properly");
+}
+
struct EventProcessor : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index e140747881..1d01f69d9b 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -326,11 +326,8 @@ class PropertyObject : public QObject
Q_PROPERTY(MyQmlObject *qmlObject READ qmlObject)
Q_PROPERTY(MyQObject *qObject READ qObject WRITE setQObject NOTIFY qObjectChanged)
Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty)
- Q_PROPERTY(char charProperty READ charProperty WRITE setCharProperty)
Q_PROPERTY(QChar qcharProperty READ qcharProperty WRITE setQcharProperty)
Q_PROPERTY(QChar constQChar READ constQChar STORED false CONSTANT FINAL)
- Q_PROPERTY(char constChar READ constChar STORED false CONSTANT FINAL)
- Q_PROPERTY(int constInt READ constInt STORED false CONSTANT FINAL)
Q_CLASSINFO("DefaultProperty", "defaultProperty")
public:
@@ -367,15 +364,11 @@ public:
}
QString stringProperty() const { return m_stringProperty;}
- char charProperty() const { return m_charProperty; }
QChar qcharProperty() const { return m_qcharProperty; }
QChar constQChar() const { return 0x25cf; /* Unicode: black circle */ }
- char constChar() const { return 'A'; }
- int constInt() const { return 123456; }
void setStringProperty(QString arg) { m_stringProperty = arg; }
- void setCharProperty(char arg) { m_charProperty = arg; }
void setQcharProperty(QChar arg) { m_qcharProperty = arg; }
signals:
@@ -392,7 +385,6 @@ private:
MyQmlObject m_qmlObject;
MyQObject *m_qObject;
QString m_stringProperty;
- char m_charProperty;
QChar m_qcharProperty;
};
@@ -1405,23 +1397,14 @@ void tst_qqmlproperty::write()
// Char/string-property
{
PropertyObject o;
- QQmlProperty charProperty(&o, "charProperty");
QQmlProperty qcharProperty(&o, "qcharProperty");
QQmlProperty stringProperty(&o, "stringProperty");
const int black_circle = 0x25cf;
- QCOMPARE(charProperty.write(QString("foo")), false);
- QCOMPARE(charProperty.write('Q'), true);
- QCOMPARE(charProperty.read(), QVariant('Q'));
- QCOMPARE(charProperty.write(QString("t")), true);
- QCOMPARE(charProperty.read(), QVariant('t'));
-
QCOMPARE(qcharProperty.write(QString("foo")), false);
QCOMPARE(qcharProperty.write('Q'), true);
QCOMPARE(qcharProperty.read(), QVariant('Q'));
- QCOMPARE(qcharProperty.write(QString("t")), true);
- QCOMPARE(qcharProperty.read(), QVariant('t'));
QCOMPARE(qcharProperty.write(QChar(black_circle)), true);
QCOMPARE(qcharProperty.read(), QVariant(QChar(black_circle)));
@@ -1430,19 +1413,10 @@ void tst_qqmlproperty::write()
QCOMPARE(o.stringProperty(), QString("bar"));
QCOMPARE(stringProperty.write(QVariant(1234)), true);
QCOMPARE(stringProperty.read().toString(), QString::number(1234));
+ QCOMPARE(stringProperty.write('A'), true);
+ QCOMPARE(stringProperty.read().toString(), QString::number('A'));
QCOMPARE(stringProperty.write(QChar(black_circle)), true);
- QCOMPARE(stringProperty.read(), QVariant(QString(QChar(black_circle))));
-
- { // char -> QString
- QQmlComponent component(&engine);
- component.setData("import Test 1.0\nPropertyObject { stringProperty: constChar }", QUrl());
- PropertyObject *obj = qobject_cast<PropertyObject*>(component.create());
- QVERIFY(obj != 0);
- if (obj) {
- QQmlProperty stringProperty(obj, "stringProperty");
- QCOMPARE(stringProperty.read(), QVariant(QString(obj->constChar())));
- }
- }
+ QCOMPARE(stringProperty.read(), QVariant(QChar(black_circle)));
{ // QChar -> QString
QQmlComponent component(&engine);
@@ -1455,16 +1429,6 @@ void tst_qqmlproperty::write()
}
}
- { // int -> QString
- QQmlComponent component(&engine);
- component.setData("import Test 1.0\nPropertyObject { stringProperty: constInt }", QUrl());
- PropertyObject *obj = qobject_cast<PropertyObject*>(component.create());
- QVERIFY(obj != 0);
- if (obj) {
- QQmlProperty stringProperty(obj, "stringProperty");
- QCOMPARE(stringProperty.read(), QVariant(QString::number(obj->constInt())));
- }
- }
}
// VariantMap-property
diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml
index 98d7ea4cb7..65f736f305 100644
--- a/tests/auto/qmltest/listview/tst_listview.qml
+++ b/tests/auto/qmltest/listview/tst_listview.qml
@@ -320,9 +320,13 @@ Item {
function test_listInteractiveCurrentIndexEnforce() {
mousePress(listInteractiveCurrentIndexEnforce, 10, 50);
+ wait(1); // because Flickable pays attention to velocity, we need some time between movements
mouseMove(listInteractiveCurrentIndexEnforce, 10, 40);
+ wait(1);
mouseMove(listInteractiveCurrentIndexEnforce, 10, 30);
+ wait(1);
mouseMove(listInteractiveCurrentIndexEnforce, 10, 20);
+ wait(1);
mouseMove(listInteractiveCurrentIndexEnforce, 10, 10);
compare(listInteractiveCurrentIndexEnforce.interactive, false);
mouseRelease(listInteractiveCurrentIndexEnforce, 10, 10);
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 96fe97f372..4a0b8a8bdf 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -1461,6 +1461,7 @@ void tst_qquickflickable::flickWithTouch(QQuickWindow *window, QTouchDevice *tou
for (int i = 1; i <= 8; ++i) {
QTest::touchEvent(window, touchDevice).move(0, from + i*diff/8, window);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1); // because Flickable pays attention to velocity, we need some time between movements
}
QTest::touchEvent(window, touchDevice).release(0, to, window);
QQuickTouchUtils::flush(window);
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index aa1474df91..89d48c4f09 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -1047,17 +1047,17 @@ void tst_QQuickMouseArea::clickThrough()
QVERIFY(QTest::qWaitForWindowExposed(window.data()));
QVERIFY(window->rootObject() != 0);
+ // to avoid generating a double click.
+ const int doubleClickInterval = qApp->styleHints()->mouseDoubleClickInterval() + 10;
+
QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QTRY_COMPARE(window->rootObject()->property("presses").toInt(), 0);
QTRY_COMPARE(window->rootObject()->property("clicks").toInt(), 1);
- // to avoid generating a double click.
- int doubleClickInterval = qApp->styleHints()->mouseDoubleClickInterval() + 10;
- QTest::qWait(doubleClickInterval);
-
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QCOMPARE(window->rootObject()->property("doubleClicks").toInt(), 0);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::qWait(1000);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
@@ -1087,9 +1087,7 @@ void tst_QQuickMouseArea::clickThrough()
QCOMPARE(window->rootObject()->property("presses").toInt(), 0);
QCOMPARE(window->rootObject()->property("clicks").toInt(), 0);
- QTest::qWait(doubleClickInterval); // to avoid generating a double click.
-
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::qWait(1000);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QTest::qWait(100);
@@ -1108,15 +1106,13 @@ void tst_QQuickMouseArea::clickThrough()
window->rootObject()->setProperty("letThrough", QVariant(true));
- QTest::qWait(doubleClickInterval); // to avoid generating a double click.
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QCOMPARE(window->rootObject()->property("presses").toInt(), 0);
QTRY_COMPARE(window->rootObject()->property("clicks").toInt(), 1);
- QTest::qWait(doubleClickInterval); // to avoid generating a double click.
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::qWait(1000);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QTest::qWait(100);
@@ -1135,12 +1131,10 @@ void tst_QQuickMouseArea::clickThrough()
window->rootObject()->setProperty("noPropagation", QVariant(true));
- QTest::qWait(doubleClickInterval); // to avoid generating a double click.
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
- QTest::qWait(doubleClickInterval); // to avoid generating a double click.
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::qWait(1000);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QTest::qWait(100);
@@ -1161,7 +1155,7 @@ void tst_QQuickMouseArea::clickThrough()
QVERIFY(QTest::qWaitForWindowExposed(window.data()));
QVERIFY(window->rootObject() != 0);
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QCOMPARE(window->rootObject()->property("clicksEnabled").toInt(), 1);
@@ -1169,8 +1163,7 @@ void tst_QQuickMouseArea::clickThrough()
window->rootObject()->setProperty("disableLower", QVariant(true));
- QTest::qWait(doubleClickInterval); // to avoid generating a double click.
- QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(100,100), doubleClickInterval);
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(100,100));
QCOMPARE(window->rootObject()->property("clicksEnabled").toInt(), 2);
diff --git a/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp b/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp
index c3981c466f..1b32e6c4ab 100644
--- a/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp
+++ b/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp
@@ -596,18 +596,22 @@ void tst_QQuickMultiPointTouchArea::inFlickable()
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1); // because Flickable pays attention to velocity, we need some time between movements
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
@@ -783,18 +787,22 @@ void tst_QQuickMultiPointTouchArea::inFlickable2()
QCOMPARE(point11->pressed(), true);
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
p1 += QPoint(0,15);
+ QTest::qWait(1);
QTest::touchEvent(window.data(), device).move(0, p1);
QQuickTouchUtils::flush(window.data());
diff --git a/tests/auto/quick/qquickpathview/data/qtbug37815.qml b/tests/auto/quick/qquickpathview/data/qtbug37815.qml
new file mode 100644
index 0000000000..3fd4daca63
--- /dev/null
+++ b/tests/auto/quick/qquickpathview/data/qtbug37815.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Netris
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ width: 600
+ height: 400
+ PathView {
+ objectName: "pathView"
+ model: 10
+ anchors.fill: parent
+ pathItemCount: 5
+ cacheItemCount: 5
+ highlightRangeMode: PathView.StrictlyEnforceRange
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+
+ path: Path {
+ startX: 0
+ startY: 50
+ PathLine {
+ x: 600
+ y: 50
+ }
+ }
+
+ delegate: Component {
+ Text {
+ width: 50
+ height: 50
+ text: index
+ objectName: "delegate" + index
+ font.pixelSize: 24
+ color: PathView.isCurrentItem ? "green" : "black"
+ }
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquickpathview/data/qtbug53464.qml b/tests/auto/quick/qquickpathview/data/qtbug53464.qml
new file mode 100644
index 0000000000..d30d404e68
--- /dev/null
+++ b/tests/auto/quick/qquickpathview/data/qtbug53464.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Netris
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ width: 600
+ height: 400
+ PathView {
+ objectName: "pathView"
+ model: 10
+ anchors.fill: parent
+ pathItemCount: 5
+ highlightRangeMode: PathView.StrictlyEnforceRange
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ currentIndex: 8
+
+ path: Path {
+ startX: 0
+ startY: 50
+ PathLine {
+ x: 600
+ y: 50
+ }
+ }
+
+ delegate: Component {
+ Text {
+ width: 50
+ height: 50
+ text: index
+ objectName: "delegate" + index
+ font.pixelSize: 24
+ color: PathView.isCurrentItem ? "green" : "black"
+ }
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index 6761313210..d013d190ec 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -135,7 +135,9 @@ private slots:
void nestedinFlickable();
void flickableDelegate();
void jsArrayChange();
+ void qtbug37815();
void qtbug42716();
+ void qtbug53464();
void addCustomAttribute();
void movementDirection_data();
void movementDirection();
@@ -2330,6 +2332,31 @@ void tst_QQuickPathView::jsArrayChange()
QCOMPARE(spy.count(), 1);
}
+void tst_QQuickPathView::qtbug37815()
+{
+ QScopedPointer<QQuickView> window(createView());
+
+ window->setSource(testFileUrl("qtbug37815.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+
+ // cache items will be created async. Let's wait...
+ QTest::qWait(1000);
+
+ QQuickPathView *pathView = findItem<QQuickPathView>(window->rootObject(), "pathView");
+ QVERIFY(pathView != Q_NULLPTR);
+
+ const int pathItemCount = pathView->pathItemCount();
+ const int cacheItemCount = pathView->cacheItemCount();
+ int totalCount = 0;
+ foreach (QQuickItem *item, pathView->childItems()) {
+ if (item->objectName().startsWith(QLatin1String("delegate")))
+ ++totalCount;
+ }
+ QCOMPARE(pathItemCount + cacheItemCount, totalCount);
+}
+
/* This bug was one where if you jump the list such that the sole missing item needed to be
* added in the middle of the list, it would instead move an item somewhere else in the list
* to the middle (messing it up very badly).
@@ -2378,6 +2405,29 @@ void tst_QQuickPathView::qtbug42716()
QVERIFY(!itemMiss);
}
+void tst_QQuickPathView::qtbug53464()
+{
+ QScopedPointer<QQuickView> window(createView());
+
+ window->setSource(testFileUrl("qtbug53464.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+
+ QQuickPathView *pathView = findItem<QQuickPathView>(window->rootObject(), "pathView");
+ QVERIFY(pathView != Q_NULLPTR);
+ const int currentIndex = pathView->currentIndex();
+ QCOMPARE(currentIndex, 8);
+
+ const int pathItemCount = pathView->pathItemCount();
+ int totalCount = 0;
+ foreach (QQuickItem *item, pathView->childItems()) {
+ if (item->objectName().startsWith(QLatin1String("delegate")))
+ ++totalCount;
+ }
+ QCOMPARE(pathItemCount, totalCount);
+}
+
void tst_QQuickPathView::addCustomAttribute()
{
const QScopedPointer<QQuickView> window(createView());
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index 15d7ffd9d9..a2a23031e1 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -586,10 +586,13 @@ void tst_TouchMouse::buttonOnFlickable()
QPoint p2 = p1 + QPoint(0, -10);
QPoint p3 = p2 + QPoint(0, -10);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1); // because Flickable pays attention to velocity, we need some time between movements
QTest::touchEvent(window, device).move(0, p1, window);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p2, window);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p3, window);
QQuickTouchUtils::flush(window);
@@ -671,10 +674,13 @@ void tst_TouchMouse::buttonOnDelayedPressFlickable()
QPoint p2 = p1 + QPoint(0, -10);
QPoint p3 = p2 + QPoint(0, -10);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p1, window);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p2, window);
QQuickTouchUtils::flush(window);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p3, window);
QQuickTouchUtils::flush(window);
QVERIFY(flickable->isMovingVertically());
@@ -866,15 +872,19 @@ void tst_TouchMouse::pinchOnFlickable()
QQuickTouchUtils::flush(window);
QCOMPARE(rect->position(), QPointF(200.0, 200.0));
p -= QPoint(10, 0);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p, window);
QQuickTouchUtils::flush(window);
p -= QPoint(10, 0);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p, window);
QQuickTouchUtils::flush(window);
p -= QPoint(10, 0);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p, window);
QQuickTouchUtils::flush(window);
p -= QPoint(10, 0);
+ QTest::qWait(1);
QTest::touchEvent(window, device).move(0, p, window);
QQuickTouchUtils::flush(window);
QTest::touchEvent(window, device).release(0, p, window);
@@ -1087,13 +1097,16 @@ void tst_TouchMouse::mouseOnFlickableOnPinch()
QQuickTouchUtils::flush(window);
QCOMPARE(rect->position(), QPointF(200.0, 200.0));
p -= QPoint(10, 0);
+ QTest::qWait(1);
pinchSequence.move(0, p, window).commit();
QQuickTouchUtils::flush(window);
p -= QPoint(10, 0);
+ QTest::qWait(1);
pinchSequence.move(0, p, window).commit();
QQuickTouchUtils::flush(window);
QGuiApplication::processEvents();
p -= QPoint(10, 0);
+ QTest::qWait(1);
pinchSequence.move(0, p, window).commit();
QQuickTouchUtils::flush(window);
diff --git a/tests/benchmarks/qml/creation/creation.pro b/tests/benchmarks/qml/creation/creation.pro
index bb4d2841fe..42faf729a0 100644
--- a/tests/benchmarks/qml/creation/creation.pro
+++ b/tests/benchmarks/qml/creation/creation.pro
@@ -1,7 +1,7 @@
CONFIG += benchmark
TEMPLATE = app
TARGET = tst_creation
-QT += core-private gui-private qml-private quick-private widgets testlib
+QT += core-private gui-private qml-private quick-private testlib
macx:CONFIG -= app_bundle
SOURCES += tst_creation.cpp
diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp
index b47bc14a3e..e5ad04b92f 100644
--- a/tests/benchmarks/qml/creation/tst_creation.cpp
+++ b/tests/benchmarks/qml/creation/tst_creation.cpp
@@ -31,8 +31,6 @@
#include <QQmlComponent>
#include <private/qqmlmetatype_p.h>
#include <QDebug>
-#include <QGraphicsScene>
-#include <QGraphicsItem>
#include <QQuickItem>
#include <QQmlContext>
#include <private/qobject_p.h>
@@ -47,7 +45,6 @@ private slots:
void qobject_cpp();
void qobject_qml();
void qobject_qmltype();
- void qobject_alloc();
void qobject_10flat_qml();
void qobject_10flat_cpp();
@@ -62,9 +59,6 @@ private slots:
void itemtree_qml();
void itemtree_scene_cpp();
- void elements_data();
- void elements();
-
void itemtests_qml_data();
void itemtests_qml();
@@ -204,35 +198,6 @@ void tst_creation::qobject_qmltype()
}
}
-struct QObjectFakeData {
- char data[sizeof(QObjectPrivate)];
-};
-
-struct QObjectFake {
- QObjectFake();
- virtual ~QObjectFake();
-private:
- QObjectFakeData *d;
-};
-
-QObjectFake::QObjectFake()
-{
- d = new QObjectFakeData;
-}
-
-QObjectFake::~QObjectFake()
-{
- delete d;
-}
-
-void tst_creation::qobject_alloc()
-{
- QBENCHMARK {
- QObjectFake *obj = new QObjectFake;
- delete obj;
- }
-}
-
struct QQmlGraphics_Derived : public QObject
{
void setParent_noEvent(QObject *parent) {
@@ -327,28 +292,6 @@ void tst_creation::itemtree_scene_cpp()
delete root;
}
-void tst_creation::elements_data()
-{
- QTest::addColumn<QString>("type");
-
- QList<QString> types = QQmlMetaType::qmlTypeNames();
- foreach (QString type, types)
- QTest::newRow(type.toLatin1()) << type;
-}
-
-void tst_creation::elements()
-{
- QFETCH(QString, type);
- QQmlType *t = QQmlMetaType::qmlType(type, 2, 0);
- if (!t || !t->isCreatable())
- QSKIP("Non-creatable type");
-
- QBENCHMARK {
- QObject *obj = t->create();
- delete obj;
- }
-}
-
void tst_creation::itemtests_qml_data()
{
QTest::addColumn<QString>("filepath");
diff --git a/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp b/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp
index 5513dcb9a7..d7c54703ad 100644
--- a/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp
+++ b/tests/benchmarks/qml/librarymetrics_performance/tst_librarymetrics_performance.cpp
@@ -36,9 +36,6 @@
// for the standard set of elements, properties and expressions which
// are provided in the QtDeclarative library (QtQml and QtQuick).
-#define AVERAGE_OVER_N 10
-#define IGNORE_N_OUTLIERS 2
-
class ModuleApi : public QObject
{
Q_OBJECT
@@ -214,123 +211,37 @@ void tst_librarymetrics_performance::compilation()
}
}
- QList<qint64> nResults;
-
- // generate AVERAGE_OVER_N results
- for (int i = 0; i < AVERAGE_OVER_N; ++i) {
+ QBENCHMARK {
cleanState(&e);
- {
- QElapsedTimer et;
- et.start();
- QQmlComponent c(e, this);
- c.loadUrl(qmlfile); // just compile.
- qint64 etime = et.nsecsElapsed();
- nResults.append(etime);
- }
- }
-
- // sort the list
- qSort(nResults);
-
- // remove IGNORE_N_OUTLIERS*2 from ONLY the worst end (remove gc interference)
- for (int i = 0; i < IGNORE_N_OUTLIERS; ++i) {
- if (!nResults.isEmpty()) nResults.removeLast();
- if (!nResults.isEmpty()) nResults.removeLast();
+ QQmlComponent c(e, this);
+ c.loadUrl(qmlfile); // just compile.
}
-
- // now generate an average
- qint64 totaltime = 0;
- if (nResults.size() == 0) nResults.append(9999);
- for (int i = 0; i < nResults.size(); ++i)
- totaltime += nResults.at(i);
- double average = ((double)totaltime) / nResults.count();
-
- // and return it as the result
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds);
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds); // twice to workaround bug in QTestLib
}
void tst_librarymetrics_performance::instantiation_cached()
{
QFETCH(QUrl, qmlfile);
-
cleanState(&e);
- QList<qint64> nResults;
- // generate AVERAGE_OVER_N results
- for (int i = 0; i < AVERAGE_OVER_N; ++i) {
- QElapsedTimer et;
- et.start();
+ QBENCHMARK {
QQmlComponent c(e, this);
c.loadUrl(qmlfile); // just compile.
QObject *o = c.create();
- qint64 etime = et.nsecsElapsed();
- nResults.append(etime);
delete o;
}
-
- // sort the list
- qSort(nResults);
-
- // remove IGNORE_N_OUTLIERS*2 from ONLY the worst end (remove gc interference)
- for (int i = 0; i < IGNORE_N_OUTLIERS; ++i) {
- if (!nResults.isEmpty()) nResults.removeLast();
- if (!nResults.isEmpty()) nResults.removeLast();
- }
-
- // now generate an average
- qint64 totaltime = 0;
- if (nResults.size() == 0) nResults.append(9999);
- for (int i = 0; i < nResults.size(); ++i)
- totaltime += nResults.at(i);
- double average = ((double)totaltime) / nResults.count();
-
- // and return it as the result
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds);
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds); // twice to workaround bug in QTestLib
}
void tst_librarymetrics_performance::instantiation()
{
QFETCH(QUrl, qmlfile);
- cleanState(&e);
- QList<qint64> nResults;
-
- // generate AVERAGE_OVER_N results
- for (int i = 0; i < AVERAGE_OVER_N; ++i) {
+ QBENCHMARK {
cleanState(&e);
- {
- QElapsedTimer et;
- et.start();
- QQmlComponent c(e, this);
- c.loadUrl(qmlfile); // just compile.
- QObject *o = c.create();
- qint64 etime = et.nsecsElapsed();
- nResults.append(etime);
- delete o;
- }
- }
-
- // sort the list
- qSort(nResults);
-
- // remove IGNORE_N_OUTLIERS*2 from ONLY the worst end (remove gc interference)
- for (int i = 0; i < IGNORE_N_OUTLIERS; ++i) {
- if (!nResults.isEmpty()) nResults.removeLast();
- if (!nResults.isEmpty()) nResults.removeLast();
+ QQmlComponent c(e, this);
+ c.loadUrl(qmlfile); // just compile.
+ QObject *o = c.create();
+ delete o;
}
-
- // now generate an average
- qint64 totaltime = 0;
- if (nResults.size() == 0) nResults.append(9999);
- for (int i = 0; i < nResults.size(); ++i)
- totaltime += nResults.at(i);
- double average = ((double)totaltime) / nResults.count();
-
- // and return it as the result
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds);
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds); // twice to workaround bug in QTestLib
}
void tst_librarymetrics_performance::positioners_data()
@@ -351,43 +262,13 @@ void tst_librarymetrics_performance::positioners()
{
QFETCH(QUrl, qmlfile);
- cleanState(&e);
- QList<qint64> nResults;
-
- // generate AVERAGE_OVER_N results
- for (int i = 0; i < AVERAGE_OVER_N; ++i) {
+ QBENCHMARK {
cleanState(&e);
- {
- QElapsedTimer et;
- et.start();
- QQmlComponent c(e, this);
- c.loadUrl(qmlfile); // just compile.
- QObject *o = c.create();
- qint64 etime = et.nsecsElapsed();
- nResults.append(etime);
- delete o;
- }
- }
-
- // sort the list
- qSort(nResults);
-
- // remove IGNORE_N_OUTLIERS*2 from ONLY the worst end (remove gc interference)
- for (int i = 0; i < IGNORE_N_OUTLIERS; ++i) {
- if (!nResults.isEmpty()) nResults.removeLast();
- if (!nResults.isEmpty()) nResults.removeLast();
+ QQmlComponent c(e, this);
+ c.loadUrl(qmlfile); // just compile.
+ QObject *o = c.create();
+ delete o;
}
-
- // now generate an average
- qint64 totaltime = 0;
- if (nResults.size() == 0) nResults.append(9999);
- for (int i = 0; i < nResults.size(); ++i)
- totaltime += nResults.at(i);
- double average = ((double)totaltime) / nResults.count();
-
- // and return it as the result
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds);
- QTest::setBenchmarkResult(average, QTest::WalltimeNanoseconds); // twice to workaround bug in QTestLib
}
QTEST_MAIN(tst_librarymetrics_performance)
diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro
index 5d48ec0067..2cf2dff413 100644
--- a/tests/benchmarks/qml/qml.pro
+++ b/tests/benchmarks/qml/qml.pro
@@ -7,13 +7,12 @@ SUBDIRS += \
holistic \
qqmlchangeset \
qqmlcomponent \
- qqmlimage \
qqmlmetaproperty \
librarymetrics_performance \
# script \ ### FIXME: doesn't build
- js
+ js \
+ creation
qtHaveModule(opengl): SUBDIRS += painting qquickwindow
-qtHaveModule(widgets): SUBDIRS += creation
include(../trusted-benchmarks.pri)
diff --git a/tests/benchmarks/qml/qqmlimage/image.png b/tests/benchmarks/qml/qqmlimage/image.png
deleted file mode 100644
index 623d36233d..0000000000
--- a/tests/benchmarks/qml/qqmlimage/image.png
+++ /dev/null
Binary files differ
diff --git a/tests/benchmarks/qml/qqmlimage/qqmlimage.pro b/tests/benchmarks/qml/qqmlimage/qqmlimage.pro
deleted file mode 100644
index 421f232a4f..0000000000
--- a/tests/benchmarks/qml/qqmlimage/qqmlimage.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-CONFIG += benchmark
-TEMPLATE = app
-TARGET = tst_qqmlimage
-QT += qml quick-private testlib
-macx:CONFIG -= app_bundle
-CONFIG += release
-
-SOURCES += tst_qqmlimage.cpp
-
-DEFINES += SRCDIR=\\\"$$PWD\\\"
-
diff --git a/tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp b/tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp
deleted file mode 100644
index 38fca802c5..0000000000
--- a/tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qtest.h>
-#include <QQmlEngine>
-#include <QQmlComponent>
-#include <private/qquickimage_p.h>
-
-class tst_qmlgraphicsimage : public QObject
-{
- Q_OBJECT
-public:
- tst_qmlgraphicsimage() {}
-
-private slots:
- void qmlgraphicsimage();
- void qmlgraphicsimage_file();
- void qmlgraphicsimage_url();
-
-private:
- QQmlEngine engine;
-};
-
-void tst_qmlgraphicsimage::qmlgraphicsimage()
-{
- int x = 0;
- QUrl url(SRCDIR "/image.png");
- QBENCHMARK {
- QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
- QQuickImage *image = new QQuickImage;
- QQmlEngine::setContextForObject(image, engine.rootContext());
- delete image;
- }
-}
-
-void tst_qmlgraphicsimage::qmlgraphicsimage_file()
-{
- int x = 0;
- QUrl url(SRCDIR "/image.png");
- //get rid of initialization effects
- {
- QQuickImage *image = new QQuickImage;
- QQmlEngine::setContextForObject(image, engine.rootContext());
- image->setSource(url);
- }
- QBENCHMARK {
- QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
- QQuickImage *image = new QQuickImage;
- QQmlEngine::setContextForObject(image, engine.rootContext());
- image->setSource(url);
- delete image;
- }
-}
-
-void tst_qmlgraphicsimage::qmlgraphicsimage_url()
-{
- int x = 0;
- QUrl url(SRCDIR "/image.png");
- QBENCHMARK {
- QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
- QQuickImage *image = new QQuickImage;
- QQmlEngine::setContextForObject(image, engine.rootContext());
- image->setSource(url2);
- delete image;
- }
-}
-
-QTEST_MAIN(tst_qmlgraphicsimage)
-
-#include "tst_qqmlimage.moc"