From: Gisle Vanem Date: Mon, 18 Apr 2022 06:45:14 +0000 (-0400) Subject: unit1620: call global_init before calling Curl_open X-Git-Tag: curl-7_83_0~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6019d652b519884d0f32b232254bed7189c0ea6c;p=thirdparty%2Fcurl.git 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 --- 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