From 6019d652b519884d0f32b232254bed7189c0ea6c Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Mon, 18 Apr 2022 02:45:14 -0400 Subject: [PATCH] unit1620: call global_init before calling Curl_open Curl_open calls the resolver init and on Windows if the resolver backend is c-ares then the Windows sockets library (winsock) must already have been initialized (via global init). Ref: https://github.com/curl/curl/pull/8540#issuecomment-1059771800 Closes https://github.com/curl/curl/pull/8719 --- tests/unit/unit1620.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/unit1620.c b/tests/unit/unit1620.c index 4f1aaaf0aa..fc25eac37f 100644 --- a/tests/unit/unit1620.c +++ b/tests/unit/unit1620.c @@ -28,11 +28,14 @@ static CURLcode unit_setup(void) { - return CURLE_OK; + int res = CURLE_OK; + global_init(CURL_GLOBAL_ALL); + return res; } static void unit_stop(void) { + curl_global_cleanup(); } UNITTEST_START -- 2.47.3