From 08871501d8a7fe44a67116915bce3d2430c70e29 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 6 Jun 2015 15:47:45 +0200 Subject: 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 --- tests/benchmarks/objectcount/objectcount.pro | 3 --- tests/benchmarks/objectcount/objectcount.qrc | 5 ----- tests/benchmarks/objectcount/qt-logo.png | Bin 21710 -> 0 bytes tests/benchmarks/objectcount/tst_objectcount.cpp | 11 +++++++---- 4 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 tests/benchmarks/objectcount/objectcount.qrc delete mode 100644 tests/benchmarks/objectcount/qt-logo.png (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/objectcount/objectcount.pro b/tests/benchmarks/objectcount/objectcount.pro index 801fff58..f54d72d6 100644 --- a/tests/benchmarks/objectcount/objectcount.pro +++ b/tests/benchmarks/objectcount/objectcount.pro @@ -7,6 +7,3 @@ osx:CONFIG -= app_bundle SOURCES += \ tst_objectcount.cpp - -RESOURCES += \ - objectcount.qrc diff --git a/tests/benchmarks/objectcount/objectcount.qrc b/tests/benchmarks/objectcount/objectcount.qrc deleted file mode 100644 index 3c2c8a64..00000000 --- a/tests/benchmarks/objectcount/objectcount.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - qt-logo.png - - diff --git a/tests/benchmarks/objectcount/qt-logo.png b/tests/benchmarks/objectcount/qt-logo.png deleted file mode 100644 index cf350dad..00000000 Binary files a/tests/benchmarks/objectcount/qt-logo.png and /dev/null differ 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 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 object(component.create()); QVERIFY2(object.data(), qPrintable(component.errorString())); -- cgit v1.2.3