diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-02-27 13:50:57 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-02-28 08:46:51 +0000 |
commit | 2127bddc0ef026b3a7b9737872956f19a051520d (patch) | |
tree | 2a5b502cb5f009a33383b333b86ce4093beee1be | |
parent | b37d2701f93028df6579b2e8ad550818cf7093f6 (diff) |
Move test for ignoreMessage to the top
This should make it more robust to changes in line numbers
Change-Id: I8394fce060e05226d02af0dad5f7d8d9552bc63b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml | 122 |
1 files changed, 60 insertions, 62 deletions
diff --git a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml index d6231f28fd..b460493f1f 100644 --- a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml +++ b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml @@ -68,6 +68,66 @@ Item { return [item.x, item.y, item.width, item.height]; } + Component { + id: itemsWithAnchorsLayout_Component + RowLayout { + spacing: 2 + Item { + anchors.fill: parent + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.centerIn: parent + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.left: parent.left + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.right: parent.right + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.top: parent.top + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.bottom: parent.bottom + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + implicitWidth: 10 + implicitHeight: 10 + } + Item { + anchors.margins: 42 // although silly, it should not cause a warning from the Layouts POV + implicitWidth: 10 + implicitHeight: 10 + } + } + } + + function test_warnAboutLayoutItemsWithAnchors() + { + var fullPath = Qt.resolvedUrl("tst_rowlayout.qml") + for (var i = 0; i < 7; ++i) { + ignoreWarning(fullPath + ":" + (75 + 5*i) +":17: QML Item: Detected anchors on an item that is managed by a layout. " + + "This is undefined behavior; use Layout.alignment instead.") + } + var layout = itemsWithAnchorsLayout_Component.createObject(container) + waitForRendering(layout) + layout.destroy() + } + function test_fixedAndExpanding() { var test_layoutStr = 'import QtQuick 2.2; \ @@ -1004,67 +1064,5 @@ Item { // Shouldn't crash upon destroying containerUser. } - - - Component { - id: itemsWithAnchorsLayout_Component - RowLayout { - spacing: 2 - Item { - anchors.fill: parent - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.centerIn: parent - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.left: parent.left - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.right: parent.right - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.top: parent.top - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.bottom: parent.bottom - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - implicitWidth: 10 - implicitHeight: 10 - } - Item { - anchors.margins: 42 // although silly, it should not cause a warning from the Layouts POV - implicitWidth: 10 - implicitHeight: 10 - } - } - } - - function test_warnAboutLayoutItemsWithAnchors() - { - var fullPath = Qt.resolvedUrl("tst_rowlayout.qml") - for (var i = 0; i < 7; ++i) { - ignoreWarning(fullPath + ":" + (1013 + 5*i) +":17: QML Item: Detected anchors on an item that is managed by a layout. " - + "This is undefined behavior; use Layout.alignment instead.") - } - var layout = itemsWithAnchorsLayout_Component.createObject(container) - waitForRendering(layout) - layout.destroy() - } - } } |