summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-10-20 07:20:16 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-10-20 07:20:16 (GMT)
commit59c9ae81b4911c6458cbe8a5ed78554bdcc82861 (patch)
treeaab941294ccd67c8379f2dfb71ca107236d51f05 /test/src
parent9ba649b087df2bc161759e55549facc2f8f80878 (diff)
downloaduscxml-59c9ae81b4911c6458cbe8a5ed78554bdcc82861.zip
uscxml-59c9ae81b4911c6458cbe8a5ed78554bdcc82861.tar.gz
uscxml-59c9ae81b4911c6458cbe8a5ed78554bdcc82861.tar.bz2
SCXML -> Promela skips intermediate explicit flat SCXML for ridiculous better memory footprint
Diffstat (limited to 'test/src')
-rw-r--r--test/src/test-promela-parser.cpp18
-rw-r--r--test/src/test-w3c.cpp9
2 files changed, 14 insertions, 13 deletions
diff --git a/test/src/test-promela-parser.cpp b/test/src/test-promela-parser.cpp
index 261b8c9..11333f1 100644
--- a/test/src/test-promela-parser.cpp
+++ b/test/src/test-promela-parser.cpp
@@ -4,7 +4,7 @@
#include "uscxml/Interpreter.h"
#include "uscxml/plugins/datamodel/promela/PromelaDataModel.h"
#include "uscxml/plugins/datamodel/promela/PromelaParser.h"
-#include "uscxml/transform/FSMToPromela.h"
+#include "uscxml/transform/ChartToPromela.h"
#include <assert.h>
#include <boost/algorithm/string.hpp>
@@ -21,7 +21,7 @@ void testInlinePromela() {
#promela-inline:\n \
This is foo!\
";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 1 &&
prmInls.customEventSources == 0 &&
@@ -35,7 +35,7 @@ void testInlinePromela() {
{
std::string test = "#promela-progress";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 0 &&
@@ -48,7 +48,7 @@ void testInlinePromela() {
{
std::string test = "#promela-accept and then some";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 1 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 0 &&
@@ -61,7 +61,7 @@ void testInlinePromela() {
{
std::string test = "#promela-end and then some";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 0 &&
@@ -77,7 +77,7 @@ void testInlinePromela() {
#promela-event-source:\n \
This is foo!\
";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 0 &&
@@ -103,7 +103,7 @@ void testInlinePromela() {
This is foo!\n \
This is bar!\n \
";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 0 &&
@@ -134,7 +134,7 @@ void testInlinePromela() {
#promela-event-source-custom:\n \
This is foo!\
";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 1 &&
@@ -153,7 +153,7 @@ void testInlinePromela() {
This is foo! \n\
#promela-progress\
";
- PromelaInlines prmInls = FSMToPromela::getInlinePromela(test);
+ PromelaInlines prmInls = ChartToPromela::getInlinePromela(test);
assert(prmInls.acceptLabels == 0 &&
prmInls.codes == 0 &&
prmInls.customEventSources == 1 &&
diff --git a/test/src/test-w3c.cpp b/test/src/test-w3c.cpp
index 27c69b2..b31eb72 100644
--- a/test/src/test-w3c.cpp
+++ b/test/src/test-w3c.cpp
@@ -5,7 +5,7 @@
#include "uscxml/Factory.h"
#include "uscxml/server/HTTPServer.h"
-#include "uscxml/transform/ChartToFSM.h"
+#include "uscxml/transform/ChartToFlatSCXML.h"
#include <glog/logging.h>
#include <boost/algorithm/string.hpp>
@@ -136,9 +136,10 @@ int main(int argc, char** argv) {
Interpreter interpreter;
LOG(INFO) << "Processing " << documentURI << (withFlattening ? " FSM converted" : "") << (delayFactor ? "" : " with delays *= " + toStr(delayFactor));
if (withFlattening) {
- Interpreter flatInterpreter = Interpreter::fromURI(documentURI);
- interpreter = Interpreter::fromDOM(ChartToFSM::flatten(flatInterpreter).getDocument(), flatInterpreter.getNameSpaceInfo());
- interpreter.setSourceURI(flatInterpreter.getSourceURI());
+ interpreter = Interpreter::fromURI(documentURI);
+ Transformer flattener = ChartToFlatSCXML::transform(interpreter);
+ interpreter = flattener;
+// std::cout << interpreter.getDocument() << std::endl;
} else {
interpreter = Interpreter::fromURI(documentURI);
}