diff options
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(); |