summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/http/curl-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/http/curl-test.cpp')
-rw-r--r--sca-cpp/trunk/modules/http/curl-test.cpp19
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";