socks5 tests fixed reinterpret_cast
Some checks failed
PR Check / on-push-commit-check (push) Failing after 14m25s
Some checks failed
PR Check / on-push-commit-check (push) Failing after 14m25s
This commit is contained in:
parent
b115439029
commit
ee408b7ff8
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);
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue