summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-05-13 00:08:48 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-05-13 00:08:48 (GMT)
commit386b658ce39bfab16ea14b232c61ad4703f11619 (patch)
treed68d6fbf210464dfd7ce78e22c0fabc9e1537a40
parent7894bbb901a2ba74284bd6c0544b06c6a41f6b6f (diff)
downloadQt-386b658ce39bfab16ea14b232c61ad4703f11619.zip
Qt-386b658ce39bfab16ea14b232c61ad4703f11619.tar.gz
Qt-386b658ce39bfab16ea14b232c61ad4703f11619.tar.bz2
Fix broken benchmarks.
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp11
-rw-r--r--tests/benchmarks/declarative/creation/tst_creation.cpp4
-rw-r--r--tests/benchmarks/declarative/painting/painting.pro1
-rw-r--r--tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp6
-rw-r--r--tests/benchmarks/declarative/script/data/slot_complex_js.js8
-rw-r--r--tests/benchmarks/declarative/script/data/slot_complex_js.qml14
-rw-r--r--tests/benchmarks/declarative/script/data/slot_simple_js.js3
-rw-r--r--tests/benchmarks/declarative/script/data/slot_simple_js.qml10
8 files changed, 27 insertions, 30 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 9f5cafe..94e6771 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -327,11 +327,12 @@ Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer);
void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o)
{
QObjectPrivate *p = QObjectPrivate::get(o);
- Q_ASSERT(p->declarativeData);
- QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
- if (d->ownContext && d->context) {
- d->context->destroy();
- d->context = 0;
+ if (p->declarativeData) {
+ QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
+ if (d->ownContext && d->context) {
+ d->context->destroy();
+ d->context = 0;
+ }
}
}
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp
index 6f00473..99324f4 100644
--- a/tests/benchmarks/declarative/creation/tst_creation.cpp
+++ b/tests/benchmarks/declarative/creation/tst_creation.cpp
@@ -203,7 +203,7 @@ void tst_creation::qobject_10tree_cpp()
void tst_creation::qobject_qmltype()
{
- QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/QtObject", 4, 6);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/QtObject", 4, 7);
QBENCHMARK {
QObject *obj = t->create();
@@ -347,7 +347,7 @@ void tst_creation::elements_data()
void tst_creation::elements()
{
QFETCH(QByteArray, type);
- QDeclarativeType *t = QDeclarativeMetaType::qmlType(type, 4, 6);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(type, 4, 7);
if (!t || !t->isCreatable())
QSKIP("Non-creatable type", SkipSingle);
diff --git a/tests/benchmarks/declarative/painting/painting.pro b/tests/benchmarks/declarative/painting/painting.pro
index 2f98e8b..a228ea7 100644
--- a/tests/benchmarks/declarative/painting/painting.pro
+++ b/tests/benchmarks/declarative/painting/painting.pro
@@ -11,3 +11,4 @@ INCLUDEPATH += .
SOURCES += paintbenchmark.cpp
QT += opengl
CONFIG += console
+macx:CONFIG -= app_bundle
diff --git a/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index 4bba022..e2e8c8a 100644
--- a/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -68,7 +68,7 @@ private:
void tst_qmlgraphicsimage::qmlgraphicsimage()
{
int x = 0;
- QUrl url("image.png");
+ QUrl url(SRCDIR "/image.png");
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
@@ -80,7 +80,7 @@ void tst_qmlgraphicsimage::qmlgraphicsimage()
void tst_qmlgraphicsimage::qmlgraphicsimage_file()
{
int x = 0;
- QUrl url("image.png");
+ QUrl url(SRCDIR "/image.png");
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
@@ -93,7 +93,7 @@ void tst_qmlgraphicsimage::qmlgraphicsimage_file()
void tst_qmlgraphicsimage::qmlgraphicsimage_url()
{
int x = 0;
- QUrl url("image.png");
+ QUrl url(SRCDIR "/image.png");
QBENCHMARK {
QUrl url2("http://localhost/image" + QString::number(x++) + ".png");
QDeclarativeImage *image = new QDeclarativeImage;
diff --git a/tests/benchmarks/declarative/script/data/slot_complex_js.js b/tests/benchmarks/declarative/script/data/slot_complex_js.js
new file mode 100644
index 0000000..64a1f65
--- /dev/null
+++ b/tests/benchmarks/declarative/script/data/slot_complex_js.js
@@ -0,0 +1,8 @@
+function myCustomFunction(n) {
+ var a = 1;
+ while (n > 0) {
+ a = a * n;
+ n--;
+ }
+ return a;
+}
diff --git a/tests/benchmarks/declarative/script/data/slot_complex_js.qml b/tests/benchmarks/declarative/script/data/slot_complex_js.qml
index ed4f78b..7bda48b 100644
--- a/tests/benchmarks/declarative/script/data/slot_complex_js.qml
+++ b/tests/benchmarks/declarative/script/data/slot_complex_js.qml
@@ -1,18 +1,8 @@
import Qt.test 1.0
+import "slot_complex_js.js" as Logic
TestObject {
- Script {
- function myCustomFunction(n) {
- var a = 1;
- while (n > 0) {
- a = a * n;
- n--;
- }
- return a;
- }
- }
-
- onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(10); } }
+ onMySignal: { for (var ii = 0; ii < 10000; ++ii) { Logic.myCustomFunction(10); } }
}
diff --git a/tests/benchmarks/declarative/script/data/slot_simple_js.js b/tests/benchmarks/declarative/script/data/slot_simple_js.js
new file mode 100644
index 0000000..d6e6060
--- /dev/null
+++ b/tests/benchmarks/declarative/script/data/slot_simple_js.js
@@ -0,0 +1,3 @@
+function myCustomFunction() {
+ return 0;
+}
diff --git a/tests/benchmarks/declarative/script/data/slot_simple_js.qml b/tests/benchmarks/declarative/script/data/slot_simple_js.qml
index a88265c..7ea3177 100644
--- a/tests/benchmarks/declarative/script/data/slot_simple_js.qml
+++ b/tests/benchmarks/declarative/script/data/slot_simple_js.qml
@@ -1,13 +1,7 @@
import Qt.test 1.0
+import "slot_simple_js.js" as Logic
TestObject {
-
- Script {
- function myCustomFunction() {
- return 0;
- }
- }
-
- onMySignal: { for (var ii = 0; ii < 10000; ++ii) { myCustomFunction(); } }
+ onMySignal: { for (var ii = 0; ii < 10000; ++ii) { Logic.myCustomFunction(); } }
}