diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 16:00:07 +0200 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 16:00:07 +0200 |
commit | 19ed7973a311a8d42d3a558bb551230e902ce9b9 (patch) | |
tree | 9832c0cc796722f85579e25fd50cc38b65e6ef6c /tests/auto/quick/qquickstates/tst_qquickstates.cpp | |
parent | f5701f0def37fcc0c2b38ae9552eb3a896a34687 (diff) | |
parent | a5635345175e667601c8b6a344508c4d4ebb0f9d (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Change-Id: I91d2b178e7111d0802ea973bccf230b264c30c96
Diffstat (limited to 'tests/auto/quick/qquickstates/tst_qquickstates.cpp')
-rw-r--r-- | tests/auto/quick/qquickstates/tst_qquickstates.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickstates/tst_qquickstates.cpp b/tests/auto/quick/qquickstates/tst_qquickstates.cpp index 849522454f..aa55b42935 100644 --- a/tests/auto/quick/qquickstates/tst_qquickstates.cpp +++ b/tests/auto/quick/qquickstates/tst_qquickstates.cpp @@ -188,6 +188,7 @@ private slots: void revertListMemoryLeak(); void duplicateStateName(); void trivialWhen(); + void noStateOsciallation(); void parentChangeCorrectReversal(); void revertNullObjectBinding(); }; @@ -1733,6 +1734,20 @@ void tst_qquickstates::trivialWhen() QVERIFY(c.create()); } +void tst_qquickstates::noStateOsciallation() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("noStateOsciallation.qml")); + QScopedPointer<QObject> root {component.create()}; + QVERIFY(root); + // set to 1 on initial transition from "" to "n2" + QCOMPARE(root->property("stateChangeCounter").toInt(), 1); + root->setProperty("number", 1); + // setting number to 1 changes directly from "n2" to "n1" + // without any intermediate transition to "" + QCOMPARE(root->property("stateChangeCounter").toInt(), 2); +} + void tst_qquickstates::parentChangeCorrectReversal() { QQmlEngine engine; |