summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-05-17 14:13:25 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-07-11 08:40:45 +0000
commit55169920b69378d61da3cc9dc60e0b583f47909c (patch)
tree882946bc5466ffcf7975af8f59a95c348c89b817 /tests
parent19f9a584ea7d93110a3d43605db299ffc482998b (diff)
Add a test for non-ascii event names
Change-Id: I65395b71879b1ae3b96b7bb7b7cb2633c0ca7568 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/compiled/eventnames1.scxml5
-rw-r--r--tests/auto/compiled/tst_compiled.cpp16
-rw-r--r--tests/auto/dynamicmetaobject/test1.scxml1
3 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/compiled/eventnames1.scxml b/tests/auto/compiled/eventnames1.scxml
index 150f6c0..475b1b0 100644
--- a/tests/auto/compiled/eventnames1.scxml
+++ b/tests/auto/compiled/eventnames1.scxml
@@ -28,7 +28,7 @@
**
****************************************************************************/
-->
-<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="eventnames1">
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="eventnames1" initial="a">
<state id="a">
<onentry>
<send event="valid"/>
@@ -42,5 +42,8 @@
<transition event="-valid-"/>
<transition event="also valid"/>
<transition event="&#x00ff;valid"/>
+ <transition event="näl" target="b"/>
+ </state>
+ <state id="b">
</state>
</scxml>
diff --git a/tests/auto/compiled/tst_compiled.cpp b/tests/auto/compiled/tst_compiled.cpp
index c6ee894..096e347 100644
--- a/tests/auto/compiled/tst_compiled.cpp
+++ b/tests/auto/compiled/tst_compiled.cpp
@@ -35,6 +35,7 @@
#include "statemachineunicodename.h"
#include "datainnulldatamodel.h"
#include "submachineunicodename.h"
+#include "eventnames1.h"
Q_DECLARE_METATYPE(QScxmlError);
@@ -48,6 +49,7 @@ private Q_SLOTS:
void stateNames();
void nullDataInit();
void subMachineUnicodeName();
+ void unicodeEventName();
};
void tst_Compiled::stateNames()
@@ -101,6 +103,20 @@ void tst_Compiled::subMachineUnicodeName()
QVERIFY(prop.isValid());
}
+void tst_Compiled::unicodeEventName()
+{
+ eventnames1 names;
+ QSignalSpy stableStateSpy(&names, SIGNAL(reachedStableState()));
+ names.start();
+
+ stableStateSpy.wait(5000);
+
+ QCOMPARE(names.activeStateNames(), QStringList(QLatin1String("a")));
+ names.submitEvent("näl");
+ stableStateSpy.wait(5000);
+ QCOMPARE(names.activeStateNames(), QStringList(QLatin1String("b")));
+}
+
QTEST_MAIN(tst_Compiled)
#include "tst_compiled.moc"
diff --git a/tests/auto/dynamicmetaobject/test1.scxml b/tests/auto/dynamicmetaobject/test1.scxml
index 72fd592..531b1d5 100644
--- a/tests/auto/dynamicmetaobject/test1.scxml
+++ b/tests/auto/dynamicmetaobject/test1.scxml
@@ -32,6 +32,7 @@
name="test1" datamodel="ecmascript">
<state id="a">
<transition event="foo"/>
+ <transition event="näl" target="b"/>
</state>
<state id="b">
<transition event="foo"/>