summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/server/client-test.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/modules/server/client-test.hpp')
-rw-r--r--sca-cpp/trunk/modules/server/client-test.hpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/sca-cpp/trunk/modules/server/client-test.hpp b/sca-cpp/trunk/modules/server/client-test.hpp
index 2207127e67..1c7b26da39 100644
--- a/sca-cpp/trunk/modules/server/client-test.hpp
+++ b/sca-cpp/trunk/modules/server/client-test.hpp
@@ -46,7 +46,7 @@ ostream* curlWriter(const string& s, ostream* os) {
const bool testGet() {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
{
ostringstream os;
const failable<list<ostream*> > r = http::get<ostream*>(curlWriter, &os, "http://localhost:8090/index.html", ch);
@@ -63,7 +63,7 @@ const bool testGet() {
}
struct getLoop {
- http::CURLSession ch;
+ http::CURLSession& ch;
getLoop(http::CURLSession& ch) : ch(ch) {
}
const bool operator()() const {
@@ -76,7 +76,7 @@ struct getLoop {
const bool testGetPerf() {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
const lambda<bool()> gl = getLoop(ch);
cout << "Static GET test " << time(gl, 5, 200) << " ms" << endl;
return true;
@@ -84,7 +84,7 @@ const bool testGetPerf() {
const bool testEval() {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
const failable<value> r = http::evalExpr(mklist<value>(string("echo"), string("Hello")), testURI, ch);
assert(hasContent(r));
assert(content(r) == string("Hello"));
@@ -93,7 +93,7 @@ const bool testEval() {
struct evalLoop {
const string uri;
- http::CURLSession ch;
+ http::CURLSession& ch;
evalLoop(const string& uri, http::CURLSession& ch) : uri(uri), ch(ch) {
}
const bool operator()() const {
@@ -109,7 +109,7 @@ const list<value> blobs = mklist(blob, blob);
struct blobEvalLoop {
const string uri;
- http::CURLSession ch;
+ http::CURLSession& ch;
blobEvalLoop(const string& uri, http::CURLSession& ch) : uri(uri), ch(ch) {
}
const bool operator()() const {
@@ -122,7 +122,7 @@ struct blobEvalLoop {
const bool testEvalPerf() {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
const lambda<bool()> el = evalLoop(testURI, ch);
cout << "JSON-RPC eval echo test " << time(el, 5, 200) << " ms" << endl;
@@ -142,7 +142,7 @@ bool testPost() {
+ (list<value>() + "title" + string("item"))
+ (list<value>() + "id" + string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"))
+ i);
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
const failable<value> id = http::post(a, testURI, ch);
assert(hasContent(id));
return true;
@@ -151,7 +151,7 @@ bool testPost() {
struct postLoop {
const string uri;
const value val;
- http::CURLSession ch;
+ http::CURLSession& ch;
postLoop(const string& uri, const value& val, http::CURLSession& ch) : uri(uri), val(val), ch(ch) {
}
const bool operator()() const {
@@ -164,7 +164,7 @@ struct postLoop {
struct postBlobLoop {
const string uri;
const value val;
- http::CURLSession ch;
+ http::CURLSession& ch;
postBlobLoop(const string& uri, const value& val, http::CURLSession& ch) : uri(uri), val(val), ch(ch) {
}
const bool operator()() const {
@@ -177,7 +177,7 @@ struct postBlobLoop {
const bool testPostPerf() {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
{
const list<value> i = list<value>() + "content" + (list<value>() + "item"
+ (list<value>() + "name" + string("Apple"))
@@ -209,7 +209,7 @@ const bool testPostPerf() {
const bool postThread(const string& uri, const int count, const value& val) {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
const lambda<bool()> pl = postLoop(uri, val, ch);
time(pl, 0, count);
return true;
@@ -267,7 +267,7 @@ const bool testPostThreadPerf() {
const bool postProc(const string& uri, const int count, const value& val) {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
const lambda<bool()> pl = postLoop(uri, val, ch);
time(pl, 0, count);
return true;
@@ -337,7 +337,7 @@ const bool testPut() {
+ (list<value>() + "title" + string("item"))
+ (list<value>() + "id" + string("cart-53d67a61-aa5e-4e5e-8401-39edeba8b83b"))
+ i);
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
value rc = content(http::put(a, testURI + "/111", ch));
assert(rc == value(true));
return true;
@@ -345,7 +345,7 @@ const bool testPut() {
const bool testDel() {
gc_scoped_pool pool;
- http::CURLSession ch("", "", "", "");
+ http::CURLSession ch("", "", "", "", 0);
value rc = content(http::del(testURI + "/111", ch));
assert(rc == value(true));
return true;