diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-06 16:04:18 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-07-06 16:04:18 (GMT) |
commit | 9cc762d85afffea42de3e1d156a6b8838d88a00c (patch) | |
tree | bff170c0493759c7f1bffca2648960b6f43ca139 /test/src | |
parent | be98a8297b4e10e169290f497e649e803e43d791 (diff) | |
download | uscxml-9cc762d85afffea42de3e1d156a6b8838d88a00c.zip uscxml-9cc762d85afffea42de3e1d156a6b8838d88a00c.tar.gz uscxml-9cc762d85afffea42de3e1d156a6b8838d88a00c.tar.bz2 |
Made Blob into Pimpl to better support language bindings
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/test-datamodel.cpp | 17 | ||||
-rw-r--r-- | test/src/test-predicates.cpp | 20 |
2 files changed, 27 insertions, 10 deletions
diff --git a/test/src/test-datamodel.cpp b/test/src/test-datamodel.cpp index 0dc8d8a..71189d6 100644 --- a/test/src/test-datamodel.cpp +++ b/test/src/test-datamodel.cpp @@ -20,6 +20,23 @@ int main(int argc, char** argv) { WSAStartup(MAKEWORD(2, 2), &wsaData); #endif + { + char* testData = (char*)malloc(1024); + for (int i = 0; i < 1024; i++) { + testData[i] = (char)i; + } + + Data data(testData, 1024, "", false); + Blob blob = data.getBinary(); + char* otherData = blob.getData(); + + for (int i = 0; i < 1024; i++) { + assert(testData[i] == otherData[i]); + } + + exit(0); + } + Interpreter interpreter = Interpreter::fromXML("<scxml></scxml>"); DataModel dm(Factory::getInstance()->createDataModel("ecmascript", interpreter.getImpl().get())); dm.evalAsString("var foo = 12"); diff --git a/test/src/test-predicates.cpp b/test/src/test-predicates.cpp index d672577..fb4551e 100644 --- a/test/src/test-predicates.cpp +++ b/test/src/test-predicates.cpp @@ -10,16 +10,16 @@ int main(int argc, char** argv) { using namespace Arabica::XPath; const char* xml = - "<scxml>" - " <state id=\"atomic\" />" - " <state id=\"compound\">" - " <state id=\"compoundChild1\" />" - " <state id=\"compoundChild2\" />" - " </state>" - " <parallel id=\"parallel\">" - " </parallel>" - "</scxml>"; - + "<scxml>" + " <state id=\"atomic\" />" + " <state id=\"compound\">" + " <state id=\"compoundChild1\" />" + " <state id=\"compoundChild2\" />" + " </state>" + " <parallel id=\"parallel\">" + " </parallel>" + "</scxml>"; + Interpreter interpreter = Interpreter::fromXML(xml); assert(interpreter); interpreter.getImpl()->init(); |