diff --git a/tests/test.cpp b/tests/test.cpp index 7985220..6a12e0e 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -2298,15 +2298,20 @@ BOOST_AUTO_TEST_CASE(ligo_http_raw_exchange_headers_query_and_status) { BOOST_REQUIRE(server.start()); auto exercise = [&]() -> boost::asio::awaitable { auto client = ligo::http::client{{"127.0.0.1", server.selected_port()}}; - auto result = co_await client.exchange({.method = ligo::http::method::GET, .target = "/raw?search=two+words%2B", .headers = {{"If-None-Match", "revision-one"}}}); + // GCC 12 can ICE on initializer-list temporaries in co_await expressions. + auto request = ligo::http::request{.method = ligo::http::method::GET, .target = "/raw?search=two+words%2B"}; + request.headers.emplace("If-None-Match", "revision-one"); + auto result = co_await client.exchange(request); BOOST_REQUIRE(result); BOOST_CHECK_EQUAL(result->status, 202); BOOST_CHECK_EQUAL(result->body, "not a JSON envelope"); BOOST_CHECK_EQUAL(result->headers.at("etag"), "revision-two"); - auto invalid = co_await client.exchange({.method = ligo::http::method::GET, .target = "/raw?search=%ZZ"}); + auto invalid_request = ligo::http::request{.method = ligo::http::method::GET, .target = "/raw?search=%ZZ"}; + auto invalid = co_await client.exchange(invalid_request); BOOST_REQUIRE(invalid); BOOST_CHECK_EQUAL(invalid->status, 400); - auto duplicate = co_await client.exchange({.method = ligo::http::method::GET, .target = "/raw?x=1&x=2"}); + auto duplicate_request = ligo::http::request{.method = ligo::http::method::GET, .target = "/raw?x=1&x=2"}; + auto duplicate = co_await client.exchange(duplicate_request); BOOST_REQUIRE(duplicate); BOOST_CHECK_EQUAL(duplicate->status, 400); server.stop();