summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-03-04 00:43:33 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-03-04 00:44:09 (GMT)
commit26d28b39504d1c55690985deb52646114b6cf710 (patch)
tree706dfe44d5eba1cd3b799088cb3a5b88e5b41ce2 /tests/benchmarks/declarative
parent68bc94ee824d8ceaaa272b7176f3810337addee7 (diff)
downloadQt-26d28b39504d1c55690985deb52646114b6cf710.zip
Qt-26d28b39504d1c55690985deb52646114b6cf710.tar.gz
Qt-26d28b39504d1c55690985deb52646114b6cf710.tar.bz2
Fix benchmarks.
Get them all running again after renames, etc.
Diffstat (limited to 'tests/benchmarks/declarative')
-rw-r--r--tests/benchmarks/declarative/binding/binding.pro3
-rw-r--r--tests/benchmarks/declarative/binding/data/idproperty.txt2
-rw-r--r--tests/benchmarks/declarative/binding/data/objectproperty.txt2
-rw-r--r--tests/benchmarks/declarative/binding/testtypes.h6
-rw-r--r--tests/benchmarks/declarative/binding/tst_binding.cpp16
-rw-r--r--tests/benchmarks/declarative/creation/tst_creation.cpp5
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml6
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro3
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h6
-rw-r--r--tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp14
-rw-r--r--tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro2
-rw-r--r--tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp8
-rw-r--r--tests/benchmarks/declarative/script/tst_script.cpp11
13 files changed, 47 insertions, 37 deletions
diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro
index aa4cc41..5ceaf34 100644
--- a/tests/benchmarks/declarative/binding/binding.pro
+++ b/tests/benchmarks/declarative/binding/binding.pro
@@ -7,6 +7,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_binding.cpp testtypes.cpp
HEADERS += testtypes.h
+# Define SRCDIR equal to test's source directory
+DEFINES += SRCDIR=\\\"$$PWD\\\"
+
symbian* {
data.sources = data/*
data.path = data
diff --git a/tests/benchmarks/declarative/binding/data/idproperty.txt b/tests/benchmarks/declarative/binding/data/idproperty.txt
index 71e3c4e..4e474ba 100644
--- a/tests/benchmarks/declarative/binding/data/idproperty.txt
+++ b/tests/benchmarks/declarative/binding/data/idproperty.txt
@@ -1,7 +1,7 @@
import Test 1.0
MyQmlObject {
- id: MyObject
+ id: myObject
MyQmlObject {
result: ###
diff --git a/tests/benchmarks/declarative/binding/data/objectproperty.txt b/tests/benchmarks/declarative/binding/data/objectproperty.txt
index 63fa74d..6133dd6 100644
--- a/tests/benchmarks/declarative/binding/data/objectproperty.txt
+++ b/tests/benchmarks/declarative/binding/data/objectproperty.txt
@@ -1,7 +1,7 @@
import Test 1.0
MyQmlObject {
- id: MyObject
+ id: myObject
result: ###
}
diff --git a/tests/benchmarks/declarative/binding/testtypes.h b/tests/benchmarks/declarative/binding/testtypes.h
index 4b103ce..523f94d 100644
--- a/tests/benchmarks/declarative/binding/testtypes.h
+++ b/tests/benchmarks/declarative/binding/testtypes.h
@@ -50,7 +50,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(int result READ result WRITE setResult);
Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged);
Q_PROPERTY(MyQmlObject *object READ object WRITE setObject NOTIFY objectChanged);
- Q_PROPERTY(QDeclarativeList<QObject *> *data READ data);
+ Q_PROPERTY(QDeclarativeListProperty<QObject> data READ data);
Q_CLASSINFO("DefaultProperty", "data");
public:
MyQmlObject() : m_result(0), m_value(0), m_object(0) {}
@@ -61,7 +61,7 @@ public:
int value() const { return m_value; }
void setValue(int v) { m_value = v; emit valueChanged(); }
- QDeclarativeList<QObject *> *data() { return &m_data; }
+ QDeclarativeListProperty<QObject> data() { return QDeclarativeListProperty<QObject>(this, m_data); }
MyQmlObject *object() const { return m_object; }
void setObject(MyQmlObject *o) { m_object = o; emit objectChanged(); }
@@ -71,7 +71,7 @@ signals:
void objectChanged();
private:
- QDeclarativeConcreteList<QObject *> m_data;
+ QList<QObject *> m_data;
int m_result;
int m_value;
MyQmlObject *m_object;
diff --git a/tests/benchmarks/declarative/binding/tst_binding.cpp b/tests/benchmarks/declarative/binding/tst_binding.cpp
index ee529a7..dbddac3 100644
--- a/tests/benchmarks/declarative/binding/tst_binding.cpp
+++ b/tests/benchmarks/declarative/binding/tst_binding.cpp
@@ -103,8 +103,8 @@ void tst_binding::objectproperty_data()
QTest::addColumn<QString>("file");
QTest::addColumn<QString>("binding");
- QTest::newRow("object.value") << "data/objectproperty.txt" << "object.value";
- QTest::newRow("object.value + 10") << "data/objectproperty.txt" << "object.value + 10";
+ QTest::newRow("object.value") << SRCDIR "/data/objectproperty.txt" << "object.value";
+ QTest::newRow("object.value + 10") << SRCDIR "/data/objectproperty.txt" << "object.value + 10";
}
void tst_binding::objectproperty()
@@ -132,13 +132,13 @@ void tst_binding::basicproperty_data()
QTest::addColumn<QString>("file");
QTest::addColumn<QString>("binding");
- QTest::newRow("value") << "data/localproperty.txt" << "value";
- QTest::newRow("value + 10") << "data/localproperty.txt" << "value + 10";
- QTest::newRow("value + value + 10") << "data/localproperty.txt" << "value + value + 10";
+ QTest::newRow("value") << SRCDIR "/data/localproperty.txt" << "value";
+ QTest::newRow("value + 10") << SRCDIR "/data/localproperty.txt" << "value + 10";
+ QTest::newRow("value + value + 10") << SRCDIR "/data/localproperty.txt" << "value + value + 10";
- QTest::newRow("MyObject.value") << "data/idproperty.txt" << "MyObject.value";
- QTest::newRow("MyObject.value + 10") << "data/idproperty.txt" << "MyObject.value + 10";
- QTest::newRow("MyObject.value + MyObject.value + 10") << "data/idproperty.txt" << "MyObject.value + MyObject.value + 10";
+ QTest::newRow("myObject.value") << SRCDIR "/data/idproperty.txt" << "myObject.value";
+ QTest::newRow("myObject.value + 10") << SRCDIR "/data/idproperty.txt" << "myObject.value + 10";
+ QTest::newRow("myObject.value + myObject.value + 10") << SRCDIR "/data/idproperty.txt" << "myObject.value + myObject.value + 10";
}
void tst_binding::basicproperty()
diff --git a/tests/benchmarks/declarative/creation/tst_creation.cpp b/tests/benchmarks/declarative/creation/tst_creation.cpp
index 9c0fd27..4319208 100644
--- a/tests/benchmarks/declarative/creation/tst_creation.cpp
+++ b/tests/benchmarks/declarative/creation/tst_creation.cpp
@@ -42,7 +42,7 @@
#include <qtest.h>
#include <QDeclarativeEngine>
#include <QDeclarativeComponent>
-#include <QDeclarativeMetaType>
+#include <private/qdeclarativemetatype_p.h>
#include <QDebug>
#include <QGraphicsScene>
#include <QGraphicsItem>
@@ -339,7 +339,8 @@ void tst_creation::itemtree_data_cpp()
for (int i = 0; i < 30; ++i) {
QDeclarativeItem *child = new QDeclarativeItem;
QDeclarativeGraphics_setParent_noEvent(child,item);
- item->data()->append(child);
+ QDeclarativeListReference ref(item, "data");
+ ref.append(child);
}
delete item;
}
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml
index 723e62a..e48194a 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/data/samegame/BoomBlock.qml
@@ -7,8 +7,8 @@ Item { id:block
property int targetX: 0
property int targetY: 0
- x: SpringFollow { enabled: spawned; source: targetX; spring: 2; damping: 0.2 }
- y: SpringFollow { source: targetY; spring: 2; damping: 0.2 }
+ SpringFollow on x { enabled: spawned; source: targetX; spring: 2; damping: 0.2 }
+ SpringFollow on y { source: targetY; spring: 2; damping: 0.2 }
Image { id: img
source: {
@@ -21,7 +21,7 @@ Item { id:block
}
}
opacity: 0
- opacity: Behavior { NumberAnimation { duration: 200 } }
+ Behavior on opacity { NumberAnimation { duration: 200 } }
anchors.fill: parent
}
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
index 12fa9f4..30ef235 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro
@@ -7,6 +7,9 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativecomponent.cpp testtypes.cpp
HEADERS += testtypes.h
+# Define SRCDIR equal to test's source directory
+DEFINES += SRCDIR=\\\"$$PWD\\\"
+
symbian* {
data.sources = data/*
data.path = data
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h b/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h
index 4b103ce..523f94d 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h
@@ -50,7 +50,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(int result READ result WRITE setResult);
Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged);
Q_PROPERTY(MyQmlObject *object READ object WRITE setObject NOTIFY objectChanged);
- Q_PROPERTY(QDeclarativeList<QObject *> *data READ data);
+ Q_PROPERTY(QDeclarativeListProperty<QObject> data READ data);
Q_CLASSINFO("DefaultProperty", "data");
public:
MyQmlObject() : m_result(0), m_value(0), m_object(0) {}
@@ -61,7 +61,7 @@ public:
int value() const { return m_value; }
void setValue(int v) { m_value = v; emit valueChanged(); }
- QDeclarativeList<QObject *> *data() { return &m_data; }
+ QDeclarativeListProperty<QObject> data() { return QDeclarativeListProperty<QObject>(this, m_data); }
MyQmlObject *object() const { return m_object; }
void setObject(MyQmlObject *o) { m_object = o; emit objectChanged(); }
@@ -71,7 +71,7 @@ signals:
void objectChanged();
private:
- QDeclarativeConcreteList<QObject *> m_data;
+ QList<QObject *> m_data;
int m_result;
int m_value;
MyQmlObject *m_object;
diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
index 7065303..4b1456e 100644
--- a/tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
+++ b/tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
@@ -90,13 +90,13 @@ void tst_qmlcomponent::creation_data()
{
QTest::addColumn<QString>("file");
- QTest::newRow("Object") << "data/object.qml";
- QTest::newRow("Object - Id") << "data/object_id.qml";
- QTest::newRow("MyQmlObject") << "data/myqmlobject.qml";
- QTest::newRow("MyQmlObject: basic binding") << "data/myqmlobject_binding.qml";
- QTest::newRow("Synthesized properties") << "data/synthesized_properties.qml";
- QTest::newRow("Synthesized properties.2") << "data/synthesized_properties.2.qml";
- QTest::newRow("SameGame - BoomBlock") << "data/samegame/BoomBlock.qml";
+ QTest::newRow("Object") << SRCDIR "/data/object.qml";
+ QTest::newRow("Object - Id") << SRCDIR "/data/object_id.qml";
+ QTest::newRow("MyQmlObject") << SRCDIR "/data/myqmlobject.qml";
+ QTest::newRow("MyQmlObject: basic binding") << SRCDIR "/data/myqmlobject_binding.qml";
+ QTest::newRow("Synthesized properties") << SRCDIR "/data/synthesized_properties.qml";
+ QTest::newRow("Synthesized properties.2") << SRCDIR "/data/synthesized_properties.2.qml";
+ QTest::newRow("SameGame - BoomBlock") << SRCDIR "/data/samegame/BoomBlock.qml";
}
void tst_qmlcomponent::creation()
diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
index 8070768..79fdd26 100644
--- a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
+++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro
@@ -6,3 +6,5 @@ macx:CONFIG -= app_bundle
SOURCES += tst_qdeclarativemetaproperty.cpp
+# Define SRCDIR equal to test's source directory
+DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp b/tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp
index dae1751..8a5f4ae 100644
--- a/tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp
+++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp
@@ -42,7 +42,7 @@
#include <qtest.h>
#include <QDeclarativeEngine>
#include <QDeclarativeComponent>
-#include <QDeclarativeMetaProperty>
+#include <QDeclarativeProperty>
#include <QFile>
#include <QDebug>
@@ -89,8 +89,8 @@ void tst_qmlmetaproperty::lookup_data()
{
QTest::addColumn<QString>("file");
- QTest::newRow("Simple Object") << "data/object.qml";
- QTest::newRow("Synthesized Object") << "data/synthesized_object.qml";
+ QTest::newRow("Simple Object") << SRCDIR "/data/object.qml";
+ QTest::newRow("Synthesized Object") << SRCDIR "/data/synthesized_object.qml";
}
void tst_qmlmetaproperty::lookup()
@@ -103,7 +103,7 @@ void tst_qmlmetaproperty::lookup()
QObject *obj = c.create();
QBENCHMARK {
- QDeclarativeMetaProperty p(obj, "x");
+ QDeclarativeProperty p(obj, "x");
}
delete obj;
diff --git a/tests/benchmarks/declarative/script/tst_script.cpp b/tests/benchmarks/declarative/script/tst_script.cpp
index 61f5fc8..9dd4076 100644
--- a/tests/benchmarks/declarative/script/tst_script.cpp
+++ b/tests/benchmarks/declarative/script/tst_script.cpp
@@ -96,11 +96,6 @@ private slots:
private:
};
-void tst_script::initTestCase()
-{
- QML_REGISTER_TYPE(Qt.test, 1, 0, TestObject, TestObject);
-}
-
inline QUrl TEST_FILE(const QString &filename)
{
return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
@@ -147,6 +142,12 @@ int TestObject::x()
return m_x++;
}
+void tst_script::initTestCase()
+{
+ QML_REGISTER_TYPE(Qt.test, 1, 0, TestObject, TestObject);
+}
+
+
#define PROPERTY_PROGRAM \
"(function(testObject) { return (function() { " \
" var test = 0; " \