diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-05-26 10:36:49 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-05-26 10:36:49 (GMT) |
commit | 6e13c7b6e0888323223afd5d2e36e86243df57af (patch) | |
tree | f558fd45fa499c8bc95041554ecad6be1bf788c1 /test/src | |
parent | f6714b1484b641ea61053350b7d156d2da760b8b (diff) | |
download | uscxml-6e13c7b6e0888323223afd5d2e36e86243df57af.zip uscxml-6e13c7b6e0888323223afd5d2e36e86243df57af.tar.gz uscxml-6e13c7b6e0888323223afd5d2e36e86243df57af.tar.bz2 |
Minor polishing for Java bindings and first draft of JEXL datamodel
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/test-bindings.cpp | 11 | ||||
-rw-r--r-- | test/src/test-snippets.cpp | 35 | ||||
-rw-r--r-- | test/src/test-validating.cpp | 16 |
3 files changed, 54 insertions, 8 deletions
diff --git a/test/src/test-bindings.cpp b/test/src/test-bindings.cpp new file mode 100644 index 0000000..6932f67 --- /dev/null +++ b/test/src/test-bindings.cpp @@ -0,0 +1,11 @@ +/* make sure they compile! */ +#include "bindings/swig/wrapped/WrappedDataModel.h" +#include "bindings/swig/wrapped/WrappedExecutableContent.h" +#include "bindings/swig/wrapped/WrappedInterpreterMonitor.h" +#include "bindings/swig/wrapped/WrappedInvoker.h" +#include "bindings/swig/wrapped/WrappedIOProcessor.h" + + +int main() { + return 0; +}
\ No newline at end of file diff --git a/test/src/test-snippets.cpp b/test/src/test-snippets.cpp new file mode 100644 index 0000000..a9625b1 --- /dev/null +++ b/test/src/test-snippets.cpp @@ -0,0 +1,35 @@ +/** + * This file contains all the snippets in the doxygen documentation. + * + * It is not actually a test as such, but makes sure that the snippets will + * actually compile and do what we claim they do. + */ + +#include "uscxml/config.h" +#include "uscxml/Interpreter.h" + +using namespace uscxml; + +void microstep_snippet() { + + Interpreter scxml = Interpreter::fromURL("https://raw.githubusercontent.com/tklab-tud/uscxml/master/test/w3c/null/test436.scxml"); + +//! [Performing a microstep] + InterpreterState state = uscxml::USCXML_UNDEF; + while((state = scxml.step()) != uscxml::USCXML_FINISHED) { + switch (state) { + case USCXML_MICROSTEPPED: + case USCXML_MACROSTEPPED: + /* Interpreter performed a microstep */ + break; + default: + break; + } + } +//! [Performing a microstep] + +} + +int main(int argc, char** argv) { + microstep_snippet(); +}
\ No newline at end of file diff --git a/test/src/test-validating.cpp b/test/src/test-validating.cpp index 3f7d0f9..840a105 100644 --- a/test/src/test-validating.cpp +++ b/test/src/test-validating.cpp @@ -46,7 +46,7 @@ int main(int argc, char** argv) { if (Factory::getInstance()->hasDataModel("ecmascript")) { // Potential endless loop - + const char* xml = "<scxml datamodel=\"ecmascript\">" " <datamodel><data id=\"counter\" expr=\"5\" /></datamodel>" @@ -677,7 +677,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 1); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error in script const char* xml = @@ -692,7 +692,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 1); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error in cond attribute const char* xml = @@ -714,7 +714,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 3); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error in expr attribute const char* xml = @@ -745,7 +745,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 5); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error with foreach const char* xml = @@ -763,7 +763,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 1); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error with send const char* xml = @@ -780,7 +780,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 1); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error with invoke const char* xml = @@ -795,7 +795,7 @@ int main(int argc, char** argv) { assert(issueLocations.size() == 1); } - if (Factory::getInstance()->hasDataModel("ecmascript")) { + if (Factory::getInstance()->hasDataModel("ecmascript")) { // Syntax error with cancel const char* xml = |