Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
windoze committed Aug 27, 2015
1 parent 32e3a1e commit c021624
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/test_http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,27 @@ void the_client() {

void the_url_client() {
url_client uc;
if(0)
{
client::response &resp=uc.request("http://0d0a.com/");
assert(resp.status_code==http_status_code::OK);
}
if(0)
{
client::response &resp=uc.request("http://www.baidu.com/");
assert(resp.status_code==http_status_code::OK);
}
{
// http://github.com/ responses with 301, redirects to 'https://github.com/'
client::response &resp=uc.request("http://github.com/");
// http://www.taobao.com/ responses with 302, redirects to 'https://www.taobao.com/'
client::response &resp=uc.request("http://www.taobao.com/");
assert(resp.status_code==http_status_code::OK);
}
}

int fibio::main(int argc, char *argv[]) {
fiber_group fibers;
for (int i=0; i<1; i++) {
fibers.create_fiber(the_client);
//fibers.create_fiber(the_client);
fibers.create_fiber(the_url_client);
}
fibers.join_all();
Expand Down

0 comments on commit c021624

Please sign in to comment.