From dcd0619d402f996098424fba1b702bad2733a710 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 13 Nov 2024 02:03:30 +0300 Subject: [PATCH] socks5 tests fixed reinterpret_cast --- tests/proxy.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/proxy.cpp b/tests/proxy.cpp index 56f13c5..bcda66d 100644 --- a/tests/proxy.cpp +++ b/tests/proxy.cpp @@ -99,8 +99,11 @@ TEST(Socks5ProxyTest, ConnectViaProxy) { expected_request[req_len++] = static_cast(network_order_port & 0xFF); std::string expected_data = expected_greeting; - expected_data.append(reinterpret_cast(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(byte); + }); + expected_data.append(std::ranges::to(transformed_view)); EXPECT_EQ(sent_data, expected_data); co_return;