summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-05-24 00:41:28 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-05-24 00:42:34 (GMT)
commit4a66f34750b6e56610bb3c55c6c3ca25a8795a36 (patch)
tree3e04ece09578d172a1c413439732510d33b98abf /tests/benchmarks
parent81056aa843bbfd1d9ea78411b57c8c6b83e1fb3b (diff)
downloadQt-4a66f34750b6e56610bb3c55c6c3ca25a8795a36.zip
Qt-4a66f34750b6e56610bb3c55c6c3ca25a8795a36.tar.gz
Qt-4a66f34750b6e56610bb3c55c6c3ca25a8795a36.tar.bz2
Factor out initialization effects from declarative benchmarks.
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/declarative/compilation/tst_compilation.cpp6
-rw-r--r--tests/benchmarks/declarative/creation/tst_creation.cpp4
-rw-r--r--tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp6
-rw-r--r--tests/benchmarks/declarative/typeimports/tst_typeimports.cpp3
4 files changed, 19 insertions, 0 deletions
diff --git a/tests/benchmarks/declarative/compilation/tst_compilation.cpp b/tests/benchmarks/declarative/compilation/tst_compilation.cpp
index 0c6e917..2f4cd15 100644
--- a/tests/benchmarks/declarative/compilation/tst_compilation.cpp
+++ b/tests/benchmarks/declarative/compilation/tst_compilation.cpp
@@ -77,6 +77,12 @@ void tst_compilation::boomblock()
QVERIFY(f.open(QIODevice::ReadOnly));
QByteArray data = f.readAll();
+ //get rid of initialization effects
+ {
+ QDeclarativeComponent c(&engine);
+ c.setData(data, QUrl());
+ }
+
QBENCHMARK {
QDeclarativeComponent c(&engine);
c.setData(data, QUrl());
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp
index 1c3332e..83f66de 100644
--- a/tests/benchmarks/declarative/creation/tst_creation.cpp
+++ b/tests/benchmarks/declarative/creation/tst_creation.cpp
@@ -48,6 +48,7 @@
#include <QGraphicsItem>
#include <QDeclarativeItem>
#include <QDeclarativeContext>
+#include <private/qdeclarativetextinput_p.h>
#include <private/qobject_p.h>
#ifdef Q_OS_SYMBIAN
@@ -108,6 +109,9 @@ public:
tst_creation::tst_creation()
{
qmlRegisterType<TestType>("Qt.test", 1, 0, "TestType");
+
+ //get rid of initialization effects
+ QDeclarativeTextInput te;
}
inline QUrl TEST_FILE(const QString &filename)
diff --git a/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index 2d9744e..104746e 100644
--- a/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -80,6 +80,12 @@ void tst_qmlgraphicsimage::qmlgraphicsimage_file()
{
int x = 0;
QUrl url(SRCDIR "/image.png");
+ //get rid of initialization effects
+ {
+ QDeclarativeImage *image = new QDeclarativeImage;
+ QDeclarativeEngine::setContextForObject(image, engine.rootContext());
+ image->setSource(url);
+ }
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
diff --git a/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp b/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp
index f4c4c1f..4bab89f 100644
--- a/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp
+++ b/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp
@@ -126,6 +126,9 @@ void tst_typeimports::cpp()
void tst_typeimports::qml()
{
+ //get rid of initialization effects
+ { QDeclarativeComponent component(&engine, TEST_FILE("qml.qml")); }
+
QBENCHMARK {
QDeclarativeComponent component(&engine, TEST_FILE("qml.qml"));
QVERIFY(component.isReady());