From 86b1de85536e93c59a25702a5a2d3e384202ffd2 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 11 Dec 2012 04:03:29 +0000 Subject: 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 --- sca-cpp/trunk/modules/http/curl-test.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'sca-cpp/trunk/modules/http/curl-test.cpp') 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 > r = get(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 r = getcontent(testURI, ch); assert(hasContent(r)); assert(contains(car(reverse(list(content(r)))), "It works")); return true; - } -}; - -const bool testGetPerf() { - CURLSession ch("", "", "", "", 0); - lambda 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"; -- cgit v1.2.3