diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-14 13:04:22 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-23 20:56:31 +0200 |
commit | ae36d94c2f385e272ae25fcd0fe780edb70cf7d9 (patch) | |
tree | 5812b2a57c9f355313755b95a09358f9c19cd7d4 /tests/auto/qmltest | |
parent | 48b4c1f450109b148f03f62574d78b460859c4a1 (diff) | |
download | qtdeclarative-ae36d94c2f385e272ae25fcd0fe780edb70cf7d9.tar.gz |
Remove qml statemachine plugin from qtdeclarative
Task-number: QTBUG-80316
Change-Id: I584b699a1eec88117f343870bd2cd01075da64f7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'tests/auto/qmltest')
16 files changed, 0 insertions, 946 deletions
diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt index 184c1c1216..ac950263b5 100644 --- a/tests/auto/qmltest/CMakeLists.txt +++ b/tests/auto/qmltest/CMakeLists.txt @@ -23,7 +23,6 @@ add_subdirectory(rectangle) add_subdirectory(selftests) add_subdirectory(shadersource) add_subdirectory(stability) -add_subdirectory(statemachine) add_subdirectory(text) add_subdirectory(textedit) add_subdirectory(textinput) diff --git a/tests/auto/qmltest/qmltest.pro b/tests/auto/qmltest/qmltest.pro index 8ad1541cbc..3463d1735f 100644 --- a/tests/auto/qmltest/qmltest.pro +++ b/tests/auto/qmltest/qmltest.pro @@ -23,7 +23,6 @@ SUBDIRS += \ selftests \ shadersource \ stability \ - statemachine \ text \ textedit \ textinput \ diff --git a/tests/auto/qmltest/statemachine/CMakeLists.txt b/tests/auto/qmltest/statemachine/CMakeLists.txt deleted file mode 100644 index fafaf382d8..0000000000 --- a/tests/auto/qmltest/statemachine/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Generated from statemachine.pro. - -##################################################################### -## statemachine Test: -##################################################################### - -qt_add_test(statemachine - GUI - QMLTEST - PUBLIC_LIBRARIES - Qt::Gui -) diff --git a/tests/auto/qmltest/statemachine/statemachine.pro b/tests/auto/qmltest/statemachine/statemachine.pro deleted file mode 100644 index a7938e7003..0000000000 --- a/tests/auto/qmltest/statemachine/statemachine.pro +++ /dev/null @@ -1 +0,0 @@ -CONFIG += qmltestcase diff --git a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml deleted file mode 100644 index 65ce58860c..0000000000 --- a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - StateMachine { - State { - } - } - name: "anonymousState" - // no real tests, just make sure it runs -} diff --git a/tests/auto/qmltest/statemachine/tst_enumguard.qml b/tests/auto/qmltest/statemachine/tst_enumguard.qml deleted file mode 100644 index d871ef980a..0000000000 --- a/tests/auto/qmltest/statemachine/tst_enumguard.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - id: testCase - StateMachine { - id: machine - initialState: startState - State { - id: startState - SignalTransition { - id: signalTrans - signal: testCase.mysignal - guard: alignment === QState.ParallelStates - targetState: finalState - } - } - FinalState { - id: finalState - } - } - - SignalSpy { - id: finalStateActive - target: finalState - signalName: "activeChanged" - } - - signal mysignal(int alignment) - - name: "testEnumGuard" - function test_enumGuard() - { - // Start statemachine, should not have reached finalState yet. - machine.start() - tryCompare(finalStateActive, "count", 0) - tryCompare(machine, "running", true) - - // Emit the signalTrans.signal which will evaluate the guard. The - // guard should return true, finalState be reached and the - // statemachine be stopped. - testCase.mysignal(QState.ParallelStates) - tryCompare(finalStateActive, "count", 1) - tryCompare(machine, "running", false) - - // Restart machine. - machine.start() - tryCompare(machine, "running", true) - tryCompare(finalStateActive, "count", 2) - - // Emit signal that makes the signalTrans.guard return false. The - // finalState should not have been triggered. - testCase.mysignal(QState.ExclusiveStates) - tryCompare(finalStateActive, "count", 2) - tryCompare(machine, "running", true) - } -} diff --git a/tests/auto/qmltest/statemachine/tst_guardcondition.qml b/tests/auto/qmltest/statemachine/tst_guardcondition.qml deleted file mode 100644 index e364b38c81..0000000000 --- a/tests/auto/qmltest/statemachine/tst_guardcondition.qml +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - id: testCase - StateMachine { - id: machine - initialState: startState - State { - id: startState - SignalTransition { - id: signalTrans - signal: testCase.mysignal - guard: mystr == "test1" - targetState: finalState - } - } - FinalState { - id: finalState - } - } - - SignalSpy { - id: finalStateActive - target: finalState - signalName: "activeChanged" - } - - signal mysignal(string mystr, bool mybool, int myint) - - name: "testGuardCondition" - function test_guardCondition() - { - // Start statemachine, should not have reached finalState yet. - machine.start() - tryCompare(finalStateActive, "count", 0) - tryCompare(machine, "running", true) - - // Emit the signalTrans.signal which will evaluate the guard. The - // guard should return true, finalState be reached and the - // statemachine be stopped. - testCase.mysignal("test1", true, 2) - tryCompare(finalStateActive, "count", 1) - tryCompare(machine, "running", false) - - // Restart machine. - machine.start() - tryCompare(machine, "running", true) - tryCompare(finalStateActive, "count", 2) - - // Emit signal that makes the signalTrans.guard return false. The - // finalState should not have been triggered. - testCase.mysignal("test2", true, 2) - tryCompare(finalStateActive, "count", 2) - tryCompare(machine, "running", true) - - // Change the guard in javascript to test that boolean true/false - // works as expected. - signalTrans.guard = false; - testCase.mysignal("test1", true, 2) - tryCompare(finalStateActive, "count", 2) - tryCompare(machine, "running", true) - signalTrans.guard = true; - testCase.mysignal("test1", true, 2) - tryCompare(finalStateActive, "count", 3) - tryCompare(machine, "running", false) - } -} diff --git a/tests/auto/qmltest/statemachine/tst_historystate.qml b/tests/auto/qmltest/statemachine/tst_historystate.qml deleted file mode 100644 index ba94b85b10..0000000000 --- a/tests/auto/qmltest/statemachine/tst_historystate.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - - StateMachine { - id: stateMachine - initialState: historyState1 - - State { - id: state1 - SignalTransition { - id: st1 - targetState: state2 - } - } - - State { - id: state2 - initialState: historyState2 - HistoryState { - id: historyState2 - defaultState: state21 - } - State { - id: state21 - } - } - - HistoryState { - id: historyState1 - defaultState: state1 - } - } - - SignalSpy { - id: state1SpyActive - target: state1 - signalName: "activeChanged" - } - - SignalSpy { - id: state2SpyActive - target: state2 - signalName: "activeChanged" - } - - - function test_historyStateAsInitialState() - { - stateMachine.start(); - tryCompare(stateMachine, "running", true); - tryCompare(state1SpyActive, "count" , 1); - tryCompare(state2SpyActive, "count" , 0); - st1.invoke(); - tryCompare(state1SpyActive, "count" , 2); - tryCompare(state2SpyActive, "count" , 1); - tryCompare(state21, "active", true); - tryCompare(state1, "active", false); - } -} diff --git a/tests/auto/qmltest/statemachine/tst_initialstate.qml b/tests/auto/qmltest/statemachine/tst_initialstate.qml deleted file mode 100644 index ba5db1976c..0000000000 --- a/tests/auto/qmltest/statemachine/tst_initialstate.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - StateMachine { - id: myStateMachine - initialState: myState; - running: true - State { - id: myState - } - } - - name: "initialStateTest" - function test_initialState() { - tryCompare(myStateMachine, "running", true); - compare(myState.active, true); - myStateMachine.running = false; - tryCompare(myStateMachine, "running", false); - myStateMachine.running = true; - tryCompare(myStateMachine, "running", true); - tryCompare(myState, "active", true); - } -} diff --git a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml deleted file mode 100644 index f506ed72b2..0000000000 --- a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - StateMachine { - id: myStateMachine - initialState: parentState - State { - id: parentState - initialState: childState1 - State { - id: childState1 - } - State { - id: childState2 - } - } - } - name: "nestedInitalStates" - - function test_nestedInitalStates() { - compare(myStateMachine.running, false); - compare(parentState.active, false); - compare(childState1.active, false); - compare(childState2.active, false); - myStateMachine.start(); - tryCompare(myStateMachine, "running", true); - tryCompare(parentState, "active", true); - tryCompare(childState1, "active", true); - compare(childState2.active, false); - } -} diff --git a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml deleted file mode 100644 index 0a63092c3c..0000000000 --- a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - StateMachine { - id: myStateMachine - initialState: parentState - State { - id: parentState - initialState: childStateMachine - StateMachine { - id: childStateMachine - initialState: childState2 - State { - id: childState1 - } - State { - id: childState2 - } - } - } - } - name: "nestedStateMachine" - - function test_nestedStateMachine() { - compare(myStateMachine.running, false); - compare(parentState.active, false); - compare(childStateMachine.running, false); - compare(childState1.active, false); - compare(childState2.active, false); - myStateMachine.start(); - tryCompare(myStateMachine, "running", true); - tryCompare(parentState, "active", true); - tryCompare(childStateMachine, "running", true); - tryCompare(childState1, "active", false); - tryCompare(childState2, "active", true); - } -} diff --git a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml deleted file mode 100644 index eb996c7718..0000000000 --- a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - StateMachine { - id: myStateMachine - initialState: rootState - State { - id: rootState - childMode: State.ParallelStates - State { - id: childState1 - childMode: State.ParallelStates - State { - id: childState11 - } - State { - id: childState12 - } - } - State { - id: childState2 - initialState: childState21 - State { - id: childState21 - } - State { - id: childState22 - } - } - } - } - name: "nestedParallelMachineStates" - - function test_nestedInitalStates() { - // uncomment me after vm problems are fixed. - // compare(myStateMachine.running, false); - compare(childState1.active, false); - compare(childState11.active, false); - compare(childState12.active, false); - compare(childState2.active, false); - compare(childState21.active, false); - compare(childState22.active, false); - myStateMachine.start(); - tryCompare(myStateMachine, "running", true); - tryCompare(childState1, "active", true); - tryCompare(childState11, "active", true); - tryCompare(childState12, "active", true); - tryCompare(childState2, "active", true); - tryCompare(childState21, "active", true); - tryCompare(childState22, "active", false); - } -} diff --git a/tests/auto/qmltest/statemachine/tst_signaltransition.qml b/tests/auto/qmltest/statemachine/tst_signaltransition.qml deleted file mode 100644 index a57826855a..0000000000 --- a/tests/auto/qmltest/statemachine/tst_signaltransition.qml +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Ford Motor Company -** Copyright (C) 2017 The Qt Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - id: testCase - StateMachine { - id: machine - initialState: startState - State { - id: startState - SignalTransition { - id: signalTrans - signal: testCase.onMysignal - targetState: finalState - } - } - FinalState { - id: finalState - } - } - - SignalSpy { - id: finalStateActive - target: finalState - signalName: "activeChanged" - } - - signal mysignal() - - name: "testSignalTransition" - function test_signalTransition() - { - // Start statemachine, should not have reached finalState yet. - machine.start() - tryCompare(finalStateActive, "count", 0) - tryCompare(machine, "running", true) - - testCase.mysignal() - tryCompare(finalStateActive, "count", 1) - tryCompare(machine, "running", false) - } -} diff --git a/tests/auto/qmltest/statemachine/tst_trafficlight.qml b/tests/auto/qmltest/statemachine/tst_trafficlight.qml deleted file mode 100644 index ebbab0a5f4..0000000000 --- a/tests/auto/qmltest/statemachine/tst_trafficlight.qml +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - StateMachine { - id: machine - initialState: red - FinalState { - id: finalState - } - - State { - id: red - initialState: justRed - State { - id: justRed - SignalTransition { - id: e1 - targetState: waitingForGreen - } - SignalTransition { - id: finalSignal - targetState: finalState - } - } - State { - id: waitingForGreen - TimeoutTransition { - id: e2 - targetState: yellowred - timeout: 30 - } - } - } - State { - id: yellowred - TimeoutTransition { - id: e3 - targetState: green - timeout: 10 - } - } - State { - id: green - TimeoutTransition { - id: e4 - targetState: yellow - timeout: 50 - } - } - State { - id: yellow - TimeoutTransition { - id: e5 - targetState: red - timeout: 10 - } - } - } - - SignalSpy { - id: machineSpyRunning - target: machine - signalName: "runningChanged" - } - - SignalSpy { - id: redSpyActive - target: red - signalName: "activeChanged" - } - - SignalSpy { - id: yellowredSpyActive - target: yellowred - signalName: "activeChanged" - } - - SignalSpy { - id: greenSpyActive - target: green - signalName: "activeChanged" - } - - SignalSpy { - id: yellowSpyActive - target: yellow - signalName: "activeChanged" - } - - - name: "testTrafficLight" - function test_trafficLight() - { - var i = 1; - machine.start(); - tryCompare(machine, "running", true); - tryCompare(machineSpyRunning, "count", 1); - tryCompare(redSpyActive, "count", 1); - for (; i <= 5; ++i) { - e1.invoke(); - tryCompare(yellowredSpyActive, "count", i * 2); - tryCompare(greenSpyActive, "count", i * 2); - tryCompare(redSpyActive, "count", i * 2 + 1); - tryCompare(yellowSpyActive, "count", i * 2); - } - finalSignal.guard = false; - finalSignal.invoke(); - wait(100); - tryCompare(machine, "running", true); - finalSignal.guard = true; - finalSignal.invoke(); - tryCompare(machine, "running", false); - tryCompare(redSpyActive, "count", i * 2); - } -} diff --git a/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml b/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml deleted file mode 100644 index 34c172aded..0000000000 --- a/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - id: testCase - - property string mystr - property bool mybool - property int myint - - StateMachine { - id: machine - initialState: startState - running: true - State { - id: startState - SignalTransition { - id: signalTrans - signal: testCase.mysignal - onTriggered: { - testCase.mystr = mystr - testCase.mybool = mybool - testCase.myint = myint - } - targetState: finalState - } - } - FinalState { - id: finalState - } - } - - signal mysignal(string mystr, bool mybool, int myint) - - name: "testTriggeredArguments1" - function test_triggeredArguments() - { - tryCompare(startState, "active", true) - - // Emit the signalTrans.signal - testCase.mysignal("test1", true, 2) - compare(testCase.mystr, "test1") - compare(testCase.mybool, true) - compare(testCase.myint, 2) - } -} diff --git a/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml b/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml deleted file mode 100644 index f23cc14152..0000000000 --- a/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtTest 1.1 -import QtQml.StateMachine 1.0 - -TestCase { - id: testCase - - property string mystr - property bool mybool - property int myint - - StateMachine { - id: machine - initialState: startState - running: true - State { - id: startState - SignalTransition { - id: signalTrans - signal: testCase.mysignal - onTriggered: function(strarg, boolarg, intarg) { - testCase.mystr = strarg - testCase.mybool = boolarg - testCase.myint = intarg - } - targetState: finalState - } - } - FinalState { - id: finalState - } - } - - signal mysignal(string mystr, bool mybool, int myint) - - name: "testTriggeredArguments2" - function test_triggeredArguments() - { - tryCompare(startState, "active", true) - - // Emit the signalTrans.signal - testCase.mysignal("test1", true, 2) - compare(testCase.mystr, "test1") - compare(testCase.mybool, true) - compare(testCase.myint, 2) - } -} |