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/test-datamodel.cpp | |
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/test-datamodel.cpp')
-rw-r--r-- | test/src/test-datamodel.cpp | 17 |
1 files changed, 17 insertions, 0 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"); |