fix(hostname): fix handling of non-ASCII hostnames on Windows (#3382)

This commit is contained in:
Cameron Gutman 2024-11-09 14:05:46 -06:00 committed by GitHub
commit fb1f5b5a89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 51 additions and 5 deletions

View file

@ -4,6 +4,8 @@
*/
#include <src/platform/common.h>
#include <boost/asio/ip/host_name.hpp>
#include "../../tests_common.h"
struct SetEnvTest: ::testing::TestWithParam<std::tuple<std::string, std::string, int>> {
@ -47,3 +49,8 @@ INSTANTIATE_TEST_SUITE_P(
std::make_tuple("SUNSHINE_UNIT_TEST_ENV_VAR", "test_value_0", 0),
std::make_tuple("SUNSHINE_UNIT_TEST_ENV_VAR", "test_value_1", 0),
std::make_tuple("", "test_value", -1)));
TEST(HostnameTests, TestAsioEquality) {
// These should be equivalent on all platforms for ASCII hostnames
ASSERT_EQ(platf::get_host_name(), boost::asio::ip::host_name());
}