diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 04:03:29 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2012-12-11 04:03:29 +0000 |
commit | 86b1de85536e93c59a25702a5a2d3e384202ffd2 (patch) | |
tree | c61d91970980199c597304ddcb01919993fbeb82 /sca-cpp/trunk/modules/http/curl-test.cpp | |
parent | 5f29c3b769fcdb2532d4948aa1c649d4330304b9 (diff) |
More changes to port to C++11, adjust to use the new JSON support, and cleanup rest of the modules.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1419987 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/http/curl-test.cpp')
-rw-r--r-- | sca-cpp/trunk/modules/http/curl-test.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sca-cpp/trunk/modules/http/curl-test.cpp b/sca-cpp/trunk/modules/http/curl-test.cpp index f0806ea577..6a1174a404 100644 --- a/sca-cpp/trunk/modules/http/curl-test.cpp +++ b/sca-cpp/trunk/modules/http/curl-test.cpp @@ -40,7 +40,7 @@ ostream* curlWriter(const string& s, ostream* os) { } const bool testGet() { - CURLSession ch("", "", "", "", 0); + const CURLSession ch("", "", "", "", 0); { ostringstream os; const failable<list<ostream*> > r = get<ostream*>(curlWriter, &os, testURI, ch); @@ -56,21 +56,14 @@ const bool testGet() { return true; } -struct getLoop { - CURLSession& ch; - getLoop(CURLSession& ch) : ch(ch) { - } - const bool operator()() const { +const bool testGetPerf() { + const CURLSession ch("", "", "", "", 0); + blambda gl = [ch]() -> const bool { const failable<value> r = getcontent(testURI, ch); assert(hasContent(r)); assert(contains(car(reverse(list<value>(content(r)))), "It works")); return true; - } -}; - -const bool testGetPerf() { - CURLSession ch("", "", "", "", 0); - lambda<bool()> gl = getLoop(ch); + }; cout << "Static GET test " << time(gl, 5, 200) << " ms" << endl; return true; } @@ -79,7 +72,7 @@ const bool testGetPerf() { } int main() { - tuscany::gc_scoped_pool p; + const tuscany::gc_scoped_pool p; tuscany::cout << "Testing..." << tuscany::endl; //tuscany::http::testURI = tuscany::string("http://") + tuscany::http::hostName() + ":8090"; |