aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMichael Brüning <michael.bruning@qt.io>2020-05-27 18:22:29 +0200
committerMichael Brüning <michael.bruning@qt.io>2020-06-02 20:22:56 +0000
commitb7155a6a04177707ba1247c88d903e07035cf56f (patch)
tree4046f17800256e334c2d297c338130955a823b9f /tests/auto
parent3a1d759b1fe09e075d8a87fd2729264b1a736632 (diff)
Adjust test case data for complex test and reactivate it
Change-Id: I5e61971ff420f3193bca1f63040044833e26cca8 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp7
-rw-r--r--tests/auto/qml/qmldesigner/data/merging/ComplexExpected.qml15
-rw-r--r--tests/auto/qml/qmldesigner/data/merging/ComplexStyle.qml9
3 files changed, 18 insertions, 13 deletions
diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
index cb47a5f2fd..624c296192 100644
--- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
+++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp
@@ -3774,7 +3774,7 @@ void tst_TestCore::testMergeModelRewriter1_data()
QString buttonOutlineExpectedQmlContents = readQmlFromFile(QString(TESTSRCDIR) + "/../data/merging/ButtonOutlineExpected.qml");
QTest::newRow("Simple style replacement") << simpleTemplateQmlContents << simpleStyleQmlContents << simpleExpectedQmlContents;
- //QTest::newRow("Complex style replacement") << complexTemplateQmlContents << complexStyleQmlContents << complexExpectedQmlContents;
+ QTest::newRow("Complex style replacement") << complexTemplateQmlContents << complexStyleQmlContents << complexExpectedQmlContents;
QTest::newRow("Empty stylesheet") << emptyTemplateQmlContents << emptyStyleQmlContents << emptyExpectedQmlContents;
QTest::newRow("Root node replacement") << rootReplacementTemplateQmlContents << rootReplacementStyleQmlContents << rootReplacementExpectedQmlContents;
QTest::newRow("Switch styling") << switchTemplateQmlContents << switchStyleQmlContents << switchExpectedQmlContents;
@@ -3828,7 +3828,10 @@ void tst_TestCore::testMergeModelRewriter1()
StylesheetMerger merger(templateView.data(), styleView.data());
merger.merge();
- QCOMPARE(textEdit1.toPlainText().trimmed(), qmlExpectedString.trimmed());
+ QString trimmedActual = textEdit1.toPlainText().trimmed();
+ QString trimmedExpected = qmlExpectedString.trimmed();
+
+ QCOMPARE(trimmedActual, trimmedExpected);
}
void tst_TestCore::testCopyModelRewriter2()
diff --git a/tests/auto/qml/qmldesigner/data/merging/ComplexExpected.qml b/tests/auto/qml/qmldesigner/data/merging/ComplexExpected.qml
index eb0ca78fad..a3347ab4af 100644
--- a/tests/auto/qml/qmldesigner/data/merging/ComplexExpected.qml
+++ b/tests/auto/qml/qmldesigner/data/merging/ComplexExpected.qml
@@ -30,24 +30,26 @@ Rectangle {
Rectangle {
id: rectangle3
- x: 140;
- y: 180;
+ x: 140
+ y: 180
gradient: Gradient {
GradientStop {
position: 0
- color: "white"
+ color: "#ffffff"
}
+
GradientStop {
position: 1
- color: "black"
+ color: "#000000"
}
}
Image {
id: rectangle4
x: 10
y: 20
- width: 200
- height: 50
+ width: 100
+ height: 150
+ source: "qt/realcool.jpg"
Rectangle {
id: rectangle5
x: 10
@@ -55,7 +57,6 @@ Rectangle {
width: 200
height: 50
}
- source: "qt/realcool.jpg"
}
}
diff --git a/tests/auto/qml/qmldesigner/data/merging/ComplexStyle.qml b/tests/auto/qml/qmldesigner/data/merging/ComplexStyle.qml
index 9bf50d8f0f..63ed4868de 100644
--- a/tests/auto/qml/qmldesigner/data/merging/ComplexStyle.qml
+++ b/tests/auto/qml/qmldesigner/data/merging/ComplexStyle.qml
@@ -21,6 +21,7 @@ Item {
position: 0
color: "white"
}
+
GradientStop {
position: 1
color: "black"
@@ -29,15 +30,15 @@ Item {
}
Rectangle {
id: rectangle5
- x: 10
- y: 20
+ x: 160
+ y: 220
width: 200
height: 50
}
Image {
id: rectangle4
- x: 10;
- y: 10;
+ x: 150;
+ y: 200;
height: 150
width: 100
source: "qt/realcool.jpg"