socks5 tests fixed reinterpret_cast
This commit is contained in:
parent
e6e86c12c4
commit
dcd0619d40
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue