diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-04-01 12:24:23 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-04-04 08:19:26 +0000 |
commit | 06d77c778a1b8f785ec85f05d52e589f02a2d050 (patch) | |
tree | 912c402c33825c58752515c1469ff5e72d9acf3e /tests/auto | |
parent | c88bf0f65be236b47dc620bf154a7b22eb888034 (diff) |
Report a parse error if we didn't manage to create a root element
Subsequent code expects there to be one.
Change-Id: I17cdf1d10144fdd4cfcc9863966f404cdf949dca
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qscxmlc/data/id000005sig11src000000opint8pos1val+0.scxml | bin | 0 -> 7821 bytes | |||
-rw-r--r-- | tests/auto/qscxmlc/data/id000006sig11src000000opext_AOpos1.scxml | 164 | ||||
-rw-r--r-- | tests/auto/qscxmlc/data/id000011sig11src000001opflip1pos2533.scxml | 80 | ||||
-rw-r--r-- | tests/auto/qscxmlc/data/id000019sig11src000001opext_AOpos2940.scxml | 80 | ||||
-rw-r--r-- | tests/auto/qscxmlc/tst_qscxmlc.qrc | 4 |
5 files changed, 328 insertions, 0 deletions
diff --git a/tests/auto/qscxmlc/data/id000005sig11src000000opint8pos1val+0.scxml b/tests/auto/qscxmlc/data/id000005sig11src000000opint8pos1val+0.scxml Binary files differnew file mode 100644 index 0000000..84a6c35 --- /dev/null +++ b/tests/auto/qscxmlc/data/id000005sig11src000000opint8pos1val+0.scxml diff --git a/tests/auto/qscxmlc/data/id000006sig11src000000opext_AOpos1.scxml b/tests/auto/qscxmlc/data/id000006sig11src000000opext_AOpos1.scxml new file mode 100644 index 0000000..d2b0a3b --- /dev/null +++ b/tests/auto/qscxmlc/data/id000006sig11src000000opext_AOpos1.scxml @@ -0,0 +1,164 @@ +<ry>l version="1.0" ?> +<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" + initial="wrapper" datamodel="ecmascript" name="CalculatorStateMachine"> + <datamodel> + <data id="long_expr" /> + <data id="short_expr" /> + <data id="res" /> + </datamodel> + <state id="wrapper" initial="on"> + <state id="on" initial="ready"> + <onentry> + <send event="DISPLAY.UPDATE" /> + </onentry> + <state id="ready" initial="begin"> + <state id="begin"> + <transition event="OPER.MINUS" target="negated1" /> + <onentry> + <assign location="long_expr" expr="''" /> + <assign location="short_expr" expr="0" /> + <assign location="res" expr="0" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + </state> + <state id="result"> + </state> + <transition event="OPER" target="opEntered" /> + <transition event="DIGIT.0" target="zero1"> + <assign location="short_expr" expr="''" /> + </transition> + <transition event="DIGIT" target="int1"> + <assign location="short_expr" expr="''" /> + </transition> + <transition event="POINT" target="frac1"> + <assign location="short_expr" expr="''" /> + </transition> + </state> + <state id="negated1"> + <onentry> + <assign location="short_expr" expr="'-'" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + <transition event="DIGIT.0" target="zero1" /> + <transition event="DIGIT" target="int1" /> + <transition event="POINT" target="frac1" /> + </state> + <state id="operand1"> + <state id="zero1"> + <transition event="DIGIT" cond="_event.name != 'DIGIT.0'" target="int1" /> + <transition event="POINT" target="frac1" /> + </state> + <state id="int1"> + <transition event="POINT" target="frac1" /> + <transition event="DIGIT"> + <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" /> + <send event="DISPLAY.UPDATE" /> + </transition> + <onentry> + <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + </state> + <state id="frac1"> + <onentry> + <assign location="short_expr" expr="short_expr+'.'" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + <transition event="DIGIT"> + <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" /> + <send event="DISPLAY.UPDATE" /> + </transition> + </state> + <transition event="OPER" target="opEntered" /> + </state> + <state id="opEntered"> + <transition event="OPER.MINUS" target="negated2" /> + <transition event="POINT" target="frac2" /> + <transition event="DIGIT.0" target="zero2" /> + <transition event="DIGIT" target="int2" /> + <onentry> + <raise event="CALC.SUB" /> + <send target="#_internal" event="OP.INSERT"> + <param name="operator" expr="_event.name" /> + </send> + </onentry> + </state> + <state id="negated2"> + <onentry> + <assign location="short_expr" expr="'-'" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + <transition event="DIGIT.0" target="zero2" /> + <transition event="DIGIT" target="int2" /> + <transition event="POINT" target="frac2" /> + </state> + <state id="operand2"> + <state id="zero2"> + <transition event="DIGIT" cond="_event.name != 'DIGIT.0'" target="int2" /> + <transition event="POINT" target="frac2" /> + </state> + <state id="int2"> + <transition event="DIGIT"> + <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" /> + <send event="DISPLAY.UPDATE" /> + </transition> + <onentry> + <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + <transition event="POINT" target="frac2" /> + </state> + <state id="frac2"> + <onentry> + <assign location="short_expr" expr="short_expr +'.'" /> + <send event="DISPLAY.UPDATE" /> + </onentry> + <transition event="DIGIT"> + <assign location="short_expr" expr="short_expr +_event.name.substr(_event.name.lastIndexOf('.')+1)" /> + <send event="DISPLAY.UPDATE" /> + </transition> + </state> + <transition event="OPER" target="opEntered"> + <raise event="CALC.SUB" /> + <raise event="OP.INSERT" /> + </transition> + <transition event="EQUALS" target="result"> + <raise event="CALC.SUB" /> + <raise event="CALC.DO" /> + </transition> + </state> + <transition event="C" target="on" /> + </state> + <transition event="CALC.DO"> + <assign location="short_expr" expr="''+ res" /> + <assign location="long_expr" expr="''" /> + <assign location="res" expr="0" /> + </transition> + <transition event="CALC.SUB"> + <if cond="short_expr!=''"> + <assign location="long_expr" expr="long_expr+'('+short_expr+')'" /> + </if> + <assign location="res" expr="eval(long_expr)" /> + <assign location="short_expr" expr="''" /> + <send event="DISPLAY.UPDATE" /> + </transition> + <transition event="DISPLAY.UPDATE"> + <log label="'result'" expr="short_expr==''?res:short_expr" /> + <send type="qt:signal" event="updateDisplay"> + <param name="display" expr="short_expr==''?res:short_expr"/> + </send> + </transition> + <transition event="OP.INSERT"> + <log expr="_event.data.operator" /> + <if cond="_event.data.operator == 'OPER.PLUS'"> + <assign location="long_expr" expr="long_expr+'+'" /> + <elseif cond="_event.data.operator=='OPER.MINUS'" /> + <assign location="long_expr" expr="long_expr+'-'" /> + <elseif cond="_event.data.operator=='OPER.STAR'" /> + <assign location="long_expr" expr="long_expr+'*'" /> + <elseif cond="_event.data.operator=='OPER.DIV'" /> + <assign location="long_expr" expr="long_expr+'/'" /> + </if> + </transition> + </state> +</scxml> diff --git a/tests/auto/qscxmlc/data/id000011sig11src000001opflip1pos2533.scxml b/tests/auto/qscxmlc/data/id000011sig11src000001opflip1pos2533.scxml new file mode 100644 index 0000000..73e0138 --- /dev/null +++ b/tests/auto/qscxmlc/data/id000011sig11src000001opflip1pos2533.scxml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/**************************************************************************** +** +** 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:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<!-- enable-qt-mode: yes m-> +<scxml + xmlns="http://www.w3.org/2005/07/scxml" + version="1.0" + name="Directions" + initial="anyplace" +> + <state id="anyplace"> + <transition event="goNowhere" target="nowhere"/> + <transition event="goSomewhere" target="somewhere"/> + + <state id="nowhere"/> + <state id="somewhere"> + <invoke type="http://www.w3.org/TR/scxml/"> + <content> + <scxml name="anywhere" version="1.0"> + <state id="here"> + <transition event="goThere" target="there"/> + </state> + <state id="there"> + <transition event="goHere" target="here"/> + </state> + </scxml> + </content> + </invoke> + </state> + </state> +</scxml> diff --git a/tests/auto/qscxmlc/data/id000019sig11src000001opext_AOpos2940.scxml b/tests/auto/qscxmlc/data/id000019sig11src000001opext_AOpos2940.scxml new file mode 100644 index 0000000..ce56def --- /dev/null +++ b/tests/auto/qscxmlc/data/id000019sig11src000001opext_AOpos2940.scxml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/**************************************************************************** +** +** 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:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<!-- enable-qt-mode: yes --> +<scxml + xmlns="http://www.w3.org/2005/07/scxml" + version="1.0" + name="Directions" + initial="anyplace" +> + <state id="anyplace"> + <transition event="goNowhere" target="nowhere"/> + <transition event="goSomewhere" target="somewhere"/> + + <state id="nowhere"/> + <state id="somewhere"> + <invoke type="http://www.w3.org/TR/scxml/"> + <content> +<!-- <scxml name="anywhere" version="1.0"> + <state id="here"> + <transition event="goThere" target="there"/> + </state> + <state id="there"> + <transition event="goHere" target="here"/> + </state> + </scxml> + </content> + </invoke> + </state> + </state> +</scxml> diff --git a/tests/auto/qscxmlc/tst_qscxmlc.qrc b/tests/auto/qscxmlc/tst_qscxmlc.qrc index 8f9abda..d85ac84 100644 --- a/tests/auto/qscxmlc/tst_qscxmlc.qrc +++ b/tests/auto/qscxmlc/tst_qscxmlc.qrc @@ -6,10 +6,13 @@ <file>data/id000002sig11src000000opflip1pos7244.scxml</file> <file>data/id000003sig11src000000opflip1pos7442.scxml</file> <file>data/id000004sig06src000000opflip4pos7335.scxml</file> + <file>data/id000005sig11src000000opint8pos1val+0.scxml</file> + <file>data/id000006sig11src000000opext_AOpos1.scxml</file> <file>data/id000007sig11src000000ophavocrep8.scxml</file> <file>data/id000008sig11src000000ophavocrep4.scxml</file> <file>data/id000009sig11src000000ophavocrep2.scxml</file> <file>data/id000010sig11src000000ophavocrep1.scxml</file> + <file>data/id000011sig11src000001opflip1pos2533.scxml</file> <file>data/id000012sig06src000001opflip1pos2538.scxml</file> <file>data/id000013sig11src000001opflip1pos2914.scxml</file> <file>data/id000014sig11src000001opflip1pos2914.scxml</file> @@ -17,6 +20,7 @@ <file>data/id000016sig06src000001opflip1pos2961.scxml</file> <file>data/id000017sig11src000001opext_AOpos2931.scxml</file> <file>data/id000018sig06src000001opext_AOpos2939.scxml</file> + <file>data/id000019sig11src000001opext_AOpos2940.scxml</file> <file>data/id000020sig11src000001ophavocrep8.scxml</file> <file>data/id000021sig11src000001ophavocrep8.scxml</file> <file>data/id000022sig11src000001ophavocrep4.scxml</file> |