diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d1b26b6c790..55a10af5335 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -171,7 +171,7 @@ if(MLN_WITH_METAL) ) endif() -if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Android) +if(CMAKE_SYSTEM_NAME STREQUAL Android) message("Target platform does not support HTTP tests or dependencies not found.") set(MLN_TEST_HAS_TEST_SERVER 0) @@ -262,7 +262,7 @@ if (MLN_WITH_CLANG_TIDY) set_target_properties(mbgl-test PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") endif() -if (CMAKE_SYSTEM_NAME STREQUAL Linux) +if (WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Linux) target_compile_definitions( mbgl-test PRIVATE USE_CPP_TEST_SERVER diff --git a/test/src/mbgl/test/http_server.cpp b/test/src/mbgl/test/http_server.cpp index abd9e2f5d65..92c651b3751 100644 --- a/test/src/mbgl/test/http_server.cpp +++ b/test/src/mbgl/test/http_server.cpp @@ -176,7 +176,7 @@ void runServer(std::unique_ptr& server) { }); server->Get("/delayed", [](const Request&, Response& res) { - usleep(200000); + std::this_thread::sleep_for(std::chrono::milliseconds(200)); res.status = 200; res.set_content("Response", "text/plain"); });