summaryrefslogtreecommitdiffstats
path: root/test/src/test-datamodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/test-datamodel.cpp')
-rw-r--r--test/src/test-datamodel.cpp17
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");