socks5 tests fixed reinterpret_cast
Some checks failed
PR Check / on-push-commit-check (push) Failing after 14m25s

This commit is contained in:
Anton 2024-11-13 02:03:30 +03:00
parent b115439029
commit ee408b7ff8

View file

@ -99,8 +99,11 @@ TEST(Socks5ProxyTest, ConnectViaProxy) {
expected_request[req_len++] = static_cast<std::uint8_t>(network_order_port & 0xFF); expected_request[req_len++] = static_cast<std::uint8_t>(network_order_port & 0xFF);
std::string expected_data = expected_greeting; std::string expected_data = expected_greeting;
expected_data.append(reinterpret_cast<const char*>(expected_request.data()), req_len); auto transformed_view = expected_request | std::views::take(req_len) | std::views::transform([](std::uint8_t byte) {
return static_cast<char>(byte);
});
expected_data.append(std::ranges::to<std::string>(transformed_view));
EXPECT_EQ(sent_data, expected_data); EXPECT_EQ(sent_data, expected_data);
co_return; co_return;