summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2016-05-18 11:12:09 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2016-05-20 12:55:38 +0000
commit24ce88ce0df2b49dc91349a8e69e921e9b92c1e7 (patch)
tree8f164e79dd8a6f6effb493e17807ef6c28921875
parentfe4efcdbaca899d3476ba58860c35ce7e174a56c (diff)
Move scxml files into data subfolder, add more tests
Change-Id: I56bcc107c6df43ccc91822cd77b753190125e906 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--tests/auto/parser/data/eventnames.scxml (renamed from tests/auto/parser/eventnames.scxml)0
-rw-r--r--tests/auto/parser/data/ids1.scxml (renamed from tests/auto/parser/ids1.scxml)0
-rw-r--r--tests/auto/parser/data/ids2.scxml (renamed from tests/auto/parser/ids2.scxml)0
-rw-r--r--tests/auto/parser/data/namespaces1.scxml (renamed from tests/auto/parser/namespaces1.scxml)0
-rw-r--r--tests/auto/parser/data/qtmode.scxml (renamed from tests/auto/parser/qtmode.scxml)0
-rw-r--r--tests/auto/parser/data/scxml1.scxml36
-rw-r--r--tests/auto/parser/data/scxml2.scxml33
-rw-r--r--tests/auto/parser/data/test1.scxml (renamed from tests/auto/parser/test1.scxml)0
-rw-r--r--tests/auto/parser/tst_parser.cpp26
-rw-r--r--tests/auto/parser/tst_parser.qrc14
10 files changed, 97 insertions, 12 deletions
diff --git a/tests/auto/parser/eventnames.scxml b/tests/auto/parser/data/eventnames.scxml
index d5e4ff7..d5e4ff7 100644
--- a/tests/auto/parser/eventnames.scxml
+++ b/tests/auto/parser/data/eventnames.scxml
diff --git a/tests/auto/parser/ids1.scxml b/tests/auto/parser/data/ids1.scxml
index 7e8bd15..7e8bd15 100644
--- a/tests/auto/parser/ids1.scxml
+++ b/tests/auto/parser/data/ids1.scxml
diff --git a/tests/auto/parser/ids2.scxml b/tests/auto/parser/data/ids2.scxml
index 228b487..228b487 100644
--- a/tests/auto/parser/ids2.scxml
+++ b/tests/auto/parser/data/ids2.scxml
diff --git a/tests/auto/parser/namespaces1.scxml b/tests/auto/parser/data/namespaces1.scxml
index 551c130..551c130 100644
--- a/tests/auto/parser/namespaces1.scxml
+++ b/tests/auto/parser/data/namespaces1.scxml
diff --git a/tests/auto/parser/qtmode.scxml b/tests/auto/parser/data/qtmode.scxml
index c5df8b0..c5df8b0 100644
--- a/tests/auto/parser/qtmode.scxml
+++ b/tests/auto/parser/data/qtmode.scxml
diff --git a/tests/auto/parser/data/scxml1.scxml b/tests/auto/parser/data/scxml1.scxml
new file mode 100644
index 0000000..9d53420
--- /dev/null
+++ b/tests/auto/parser/data/scxml1.scxml
@@ -0,0 +1,36 @@
+<?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$
+**
+****************************************************************************/
+-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
+ name="scxml" datamodel="foo">
+ <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
+ name="nestedscxml">
+ </scxml>
+</scxml>
diff --git a/tests/auto/parser/data/scxml2.scxml b/tests/auto/parser/data/scxml2.scxml
new file mode 100644
index 0000000..2283afd
--- /dev/null
+++ b/tests/auto/parser/data/scxml2.scxml
@@ -0,0 +1,33 @@
+<?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$
+**
+****************************************************************************/
+-->
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
+ name="scxml" binding="foo">
+</scxml>
diff --git a/tests/auto/parser/test1.scxml b/tests/auto/parser/data/test1.scxml
index 580531f..580531f 100644
--- a/tests/auto/parser/test1.scxml
+++ b/tests/auto/parser/data/test1.scxml
diff --git a/tests/auto/parser/tst_parser.cpp b/tests/auto/parser/tst_parser.cpp
index e00b8b6..4c0e19f 100644
--- a/tests/auto/parser/tst_parser.cpp
+++ b/tests/auto/parser/tst_parser.cpp
@@ -51,21 +51,21 @@ void tst_Parser::error_data()
QVector<QScxmlError> errors;
QString filename;
- filename = QLatin1String(":/tst_parser/test1.scxml");
+ filename = QLatin1String(":/tst_parser/data/test1.scxml");
errors.clear();
errors << QScxmlError(filename, 34, 46,
QLatin1String("unknown state 'b' in target"));
QTest::newRow("test1") << filename << errors;
- filename = QLatin1String(":/tst_parser/namespaces1.scxml");
+ filename = QLatin1String(":/tst_parser/data/namespaces1.scxml");
errors.clear();
QTest::newRow("namespaces 1") << filename << errors;
- filename = QLatin1String(":/tst_parser/ids1.scxml");
+ filename = QLatin1String(":/tst_parser/data/ids1.scxml");
errors.clear();
QTest::newRow("IDs 1") << filename << errors;
- filename = QLatin1String(":/tst_parser/ids2.scxml");
+ filename = QLatin1String(":/tst_parser/data/ids2.scxml");
errors.clear();
errors << QScxmlError(filename, 33, 25,
QLatin1String("state name 'foo.bar' is not a valid C++ identifier in Qt mode"));
@@ -76,7 +76,7 @@ void tst_Parser::error_data()
QTest::newRow("IDs 2") << filename << errors;
- filename = QLatin1String(":/tst_parser/eventnames.scxml");
+ filename = QLatin1String(":/tst_parser/data/eventnames.scxml");
errors.clear();
errors << QScxmlError(filename, 50, 38,
QLatin1String("'.invalid' is not a valid event"));
@@ -90,7 +90,7 @@ void tst_Parser::error_data()
QLatin1String("'in valid' is not a valid event"));
QTest::newRow("eventnames") << filename << errors;
- filename = QString(":/tst_parser/qtmode.scxml");
+ filename = QString(":/tst_parser/data/qtmode.scxml");
errors.clear();
errors << QScxmlError(filename, 35, 31,
QLatin1String("event name 'a' collides with a state name 'a' in Qt mode"));
@@ -107,6 +107,20 @@ void tst_Parser::error_data()
errors << QScxmlError(filename, 45, 28,
QLatin1String("state name 'fooChanged' collides with a state name 'foo' in Qt mode"));
QTest::newRow("qtmode") << filename << errors;
+
+ filename = QString(":/tst_parser/data/scxml1.scxml");
+ errors.clear();
+ errors << QScxmlError(filename, 32, 36,
+ QLatin1String("Unsupported data model 'foo' in scxml"));
+ errors << QScxmlError(filename, 34, 30,
+ QLatin1String("Unexpected element scxml"));
+ QTest::newRow("scxml1") << filename << errors;
+
+ filename = QString(":/tst_parser/data/scxml2.scxml");
+ errors.clear();
+ errors << QScxmlError(filename, 32, 34,
+ QLatin1String("Unsupperted binding type 'foo'"));
+ QTest::newRow("scxml2") << filename << errors;
}
void tst_Parser::error()
diff --git a/tests/auto/parser/tst_parser.qrc b/tests/auto/parser/tst_parser.qrc
index 9073f0d..7323c82 100644
--- a/tests/auto/parser/tst_parser.qrc
+++ b/tests/auto/parser/tst_parser.qrc
@@ -1,10 +1,12 @@
<RCC>
<qresource prefix="/tst_parser">
- <file>test1.scxml</file>
- <file>namespaces1.scxml</file>
- <file>ids1.scxml</file>
- <file>ids2.scxml</file>
- <file>eventnames.scxml</file>
- <file>qtmode.scxml</file>
+ <file>data/eventnames.scxml</file>
+ <file>data/ids1.scxml</file>
+ <file>data/ids2.scxml</file>
+ <file>data/namespaces1.scxml</file>
+ <file>data/qtmode.scxml</file>
+ <file>data/scxml1.scxml</file>
+ <file>data/scxml2.scxml</file>
+ <file>data/test1.scxml</file>
</qresource>
</RCC>