mirror of
https://github.com/BlackMATov/curly.hpp.git
synced 2025-12-16 14:11:17 +07:00
fix some tests
This commit is contained in:
@@ -40,7 +40,8 @@ add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
|||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
catchorg_catch2
|
catchorg_catch2
|
||||||
GIT_REPOSITORY https://github.com/catchorg/catch2)
|
GIT_REPOSITORY https://github.com/catchorg/catch2
|
||||||
|
GIT_TAG v2.13.2)
|
||||||
|
|
||||||
FetchContent_GetProperties(catchorg_catch2)
|
FetchContent_GetProperties(catchorg_catch2)
|
||||||
if(NOT catchorg_catch2_POPULATED)
|
if(NOT catchorg_catch2_POPULATED)
|
||||||
|
|||||||
@@ -562,7 +562,7 @@ TEST_CASE("curly") {
|
|||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("http://httpbin.org/drip?duration=15&numbytes=5&code=200&delay=1")
|
.url("http://httpbin.org/drip?duration=15&numbytes=5&code=200&delay=1")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.response_timeout(net::time_sec_t(3))
|
.response_timeout(net::time_sec_t(2))
|
||||||
.send();
|
.send();
|
||||||
REQUIRE(req.wait_for(net::time_sec_t(1)) == net::req_status::pending);
|
REQUIRE(req.wait_for(net::time_sec_t(1)) == net::req_status::pending);
|
||||||
REQUIRE(req.wait_for(net::time_sec_t(5)) == net::req_status::timeout);
|
REQUIRE(req.wait_for(net::time_sec_t(5)) == net::req_status::timeout);
|
||||||
@@ -639,21 +639,21 @@ TEST_CASE("curly") {
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/redirect/2")
|
.url("http://httpbingo.org/redirect/2")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.send();
|
.send();
|
||||||
REQUIRE(req.take().http_code() == 200u);
|
REQUIRE(req.take().http_code() == 200u);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/absolute-redirect/2")
|
.url("http://httpbingo.org/absolute-redirect/2")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.send();
|
.send();
|
||||||
REQUIRE(req.take().http_code() == 200u);
|
REQUIRE(req.take().http_code() == 200u);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/relative-redirect/2")
|
.url("http://httpbingo.org/relative-redirect/2")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.send();
|
.send();
|
||||||
REQUIRE(req.take().http_code() == 200u);
|
REQUIRE(req.take().http_code() == 200u);
|
||||||
@@ -662,7 +662,7 @@ TEST_CASE("curly") {
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/redirect/3")
|
.url("http://httpbingo.org/redirect/3")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.redirections(0)
|
.redirections(0)
|
||||||
.send();
|
.send();
|
||||||
@@ -670,7 +670,7 @@ TEST_CASE("curly") {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/redirect/3")
|
.url("http://httpbingo.org/redirect/3")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.redirections(1)
|
.redirections(1)
|
||||||
.send();
|
.send();
|
||||||
@@ -678,7 +678,7 @@ TEST_CASE("curly") {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/redirect/3")
|
.url("http://httpbingo.org/redirect/3")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.redirections(2)
|
.redirections(2)
|
||||||
.send();
|
.send();
|
||||||
@@ -686,7 +686,7 @@ TEST_CASE("curly") {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto req = net::request_builder()
|
auto req = net::request_builder()
|
||||||
.url("https://httpbin.org/redirect/3")
|
.url("http://httpbingo.org/redirect/3")
|
||||||
.method(net::http_method::GET)
|
.method(net::http_method::GET)
|
||||||
.redirections(3)
|
.redirections(3)
|
||||||
.send();
|
.send();
|
||||||
|
|||||||
Reference in New Issue
Block a user