socks5 tests fixed reinterpret_cast

This commit is contained in:
Anton 2024-11-13 02:03:30 +03:00 committed by sha512sum
parent e6e86c12c4
commit dcd0619d40

View file

@ -99,8 +99,11 @@ TEST(Socks5ProxyTest, ConnectViaProxy) {
expected_request[req_len++] = static_cast<std::uint8_t>(network_order_port & 0xFF);
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);
co_return;