diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-03 05:09:56 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-03 05:09:56 (GMT) |
commit | 953078ed630dd7e3dae568bf003950bda98d8f47 (patch) | |
tree | 4b8300ffeebff96746bf56e6cdcbe4b33b4fc7c8 /tests/benchmarks/declarative | |
parent | 651b7aa72052faa90b3a268f00f82d56460166d3 (diff) | |
download | Qt-953078ed630dd7e3dae568bf003950bda98d8f47.zip Qt-953078ed630dd7e3dae568bf003950bda98d8f47.tar.gz Qt-953078ed630dd7e3dae568bf003950bda98d8f47.tar.bz2 |
Make QmlMetaProperty reentrant
Diffstat (limited to 'tests/benchmarks/declarative')
10 files changed, 106 insertions, 1 deletions
diff --git a/tests/benchmarks/declarative/qmlcomponent/myqmlobject.txt b/tests/benchmarks/declarative/qmlcomponent/myqmlobject.txt index 05ed87a..9c3f7f8 100644 --- a/tests/benchmarks/declarative/qmlcomponent/myqmlobject.txt +++ b/tests/benchmarks/declarative/qmlcomponent/myqmlobject.txt @@ -1 +1,3 @@ +import Qt.test 4.6 + MyQmlObject {} diff --git a/tests/benchmarks/declarative/qmlcomponent/myqmlobject_binding.txt b/tests/benchmarks/declarative/qmlcomponent/myqmlobject_binding.txt index 4dfa7c3..e6cc4cf 100644 --- a/tests/benchmarks/declarative/qmlcomponent/myqmlobject_binding.txt +++ b/tests/benchmarks/declarative/qmlcomponent/myqmlobject_binding.txt @@ -1,3 +1,5 @@ +import Qt.test 4.6 + MyQmlObject { result: value } diff --git a/tests/benchmarks/declarative/qmlcomponent/object.txt b/tests/benchmarks/declarative/qmlcomponent/object.txt index 7dc75192..85e74b9 100644 --- a/tests/benchmarks/declarative/qmlcomponent/object.txt +++ b/tests/benchmarks/declarative/qmlcomponent/object.txt @@ -1 +1,3 @@ +import Qt 4.6 + Object {} diff --git a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt index d59104d..90db37c 100644 --- a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt +++ b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.2.txt @@ -1,3 +1,5 @@ +import Qt 4.6 + Object { property int a property bool b diff --git a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt index d9eb708..bb5469a 100644 --- a/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt +++ b/tests/benchmarks/declarative/qmlcomponent/synthesized_properties.txt @@ -1,3 +1,5 @@ +import Qt 4.6 + Object { property int a } diff --git a/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp b/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp index 60e69e2..5021bf3 100644 --- a/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp +++ b/tests/benchmarks/declarative/qmlcomponent/testtypes.cpp @@ -1,3 +1,3 @@ #include "testtypes.h" -QML_DEFINE_TYPE(MyQmlObject, MyQmlObject); +QML_DEFINE_TYPE(Qt/test, 4, 6, 6, MyQmlObject, MyQmlObject); diff --git a/tests/benchmarks/declarative/qmlmetaproperty/object.txt b/tests/benchmarks/declarative/qmlmetaproperty/object.txt new file mode 100644 index 0000000..11b95e1 --- /dev/null +++ b/tests/benchmarks/declarative/qmlmetaproperty/object.txt @@ -0,0 +1,3 @@ +import Qt 4.6 + +Item {} diff --git a/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro b/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro new file mode 100644 index 0000000..b4e83d7 --- /dev/null +++ b/tests/benchmarks/declarative/qmlmetaproperty/qmlmetaproperty.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qmlmetaproperty +QT += declarative + +SOURCES += tst_qmlmetaproperty.cpp + diff --git a/tests/benchmarks/declarative/qmlmetaproperty/synthesized_object.txt b/tests/benchmarks/declarative/qmlmetaproperty/synthesized_object.txt new file mode 100644 index 0000000..a923a0a --- /dev/null +++ b/tests/benchmarks/declarative/qmlmetaproperty/synthesized_object.txt @@ -0,0 +1,6 @@ +import Qt 4.6 + +Item { + property int blah +} + diff --git a/tests/benchmarks/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp b/tests/benchmarks/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp new file mode 100644 index 0000000..c22af03 --- /dev/null +++ b/tests/benchmarks/declarative/qmlmetaproperty/tst_qmlmetaproperty.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +****************************************************************************/ + +#include <qtest.h> +#include <QmlEngine> +#include <QmlComponent> +#include <QmlMetaProperty> +#include <QFile> +#include <QDebug> + +//TESTED_FILES= + + +class tst_qmlmetaproperty : public QObject +{ + Q_OBJECT + +public: + tst_qmlmetaproperty(); + virtual ~tst_qmlmetaproperty(); + +public slots: + void init(); + void cleanup(); + +private slots: + void lookup_data(); + void lookup(); + +private: + QmlEngine engine; +}; + +tst_qmlmetaproperty::tst_qmlmetaproperty() +{ +} + +tst_qmlmetaproperty::~tst_qmlmetaproperty() +{ +} + +void tst_qmlmetaproperty::init() +{ +} + +void tst_qmlmetaproperty::cleanup() +{ +} + +void tst_qmlmetaproperty::lookup_data() +{ + QTest::addColumn<QString>("file"); + + QTest::newRow("Simple Object") << "object.txt"; + QTest::newRow("Synthesized Object") << "synthesized_object.txt"; +} + +void tst_qmlmetaproperty::lookup() +{ + QFETCH(QString, file); + + QmlComponent c(&engine, file); + QVERIFY(c.isReady()); + + QObject *obj = c.create(); + + QBENCHMARK { + QmlMetaProperty p(obj, "x"); + } + + delete obj; +} + +QTEST_MAIN(tst_qmlmetaproperty) +#include "tst_qmlmetaproperty.moc" |