diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-27 03:26:59 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-27 03:26:59 +0000 |
commit | 6f1d9dd9f40b000f03c209207e98d8a4469594bb (patch) | |
tree | 7f822db4fc92fa66f9ea97a862242b8124f9965b /sca-cpp/trunk/modules | |
parent | 352462dacc05290102a18fa77964998d68e6380d (diff) |
Add options to use mmap or electric fence to check memory accesses, and fix a few memory access violations.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1294008 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules')
-rw-r--r-- | sca-cpp/trunk/modules/java/eval.hpp | 1 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/json/json-test.cpp | 3 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/opencl/eval.hpp | 1 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/python/eval.hpp | 1 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/server/client-test.hpp | 24 |
5 files changed, 16 insertions, 14 deletions
diff --git a/sca-cpp/trunk/modules/java/eval.hpp b/sca-cpp/trunk/modules/java/eval.hpp index a73c84c64c..1e119aac80 100644 --- a/sca-cpp/trunk/modules/java/eval.hpp +++ b/sca-cpp/trunk/modules/java/eval.hpp @@ -153,7 +153,6 @@ public: } ~JavaRuntime() { - debug("java::~javaruntime"); } JavaVM* jvm; diff --git a/sca-cpp/trunk/modules/json/json-test.cpp b/sca-cpp/trunk/modules/json/json-test.cpp index ac68d7573d..61aac4ee02 100644 --- a/sca-cpp/trunk/modules/json/json-test.cpp +++ b/sca-cpp/trunk/modules/json/json-test.cpp @@ -123,7 +123,8 @@ bool testJSON() { istringstream is(str(wos)); const list<string> il = streamList(is); const list<value> r = elementsToValues(content(readJSON(il, cx))); - assert(r == l); + const list<value> l2 = mklist<value>(list<value>() + "fruit" + (list<value>() + string("Apple") + string("Orange"))); + assert(r == l2); } return true; } diff --git a/sca-cpp/trunk/modules/opencl/eval.hpp b/sca-cpp/trunk/modules/opencl/eval.hpp index ef0e028e71..35eb6a3b3b 100644 --- a/sca-cpp/trunk/modules/opencl/eval.hpp +++ b/sca-cpp/trunk/modules/opencl/eval.hpp @@ -222,7 +222,6 @@ public: } ~OpenCLContext() { - debug("opencl::~OpenCLContext"); for (cl_uint i = 0; i < ndevs; i++) { if (cq[i] != 0) clReleaseCommandQueue(cq[i]); diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp index ed22fb2b87..41f45ac5ff 100644 --- a/sca-cpp/trunk/modules/python/eval.hpp +++ b/sca-cpp/trunk/modules/python/eval.hpp @@ -96,7 +96,6 @@ public: } ~PythonRuntime() { - debug("python::~pythonruntime"); } private: diff --git a/sca-cpp/trunk/modules/server/client-test.hpp b/sca-cpp/trunk/modules/server/client-test.hpp index 2dab7b6dfd..2207127e67 100644 --- a/sca-cpp/trunk/modules/server/client-test.hpp +++ b/sca-cpp/trunk/modules/server/client-test.hpp @@ -85,8 +85,9 @@ const bool testGetPerf() { const bool testEval() { gc_scoped_pool pool; http::CURLSession ch("", "", "", ""); - const value val = content(http::evalExpr(mklist<value>(string("echo"), string("Hello")), testURI, ch)); - assert(val == string("Hello")); + const failable<value> r = http::evalExpr(mklist<value>(string("echo"), string("Hello")), testURI, ch); + assert(hasContent(r)); + assert(content(r) == string("Hello")); return true; } @@ -96,8 +97,9 @@ struct evalLoop { evalLoop(const string& uri, http::CURLSession& ch) : uri(uri), ch(ch) { } const bool operator()() const { - const value val = content(http::evalExpr(mklist<value>(string("echo"), string("Hello")), uri, ch)); - assert(val == string("Hello")); + const failable<value> r = http::evalExpr(mklist<value>(string("echo"), string("Hello")), uri, ch); + assert(hasContent(r)); + assert(content(r) == string("Hello")); return true; } }; @@ -111,8 +113,9 @@ struct blobEvalLoop { blobEvalLoop(const string& uri, http::CURLSession& ch) : uri(uri), ch(ch) { } const bool operator()() const { - const value val = content(http::evalExpr(mklist<value>(string("echo"), blobs), uri, ch)); - assert(val == blobs); + const failable<value> r = content(http::evalExpr(mklist<value>(string("echo"), blobs), uri, ch)); + assert(hasContent(r)); + assert(content(r) == blobs); return true; } }; @@ -227,12 +230,12 @@ const bool checkPost(const list<future<bool> >& r) { struct postThreadLoop { const lambda<bool()> l; + worker& w; const int threads; - const gc_ptr<worker> w; - postThreadLoop(const lambda<bool()>& l, const int threads) : l(l), threads(threads), w(new (gc_new<worker>()) worker(threads)) { + postThreadLoop(const lambda<bool()>& l, worker& w, const int threads) : l(l), w(w), threads(threads) { } const bool operator()() const { - list<future<bool> > r = startPost(*w, threads, l); + list<future<bool> > r = startPost(w, threads, l); checkPost(r); return true; } @@ -242,6 +245,7 @@ const bool testPostThreadPerf() { gc_scoped_pool pool; const int count = 50; const int threads = 10; + worker w(threads); const list<value> i = list<value>() + "content" + (list<value>() + "item" + (list<value>() + "name" + string("Apple")) @@ -252,7 +256,7 @@ const bool testPostThreadPerf() { + i); const lambda<bool()> pl= curry(lambda<bool(const string, const int, const value)>(postThread), testURI, count, val); - const lambda<bool()> ptl = postThreadLoop(pl, threads); + const lambda<bool()> ptl = postThreadLoop(pl, w, threads); double t = time(ptl, 0, 1) / (threads * count); cout << "ATOMPub POST thread test " << t << " ms" << endl; |