aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/objectcount/tst_objectcount.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-06 15:47:45 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-06 13:57:39 +0000
commit08871501d8a7fe44a67116915bce3d2430c70e29 (patch)
tree42c6115a044cb303b08d0c95c7f09b100d1f8b97 /tests/benchmarks/objectcount/tst_objectcount.cpp
parentb141f798d57310c60c59597aa9232f6884309d0a (diff)
tst_objectcount: warmup with Buttons & exclude the test QQmlComponent
This ensures that singletons are excluded from the numbers. Change-Id: I14422b7b15d57273dd11717892ebd11eba650902 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'tests/benchmarks/objectcount/tst_objectcount.cpp')
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index 8caea23d..2e0f8412 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -74,7 +74,7 @@ void tst_ObjectCount::init()
// warmup
QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0; import QtQuick.Controls 1.3; import QtQuick.Controls 2.0; Image { Accessible.role: Accessible.Button; source: 'qrc:/qt-logo.png' }", QUrl());
+ component.setData("import QtQuick 2.0; import QtQuick.Controls 1.3 as C1; import QtQuick.Controls 2.0 as C2; Row { C1.Button {} C2.Button {} }", QUrl());
delete component.create();
}
@@ -98,10 +98,11 @@ void tst_ObjectCount::testCount()
QFETCH(QByteArray, v1);
QFETCH(QByteArray, v2);
- qt_qobjects->clear();
-
if (!v1.isEmpty()) {
QQmlComponent component(&engine);
+
+ qt_qobjects->clear();
+
component.setData(v1, QUrl());
QScopedPointer<QObject> object(component.create());
QVERIFY2(object.data(), qPrintable(component.errorString()));
@@ -115,10 +116,12 @@ void tst_ObjectCount::testCount()
printItems("V1", items);
}
- qt_qobjects->clear();
if (!v2.isEmpty()) {
QQmlComponent component(&engine);
+
+ qt_qobjects->clear();
+
component.setData(v2, QUrl());
QScopedPointer<QObject> object(component.create());
QVERIFY2(object.data(), qPrintable(component.errorString()));