From 11995169ee09a99ef1af4c778e30e25829c635b4 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 18 Mar 2019 10:12:11 +0100 Subject: Mark BaseValidator::throwRecursionDepthError() as final Task-number: QTBUG-74512 Change-Id: I7b154d793c134a93aa3a48ade7d3ae785c44e7ea Reviewed-by: Mitch Curtis --- tests/auto/sanity/tst_sanity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp index d2d962bc..62a1f574 100644 --- a/tests/auto/sanity/tst_sanity.cpp +++ b/tests/auto/sanity/tst_sanity.cpp @@ -137,7 +137,7 @@ protected: m_errors += QString("%1:%2 : %3").arg(m_fileName).arg(node->firstSourceLocation().startLine).arg(error); } - void throwRecursionDepthError() + void throwRecursionDepthError() final { m_errors += QString::fromLatin1("%1: Maximum statement or expression depth exceeded") .arg(m_fileName); -- cgit v1.2.3 From 7c31b884b932034bb907db638f155b813d90aff2 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 28 Mar 2019 12:49:43 +0100 Subject: Attempt to stabilize Tumbler::test_itemsCorrectlyPositioned I'm not sure if this will help (because I haven't been able to reproduce the flakiness, even in a CI VM), but the tumbler should really not still be spinning after we got the position of its items, so make sure it's stopped before doing any comparisons. Task-number: QTBUG-70597 Change-Id: I72555747b2ea4ef136cdaa13f7b0757be2624e73 Reviewed-by: Richard Moe Gustavsen --- tests/auto/controls/data/tst_tumbler.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml index 7c2095f8..c9cc10d7 100644 --- a/tests/auto/controls/data/tst_tumbler.qml +++ b/tests/auto/controls/data/tst_tumbler.qml @@ -357,12 +357,12 @@ TestCase { tumbler.forceActiveFocus(); keyClick(Qt.Key_Down); tryCompare(tumblerView, "offset", 3.0); + tryCompare(tumbler, "moving", false); firstItemCenterPos = itemCenterPos(0); firstItem = tumblerView.itemAt(firstItemCenterPos.x, firstItemCenterPos.y); verify(firstItem); // Test QTBUG-40298. actualPos = testCase.mapFromItem(firstItem, 0, 0); - tryCompare(tumbler, "moving", false); fuzzyCompare(actualPos.x, tumbler.leftPadding, 0.0001); fuzzyCompare(actualPos.y, tumbler.topPadding, 0.0001); -- cgit v1.2.3 From ef9ab1a4bd4e3545cfb1c23c002e58b3e078ed75 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 26 Mar 2019 14:42:06 +0100 Subject: tst_dialogbuttonbox.qml: use tryVerify() consistently to avoid flakiness Change-Id: Ic18cca692b09f55818b9c99379aae4be72ba4159 Fixes: QTBUG-74711 Reviewed-by: Richard Moe Gustavsen --- tests/auto/controls/data/tst_dialogbuttonbox.qml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_dialogbuttonbox.qml b/tests/auto/controls/data/tst_dialogbuttonbox.qml index 374b32ff..0e2566e9 100644 --- a/tests/auto/controls/data/tst_dialogbuttonbox.qml +++ b/tests/auto/controls/data/tst_dialogbuttonbox.qml @@ -288,9 +288,12 @@ TestCase { verify(button) // The button should never go outside of the box. - var buttonPosInBox = button.mapToItem(control, 0, 0) - verify(buttonPosInBox.x >= 0) - verify(buttonPosInBox.x + button.width < control.width) + tryVerify(function() { return button.mapToItem(control, 0, 0).x >= 0 }, + 1000, "Expected left edge of button to be within left edge of DialogButtonBox (i.e. greater than or equal to 0)" + + ", but it's " + button.mapToItem(control, 0, 0).x) + tryVerify(function() { return button.mapToItem(control, 0, 0).x + button.width <= control.width }, + 1000, "Expected right edge of button to be within right edge of DialogButtonBox (i.e. less than or equal to " + + control.width + "), but it's " + (button.mapToItem(control, 0, 0).x + button.width)) } Component { @@ -333,11 +336,12 @@ TestCase { verify(button) // The button should never go outside of the box. - var buttonPosInBox = button.mapToItem(box, 0, 0) - verify(buttonPosInBox.x >= 0, "Expected button to be inside left edge " - + "of DialogButtonBox, but it's " + buttonPosInBox.x) - verify(buttonPosInBox.x + button.width <= box.width, "Expected button to be inside right edge " - + "of DialogButtonBox (" + box.width + "), but it's " + (buttonPosInBox.x + button.width)) + tryVerify(function() { return button.mapToItem(box, 0, 0).x >= 0 }, + 1000, "Expected left edge of button to be within left edge of DialogButtonBox (i.e. greater than or equal to 0)" + + ", but it's " + button.mapToItem(box, 0, 0).x) + tryVerify(function() { return button.mapToItem(box, 0, 0).x + button.width <= box.width }, + 1000, "Expected right edge of button to be within right edge of DialogButtonBox (i.e. less than or equal to " + + box.width + "), but it's " + (button.mapToItem(box, 0, 0).x + button.width)) compare(box.width, dialog.width) // There's a single button and we align it to the right. compare(box.contentItem.width, button.width) -- cgit v1.2.3 From 1bb25edd6c30e163976afa43065671ffcb56d6f4 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 26 Mar 2019 15:22:31 +0100 Subject: tst_dialogbuttonbox.qml: consolidate two similar tests into one data-driven one. Change-Id: I7507765747dd984530e50df5cd08152b9d71cb66 Reviewed-by: Richard Moe Gustavsen --- tests/auto/controls/data/tst_dialogbuttonbox.qml | 35 ++++++++---------------- 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_dialogbuttonbox.qml b/tests/auto/controls/data/tst_dialogbuttonbox.qml index 0e2566e9..a651713a 100644 --- a/tests/auto/controls/data/tst_dialogbuttonbox.qml +++ b/tests/auto/controls/data/tst_dialogbuttonbox.qml @@ -366,27 +366,6 @@ TestCase { } } - // QTBUG-72886 - function test_oneCustomButtonChangeText() { - var control = createTemporaryObject(customButtonBox, testCase, {}) - verify(control) - - var listView = control.contentItem - waitForRendering(listView) - - var button = control.okButton - verify(button) - button.text = "some longer text"; - - // The button should never go outside of the box. - tryVerify(function() { return button.mapToItem(control, 0, 0).x >= 0 }, - 1000, "Expected left edge of button to be within left edge of DialogButtonBox (i.e. greater than or equal to 0)" + - ", but it's " + button.mapToItem(control, 0, 0).x) - tryVerify(function() { return button.mapToItem(control, 0, 0).x + button.width <= control.width }, - 1000, "Expected right edge of button to be within right edge of DialogButtonBox (i.e. less than or equal to " + - control.width + "), but it's " + (button.mapToItem(control, 0, 0).x + button.width)) - } - Component { id: customButtonBoxTwoButtons @@ -410,16 +389,25 @@ TestCase { } } + function test_changeCustomButtonText_data() { + return [ + { tag: "oneButton", component: customButtonBox }, + { tag: "twoButtons", component: customButtonBoxTwoButtons }, + ] + } + // QTBUG-72886 - function test_twoCustomButtonsChangeText() { - var control = createTemporaryObject(customButtonBoxTwoButtons, testCase, {}) + function test_changeCustomButtonText(data) { + var control = createTemporaryObject(customButtonBox, testCase, {}) verify(control) var listView = control.contentItem waitForRendering(listView) var button = control.okButton + verify(button) button.text = "some longer text"; + // The button should never go outside of the box. tryVerify(function() { return button.mapToItem(control, 0, 0).x >= 0 }, 1000, "Expected left edge of button to be within left edge of DialogButtonBox (i.e. greater than or equal to 0)" + @@ -429,7 +417,6 @@ TestCase { control.width + "), but it's " + (button.mapToItem(control, 0, 0).x + button.width)) } - Component { id: noRolesDialog -- cgit v1.2.3