summaryrefslogtreecommitdiffstats
path: root/test/src/test-url.cpp
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2017-01-13 16:47:44 (GMT)
committerStefan Radomski <github@mintwerk.de>2017-01-13 16:47:44 (GMT)
commit4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235 (patch)
tree8c023473bb342780ddf51a893d18369f1319bb5c /test/src/test-url.cpp
parent0aa0fe08dc308c94379c47d0bf9745e341cb4c81 (diff)
downloaduscxml-4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235.zip
uscxml-4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235.tar.gz
uscxml-4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235.tar.bz2
First support for serialization and some bug fixes for DOM per data.src
Diffstat (limited to 'test/src/test-url.cpp')
-rw-r--r--test/src/test-url.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/src/test-url.cpp b/test/src/test-url.cpp
index 51fb545..94d5c91 100644
--- a/test/src/test-url.cpp
+++ b/test/src/test-url.cpp
@@ -153,6 +153,15 @@ void testFileURLs() {
void testData() {
{
+ Data data;
+ std::string key = "//state[@id=\"s0\"]/onentry[1]/send[1]";
+ data[key] = Data("fooo");
+ std::string json = data.asJSON();
+ data = Data::fromJSON(json);
+ assert(data.hasKey(key));
+ }
+
+ {
Data data = Data::fromJSON("{\"shiftKey\":false,\"toElement\":{\"id\":\"\",\"localName\":\"body\"},\"clientY\":38,\"y\":38,\"x\":66,\"ctrlKey\":false,\"relatedTarget\":{\"id\":\"\",\"localName\":\"body\"},\"clientX\":66,\"screenY\":288,\"metaKey\":false,\"offsetX\":58,\"altKey\":false,\"offsetY\":30,\"fromElement\":{\"id\":\"foo\",\"localName\":\"div\"},\"screenX\":-1691,\"dataTransfer\":null,\"button\":0,\"pageY\":38,\"layerY\":38,\"pageX\":66,\"charCode\":0,\"which\":0,\"keyCode\":0,\"detail\":0,\"layerX\":66,\"returnValue\":true,\"timeStamp\":1371223991895,\"eventPhase\":2,\"target\":{\"id\":\"foo\",\"localName\":\"div\"},\"defaultPrevented\":false,\"srcElement\":{\"id\":\"foo\",\"localName\":\"div\"},\"type\":\"mouseout\",\"cancelable\":true,\"currentTarget\":{\"id\":\"foo\",\"localName\":\"div\"},\"bubbles\":true,\"cancelBubble\":false}");
std::cout << data << std::endl;
}
@@ -266,11 +275,11 @@ int main(int argc, char** argv) {
HTTPServer::getInstance(8199, 8200);
try {
- testPaths();
- testFileURLs();
- testHTTPURLs();
+// testPaths();
+// testFileURLs();
+// testHTTPURLs();
testData();
- testServlets();
+// testServlets();
} catch (Event e) {
LOGD(USCXML_ERROR) << e;
exit(EXIT_FAILURE);