summaryrefslogtreecommitdiffstats
path: root/tests/auto/parser
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-09-03 10:35:09 +0200
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-09-03 11:53:59 +0300
commit20b42f3469b8fefa90b2541ddf448568071f6441 (patch)
treed7a7f785c54d6a8f74f20237593d4233e1fdfc66 /tests/auto/parser
parentf88ca156bfdf4c944515f417ce729262501c8e9e (diff)
Ignore tags in unknown namespaces.
Change-Id: I4b48ccb7bb0cacdb53e845e4316e016b182a0164 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tests/auto/parser')
-rw-r--r--tests/auto/parser/namespaces1.scxml12
-rw-r--r--tests/auto/parser/tst_parser.cpp11
-rw-r--r--tests/auto/parser/tst_parser.qrc1
3 files changed, 21 insertions, 3 deletions
diff --git a/tests/auto/parser/namespaces1.scxml b/tests/auto/parser/namespaces1.scxml
new file mode 100644
index 0000000..ffbf57d
--- /dev/null
+++ b/tests/auto/parser/namespaces1.scxml
@@ -0,0 +1,12 @@
+<?xml version="1.0" ?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="namespaces1" binding="early"
+ xmlns:qt="http://www.qt.io/2015/02/scxml-ext" qt:editorversion="1.2.3" initial="State_1">
+ <qt:editorinfo initialGeometry="135;83;-20;-20;40;40"/>
+ <state id="State_1">
+ <qt:editorinfo geometry="134;218;-60;-50;122;100" scenegeometry="134;218;74;168;122;100"/>
+ <transition type="external" event="Transition_2" target="State_2">
+ <qt:editorinfo movePoint="-26;0"/>
+ </transition>
+ </state>
+ <state id="State_2"/>
+</scxml>
diff --git a/tests/auto/parser/tst_parser.cpp b/tests/auto/parser/tst_parser.cpp
index b22d4e0..f0d6db4 100644
--- a/tests/auto/parser/tst_parser.cpp
+++ b/tests/auto/parser/tst_parser.cpp
@@ -52,19 +52,24 @@ void tst_Parser::error_data()
QTest::addColumn<QString>("scxmlFileName");
QTest::addColumn<QVector<Scxml::ScxmlError> >("expectedErrors");
- QVector<Scxml::ScxmlError> errors;
+ QVector<ScxmlError> errors;
errors << ScxmlError(QString(":/tst_parser/test1.scxml"), 5, 46, QString("unknown state 'b' in target"));
QTest::newRow("test1") << QString(":/tst_parser/test1.scxml") << errors;
+
+ QTest::newRow("namespaces 1") << QStringLiteral(":/tst_parser/namespaces1.scxml") << QVector<ScxmlError>();
}
void tst_Parser::error()
{
QFETCH(QString, scxmlFileName);
- QFETCH(QVector<Scxml::ScxmlError>, expectedErrors);
+ QFETCH(QVector<ScxmlError>, expectedErrors);
StateMachine *stateMachine = StateMachine::fromFile(scxmlFileName);
- QVector<Scxml::ScxmlError> errors = stateMachine->errors();
+ QVector<ScxmlError> errors = stateMachine->errors();
+ if (errors.count() != expectedErrors.count()) {
+ qDebug()<<errors;
+ }
QCOMPARE(errors.count(), expectedErrors.count());
for (int i = 0; i < errors.count(); ++i) {
diff --git a/tests/auto/parser/tst_parser.qrc b/tests/auto/parser/tst_parser.qrc
index d78f7bc..d7c6124 100644
--- a/tests/auto/parser/tst_parser.qrc
+++ b/tests/auto/parser/tst_parser.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/tst_parser">
<file>test1.scxml</file>
+ <file>namespaces1.scxml</file>
</qresource>
</RCC>