Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/coro
Browse files Browse the repository at this point in the history
Tectu committed Dec 30, 2024
2 parents 8397b98 + 121a814 commit 7c55066
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
boost_version: [1.81.0, 1.82.0, 1.83.0, 1.84.0, 1.85.0, 1.86.0]
boost_version: [1.81.0, 1.82.0, 1.83.0, 1.84.0, 1.85.0, 1.86.0, 1.87.0]
shared: [ON, OFF]
toolchain:
[
2 changes: 1 addition & 1 deletion .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
boost_version: [1.81.0, 1.82.0, 1.83.0, 1.84.0, 1.85.0, 1.86.0]
boost_version: [1.81.0, 1.82.0, 1.83.0, 1.84.0, 1.85.0, 1.86.0, 1.87.0]
shared: [OFF]
malloy_tls: [ON, OFF]

15 changes: 6 additions & 9 deletions test/test_suites/components/controller.cpp
Original file line number Diff line number Diff line change
@@ -53,15 +53,12 @@ TEST_SUITE("controller - roundtrips")
}
}

// Note: These would technically belong into the TEST_CASE() below. However, for a currently unknown reason, these strings don't survive
// until the callbacks are invoked. This should certainly be investigated.
constexpr auto cli_agent_str = "test-cli";
constexpr auto serve_agent_str = "test-serve";

TEST_CASE("Server and client set agent strings based on user_agent")
{
constexpr auto addr = "127.0.0.1";
constexpr uint16_t port = 55123;
constexpr std::string_view cli_agent_str = "test-cli";
constexpr std::string_view serve_agent_str = "test-serve";
constexpr std::string_view addr = "127.0.0.1";
constexpr std::uint16_t port = 55123;

malloy::controller::config general_cfg;
general_cfg.logger = spdlog::default_logger();
@@ -82,13 +79,13 @@ TEST_SUITE("controller - roundtrips")
port,
"/"
};
auto stop_tkn = cli_ctrl.http_request(req, [&](auto&& resp){
auto stop_tkn = cli_ctrl.http_request(req, [serve_agent_str](auto&& resp){
CHECK_EQ(resp[malloy::http::field::server], serve_agent_str);
});

ms::routing_context serve_ctrl{serve_cfg};

serve_ctrl.router().add(malloy::http::method::get, "/", [&](auto&& req){
serve_ctrl.router().add(malloy::http::method::get, "/", [cli_agent_str](auto&& req){
CHECK_EQ(req[malloy::http::field::user_agent], cli_agent_str);
return malloy::http::generator::ok();
});

0 comments on commit 7c55066

Please sign in to comment.