summaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp')
-rw-r--r--tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp b/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
index 186e512..06c0dbd 100644
--- a/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
+++ b/tests/auto/qml/qqmlstatemachinemetatype/tst_qqmlstatemachinemetatype.cpp
@@ -26,6 +26,8 @@
**
****************************************************************************/
+#include "../../shared/util.h"
+
#include <qtest.h>
#include <qqmlengine.h>
#include <qqmlcomponent.h>
@@ -33,7 +35,7 @@
#include <private/qqmlmetatype_p.h>
#include <private/qqmlengine_p.h>
-class tst_qqmlstatemachinemetatype : public QObject
+class tst_qqmlstatemachinemetatype : public QQmlDataTest
{
Q_OBJECT
@@ -41,17 +43,10 @@ private slots:
void unregisterAttachedProperties()
{
qmlClearTypeRegistrations();
- const QUrl dummy("qrc:///doesnotexist.qml");
QQmlEngine e;
- QQmlComponent c(&e);
-
- // The extra import shuffles the type IDs around, so that we
- // get a different ID for the attached properties. If the attached
- // properties aren't properly cleared, this will crash.
- c.setData("import QtQml.StateMachine 1.0 \n"
- "import QtQuick 2.2 \n"
- "Item { KeyNavigation.up: null }", dummy);
+ QQmlComponent c(&e, testFileUrl("unregisterAttachedProperties.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
const QQmlType attachedType = QQmlMetaType::qmlType("QtQuick/KeyNavigation",
QTypeRevision::fromVersion(2, 2));