summaryrefslogtreecommitdiff
path: root/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2012-09-19 13:35:01 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2012-09-19 16:29:31 +0200
commit32c38a158e229d99dfe41b799cfcb4e20f2b8dd0 (patch)
treea6f75852026110db6cf4af6e51fba6f2484e0965 /tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
parent2057892bd440a98072da97d397fc3e95c52e5472 (diff)
downloadqt-creator-32c38a158e229d99dfe41b799cfcb4e20f2b8dd0.tar.gz
Tests.QmlDesigner: fix testRewriterChangeImports
Qt 4.7 is no more. The test was broken for the alias import. Change-Id: Ia642907802d03d379d6ea3bdeb9745241b6bc7fc Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Diffstat (limited to 'tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp')
-rw-r--r--tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
index 7041cecea9..b6708ad1aa 100644
--- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
+++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
@@ -915,7 +915,7 @@ void tst_TestCore::testRewriterChangeImports()
model->changeImports(QList<Import>(), importList);
QCOMPARE(model->imports().size(), 1);
- QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
+ QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
QCOMPARE(textEdit.toPlainText(), qmlString);
@@ -923,7 +923,10 @@ void tst_TestCore::testRewriterChangeImports()
//
// Add / Remove an import in the model (with alias)
//
- model->changeImports(importList, QList<Import>());
+
+ Import webkitImportAlias = Import::createLibraryImport("QtWebKit", "1.0", "Web");
+
+ model->changeImports(QList<Import>() << webkitImportAlias, QList<Import>() << webkitImport);
const QLatin1String qmlWithAliasImport("\n"
"import QtQuick 1.1\n"
@@ -932,30 +935,27 @@ void tst_TestCore::testRewriterChangeImports()
"Rectangle {}\n");
QCOMPARE(textEdit.toPlainText(), qmlWithAliasImport);
- model->changeImports(QList<Import>(), importList);
-
- QCOMPARE(model->imports().size(), 1);
- QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
+ model->changeImports(QList<Import>(), QList<Import>() << webkitImportAlias);
+ QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
QCOMPARE(textEdit.toPlainText(), qmlString);
-
//
// Add / Remove an import in text
//
textEdit.setPlainText(qmlWithImport);
QCOMPARE(model->imports().size(), 2);
- QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
+ QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0"));
textEdit.setPlainText(qmlWithAliasImport);
QCOMPARE(model->imports().size(), 2);
- QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
+ QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
QCOMPARE(model->imports().last(), Import::createLibraryImport("QtWebKit", "1.0", "Web"));
textEdit.setPlainText(qmlString);
QCOMPARE(model->imports().size(), 1);
- QCOMPARE(model->imports().first(), Import::createLibraryImport("Qt", "4.7"));
+ QCOMPARE(model->imports().first(), Import::createLibraryImport("QtQuick", "1.1"));
}
void tst_TestCore::testRewriterForGradientMagic()