summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2016-08-22 16:04:11 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2016-08-23 08:12:10 +0000
commit78693ba8b671134e058b799005b8f5dd4f3fc1b3 (patch)
tree18e42427ae7dee3d5e8076e57f7514d02b13cc28 /tests
parent7baaedf871739beb584c0a0cd7e0af72310a58c4 (diff)
Get rid of qt mode
Change-Id: Id8cc29a9a27f571f063b1cec51e534a3c762f2c6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/compiled/anonymousstate.scxml1
-rw-r--r--tests/auto/compiled/eventnames2.scxml1
-rw-r--r--tests/auto/compiled/submachineunicodename.scxml1
-rw-r--r--tests/auto/dynamicmetaobject/mediaplayer.scxml5
-rw-r--r--tests/auto/dynamicmetaobject/tst_dynamicmetaobject.cpp46
-rw-r--r--tests/auto/parser/data/ids2.scxml1
-rw-r--r--tests/auto/parser/data/ids2.scxml.errors4
-rw-r--r--tests/auto/parser/data/invalidRoot3.scxml1
-rw-r--r--tests/auto/parser/data/invalidRoot3.scxml.errors5
-rw-r--r--tests/auto/parser/data/qtmode.scxml46
-rw-r--r--tests/auto/parser/data/qtmode.scxml.errors9
-rw-r--r--tests/auto/parser/tst_parser.qrc2
12 files changed, 12 insertions, 110 deletions
diff --git a/tests/auto/compiled/anonymousstate.scxml b/tests/auto/compiled/anonymousstate.scxml
index 016b339..60adfb0 100644
--- a/tests/auto/compiled/anonymousstate.scxml
+++ b/tests/auto/compiled/anonymousstate.scxml
@@ -1,5 +1,4 @@
<?xml version="1.0" ?>
-<!-- enable-qt-mode: no -->
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
name="Pinball2" datamodel="ecmascript">
<state>
diff --git a/tests/auto/compiled/eventnames2.scxml b/tests/auto/compiled/eventnames2.scxml
index ee5448f..49a5e98 100644
--- a/tests/auto/compiled/eventnames2.scxml
+++ b/tests/auto/compiled/eventnames2.scxml
@@ -28,7 +28,6 @@
**
****************************************************************************/
-->
-<!-- enable-qt-mode: no -->
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="eventnames2">
<state id="a">
<onentry>
diff --git a/tests/auto/compiled/submachineunicodename.scxml b/tests/auto/compiled/submachineunicodename.scxml
index b62e751..9cee0e3 100644
--- a/tests/auto/compiled/submachineunicodename.scxml
+++ b/tests/auto/compiled/submachineunicodename.scxml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- enable-qt-mode: yes -->
<scxml
xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
diff --git a/tests/auto/dynamicmetaobject/mediaplayer.scxml b/tests/auto/dynamicmetaobject/mediaplayer.scxml
index 025245a..ca68039 100644
--- a/tests/auto/dynamicmetaobject/mediaplayer.scxml
+++ b/tests/auto/dynamicmetaobject/mediaplayer.scxml
@@ -50,7 +50,6 @@
**
****************************************************************************/
-->
-<!-- enable-qt-mode: yes -->
<scxml
xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
@@ -76,13 +75,13 @@
<state id="playing">
<onentry>
<assign location="media" expr="_event.data.media"/>
- <send type="qt:signal" event="playbackStarted">
+ <send event="playbackStarted">
<param name="media" expr="media"/>
</send>
</onentry>
<onexit>
- <send type="qt:signal" event="playbackStopped">
+ <send event="playbackStopped">
<param name="media" expr="media"/>
</send>
</onexit>
diff --git a/tests/auto/dynamicmetaobject/tst_dynamicmetaobject.cpp b/tests/auto/dynamicmetaobject/tst_dynamicmetaobject.cpp
index 7610dd7..83fceeb 100644
--- a/tests/auto/dynamicmetaobject/tst_dynamicmetaobject.cpp
+++ b/tests/auto/dynamicmetaobject/tst_dynamicmetaobject.cpp
@@ -44,41 +44,28 @@ void tst_DynamicMetaObject::dynamicPartCheck_data()
{
QTest::addColumn<QString>("scxmlFileName");
QTest::addColumn<QStringList>("expectedProperties");
- QTest::addColumn<QStringList>("expectedMethods");
QTest::addColumn<QStringList>("expectedSignals");
- QTest::addColumn<QStringList>("expectedSlots");
{ // test1.scxml
const QStringList expectedProperties = { QLatin1String("a"), QLatin1String("b") };
- const QStringList expectedMethods = { };
const QStringList expectedSignals = { QLatin1String("aChanged(bool)"),
QLatin1String("bChanged(bool)") };
- const QStringList expectedSlots = { };
QTest::newRow("test1") << QString(":/tst_dynamicmetaobject/test1.scxml")
<< expectedProperties
- << expectedMethods
- << expectedSignals
- << expectedSlots;
+ << expectedSignals;
}
{ // mediaplayer.scxml
const QStringList expectedProperties = { QLatin1String("stopped"), QLatin1String("playing") };
- const QStringList expectedMethods = { };
const QStringList expectedSignals = { QLatin1String("stoppedChanged(bool)"),
- QLatin1String("playingChanged(bool)"),
- QLatin1String("playbackStarted(QVariant)"),
- QLatin1String("playbackStopped(QVariant)") };
- const QStringList expectedSlots = { QLatin1String("tap()"),
- QLatin1String("tap(QVariant)") };
+ QLatin1String("playingChanged(bool)") };
QTest::newRow("mediaplayer") << QString(":/tst_dynamicmetaobject/mediaplayer.scxml")
<< expectedProperties
- << expectedMethods
- << expectedSignals
- << expectedSlots;
+ << expectedSignals;
}
}
@@ -86,9 +73,7 @@ void tst_DynamicMetaObject::dynamicPartCheck()
{
QFETCH(QString, scxmlFileName);
QFETCH(QStringList, expectedProperties);
- QFETCH(QStringList, expectedMethods);
QFETCH(QStringList, expectedSignals);
- QFETCH(QStringList, expectedSlots);
QScopedPointer<QScxmlStateMachine> stateMachine(QScxmlStateMachine::fromFile(scxmlFileName));
QVERIFY(!stateMachine.isNull());
@@ -98,42 +83,25 @@ void tst_DynamicMetaObject::dynamicPartCheck()
QStringList dynamicProperties;
for (int i = metaObject->propertyOffset(); i < metaObject->propertyCount(); i++) {
- QMetaProperty metaProperty = metaObject->property(i);
+ const QMetaProperty metaProperty = metaObject->property(i);
dynamicProperties << metaProperty.name();
}
- QStringList dynamicMethods, dynamicSignals, dynamicSlots;
+ QStringList dynamicSignals;
for (int i = metaObject->methodOffset(); i < metaObject->methodCount(); i++) {
- QMetaMethod metaMethod = metaObject->method(i);
- switch (metaMethod.methodType()) {
- case QMetaMethod::Method:
- dynamicMethods << metaMethod.methodSignature();
- break;
- case QMetaMethod::Signal:
+ const QMetaMethod metaMethod = metaObject->method(i);
+ if (metaMethod.methodType() == QMetaMethod::Signal)
dynamicSignals << metaMethod.methodSignature();
- break;
- case QMetaMethod::Slot:
- dynamicSlots << metaMethod.methodSignature();
- break;
- default:
- break;
- }
}
// TODO: remove sorting when we drop QSet internally
expectedProperties.sort();
- expectedMethods.sort();
expectedSignals.sort();
- expectedSlots.sort();
dynamicProperties.sort();
- dynamicMethods.sort();
dynamicSignals.sort();
- dynamicSlots.sort();
QCOMPARE(dynamicProperties, expectedProperties);
- QCOMPARE(dynamicMethods, expectedMethods);
QCOMPARE(dynamicSignals, expectedSignals);
- QCOMPARE(dynamicSlots, expectedSlots);
}
QTEST_MAIN(tst_DynamicMetaObject)
diff --git a/tests/auto/parser/data/ids2.scxml b/tests/auto/parser/data/ids2.scxml
index 228b487..5378fcb 100644
--- a/tests/auto/parser/data/ids2.scxml
+++ b/tests/auto/parser/data/ids2.scxml
@@ -28,7 +28,6 @@
**
****************************************************************************/
-->
-<!-- enable-qt-mode: yes -->
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="ids2">
<state id="foo.bar"/>
<state id="foo-bar"/>
diff --git a/tests/auto/parser/data/ids2.scxml.errors b/tests/auto/parser/data/ids2.scxml.errors
index 31d8e7c..3ca729e 100644
--- a/tests/auto/parser/data/ids2.scxml.errors
+++ b/tests/auto/parser/data/ids2.scxml.errors
@@ -1,3 +1 @@
-:/tst_parser/data/ids2.scxml:33:25: error: state name 'foo.bar' is not a valid C++ identifier in Qt mode
-:/tst_parser/data/ids2.scxml:34:25: error: state name 'foo-bar' is not a valid C++ identifier in Qt mode
-:/tst_parser/data/ids2.scxml:36:19: error: '1' is not a valid XML ID
+:/tst_parser/data/ids2.scxml:35:19: error: '1' is not a valid XML ID
diff --git a/tests/auto/parser/data/invalidRoot3.scxml b/tests/auto/parser/data/invalidRoot3.scxml
index e968b20..62dab58 100644
--- a/tests/auto/parser/data/invalidRoot3.scxml
+++ b/tests/auto/parser/data/invalidRoot3.scxml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- enable-qt-mode: yeq -->
<scxma
xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
diff --git a/tests/auto/parser/data/invalidRoot3.scxml.errors b/tests/auto/parser/data/invalidRoot3.scxml.errors
index e61f590..dd1cf6c 100644
--- a/tests/auto/parser/data/invalidRoot3.scxml.errors
+++ b/tests/auto/parser/data/invalidRoot3.scxml.errors
@@ -1,3 +1,2 @@
-:/tst_parser/data/invalidRoot3.scxml:2:28: error: expected 'yes' or 'no' after enable-qt-mode in comment
-:/tst_parser/data/invalidRoot3.scxml:6:1: error: Unknown element scxma
-:/tst_parser/data/invalidRoot3.scxml:9:8: error: Missing root element
+:/tst_parser/data/invalidRoot3.scxml:5:1: error: Unknown element scxma
+:/tst_parser/data/invalidRoot3.scxml:8:8: error: Missing root element
diff --git a/tests/auto/parser/data/qtmode.scxml b/tests/auto/parser/data/qtmode.scxml
deleted file mode 100644
index c5df8b0..0000000
--- a/tests/auto/parser/data/qtmode.scxml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" ?>
-<!--
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtScxml 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$
-**
-****************************************************************************/
--->
-<!-- enable-qt-mode: yes -->
-<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
- name="test1">
- <state id="a">
- <transition event="a"/>
- <transition event="void"/>
- <transition event="aChanged"/>
- <transition event="finished"/>
- <transition event="done.state.a"/>
- <transition event="done.state.double"/>
- </state>
- <state id="int"/>
- <state id="objectName"/>
- <state id="foo"/>
- <state id="fooChanged"/>
-</scxml>
diff --git a/tests/auto/parser/data/qtmode.scxml.errors b/tests/auto/parser/data/qtmode.scxml.errors
deleted file mode 100644
index ae365b9..0000000
--- a/tests/auto/parser/data/qtmode.scxml.errors
+++ /dev/null
@@ -1,9 +0,0 @@
-:/tst_parser/data/qtmode.scxml:35:31: error: event name 'a' collides with a state name 'a' in Qt mode
-:/tst_parser/data/qtmode.scxml:36:34: error: event name 'void' is not a valid C++ identifier in Qt mode
-:/tst_parser/data/qtmode.scxml:37:38: error: event name 'aChanged' collides with a state name 'a' in Qt mode
-:/tst_parser/data/qtmode.scxml:38:38: error: event name 'finished' is not a valid Qt identifier in Qt mode
-:/tst_parser/data/qtmode.scxml:39:42: error: event name 'done.state.a' is not a valid C++ identifier in Qt mode
-:/tst_parser/data/qtmode.scxml:40:47: error: event name 'done.state.double' is not a valid C++ identifier in Qt mode
-:/tst_parser/data/qtmode.scxml:42:21: error: state name 'int' is not a valid C++ identifier in Qt mode
-:/tst_parser/data/qtmode.scxml:43:28: error: state name 'objectName' is not a valid Qt identifier in Qt mode
-:/tst_parser/data/qtmode.scxml:45:28: error: state name 'fooChanged' collides with a state name 'foo' in Qt mode
diff --git a/tests/auto/parser/tst_parser.qrc b/tests/auto/parser/tst_parser.qrc
index 0c5f56b..8d133d2 100644
--- a/tests/auto/parser/tst_parser.qrc
+++ b/tests/auto/parser/tst_parser.qrc
@@ -48,8 +48,6 @@
<file>data/prematureEndOfDocument1.scxml</file>
<file>data/prematureEndOfDocument2.scxml.errors</file>
<file>data/prematureEndOfDocument2.scxml</file>
- <file>data/qtmode.scxml.errors</file>
- <file>data/qtmode.scxml</file>
<file>data/scxml1.scxml.errors</file>
<file>data/scxml1.scxml</file>
<file>data/scxml2.scxml.errors</file>