diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-01 12:55:04 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-01 12:55:04 (GMT) |
commit | 3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253 (patch) | |
tree | 41f234c33e1e04015ef92a6b94212d9c7e97ad72 /test | |
parent | 720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da (diff) | |
download | uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.zip uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.tar.gz uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.tar.bz2 |
Bug fixes and version bump
- New calendar invoker
- Fixed memory leaks with JavaScriptCore
- Compiles on windows again
- Beautified source code indentation
Diffstat (limited to 'test')
-rw-r--r-- | test/samples/uscxml/test-calendar.scxml | 93 | ||||
-rw-r--r-- | test/src/test-arabica-parsing.cpp | 6 | ||||
-rw-r--r-- | test/src/test-datamodel.cpp | 4 |
3 files changed, 98 insertions, 5 deletions
diff --git a/test/samples/uscxml/test-calendar.scxml b/test/samples/uscxml/test-calendar.scxml new file mode 100644 index 0000000..a031d55 --- /dev/null +++ b/test/samples/uscxml/test-calendar.scxml @@ -0,0 +1,93 @@ +<scxml datamodel="ecmascript"> + <script> +<![CDATA[ + function dump(object, level) { + if (!level) level = 0; + + var padding = ""; + for (var j=0;j < level+1;j++) padding += " "; + + if (typeof(object) == 'object') { + for (var item in object) { + var value = object[item]; + + if(typeof(value) == 'object') { + print (padding + "'" + item + "' ...\n"); + dump (value, level+1); + } else { + print (padding + "'" + item + "' => \"" + value + "\"\n"); + } + } + } else { + print("===> " + object + " <===(" + typeof(object) + ")"); + } + } +]]> + </script> + <state id="start"> + <state id="idle"> + <onentry> + <!-- raise event="event.ended" /--> + </onentry> + <invoke type="calendar"> + <content> +<![CDATA[ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//Apple Inc.//Mac OS X 10.8.4//EN +CALSCALE:GREGORIAN +BEGIN:VTIMEZONE +TZID:Europe/Berlin +BEGIN:DAYLIGHT +TZOFFSETFROM:+0100 +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU +DTSTART:19810329T020000 +TZNAME:GMT+02:00 +TZOFFSETTO:+0200 +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0200 +RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU +DTSTART:19961027T030000 +TZNAME:GMT+01:00 +TZOFFSETTO:+0100 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +CREATED:20130731T084837Z +UID:8460B9DC-0BC2-4E68-A651-9126B56EB589 +DTEND;TZID=Europe/Berlin:20130731T130000 +RRULE:FREQ=DAILY;INTERVAL=3;UNTIL=20140801T215959Z +RRULE:FREQ=DAILY;INTERVAL=2;UNTIL=20140801T215959Z +TRANSP:OPAQUE +SUMMARY:Foo +DTSTART;TZID=Europe/Berlin:20130731T113000 +DTSTAMP:20130731T084927Z +LOCATION:Here +SEQUENCE:7 +BEGIN:VALARM +X-WR-ALARMUID:30E20441-5AD0-4512-BF2B-CAC1B78871F4 +UID:30E20441-5AD0-4512-BF2B-CAC1B78871F4 +TRIGGER;VALUE=DATE-TIME:19760401T005545Z +X-APPLE-DEFAULT-ALARM:TRUE +ACTION:NONE +END:VALARM +BEGIN:VALARM +X-WR-ALARMUID:EC19CFB0-BE02-43B9-930F-5D318FFFDCB7 +UID:EC19CFB0-BE02-43B9-930F-5D318FFFDCB7 +TRIGGER:-PT15M +DESCRIPTION:Event notification +ACTION:DISPLAY +END:VALARM +END:VEVENT +END:VCALENDAR +]]> + </content> + <finalize> + <script>dump(_event);</script> + </finalize> + </invoke> + </state> + <transition event="event.ended" target="idle" /> + </state> +</scxml>
\ No newline at end of file diff --git a/test/src/test-arabica-parsing.cpp b/test/src/test-arabica-parsing.cpp index 2a09dd6..24c58ae 100644 --- a/test/src/test-arabica-parsing.cpp +++ b/test/src/test-arabica-parsing.cpp @@ -22,7 +22,7 @@ int main(int argc, char** argv) { Arabica::SAX2DOM::Parser<std::string> domParser; Arabica::SAX::CatchErrorHandler<std::string> errorHandler; domParser.setErrorHandler(errorHandler); - + if(!domParser.parse(inputSource)) { std::cout << errorHandler.errors(); return -1; @@ -33,11 +33,11 @@ int main(int argc, char** argv) { { Arabica::SAX::InputSource<std::string> inputSource; inputSource.setSystemId("/Users/sradomski/Documents/TK/Code/uscxml/test/samples/uscxml/arabica/test-arabica-parsing.xml"); - + Arabica::SAX2DOM::Parser<std::string> domParser; Arabica::SAX::CatchErrorHandler<std::string> errorHandler; domParser.setErrorHandler(errorHandler); - + if(!domParser.parse(inputSource)) { std::cout << errorHandler.errors(); return -1; diff --git a/test/src/test-datamodel.cpp b/test/src/test-datamodel.cpp index 77f0851..b0ed107 100644 --- a/test/src/test-datamodel.cpp +++ b/test/src/test-datamodel.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) { WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); #endif - + DataModel dm(Factory::getInstance()->createDataModel("ecmascript", NULL)); dm.evalAsString("var foo = 12"); @@ -61,7 +61,7 @@ int main(int argc, char** argv) { std::cout << content << std::endl; assert(boost::equals(content, "${bar}")); } - + { std::string content = "There are ${bar} monkeys! Really ${foo} monkeys!"; int rplc = dm.replaceExpressions(content); |