/***************************************************************************1* _ _ ____ _2* Project ___| | | | _ \| |3* / __| | | | |_) | |4* | (__| |_| | _ <| |___5* \___|\___/|_| \_\_____|6*7* Copyright (C) Daniel Stenberg, <[email protected]>, et al.8*9* This software is licensed as described in the file COPYING, which10* you should have received as part of this distribution. The terms11* are also available at https://curl.se/docs/copyright.html.12*13* You may opt to use, copy, modify, merge, publish, distribute and/or sell14* copies of the Software, and permit persons to whom the Software is15* furnished to do so, under the terms of the COPYING file.16*17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY18* KIND, either express or implied.19*20* SPDX-License-Identifier: curl21*22***************************************************************************/23#include "first.h"2425#include "memdebug.h"2627static curl_socket_t opensocket(void *clientp,28curlsocktype purpose,29struct curl_sockaddr *address)30{31(void)purpose;32(void)address;33(void)clientp;34curl_mfprintf(stderr, "opensocket() returns CURL_SOCKET_BAD\n");35return CURL_SOCKET_BAD;36}3738static CURLcode test_lib1530(const char *URL)39{40CURL *curl = NULL;41CURLcode res = CURLE_FAILED_INIT;42(void)URL;4344if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {45curl_mfprintf(stderr, "curl_global_init() failed\n");46return TEST_ERR_MAJOR_BAD;47}4849curl = curl_easy_init();50if(!curl) {51curl_mfprintf(stderr, "curl_easy_init() failed\n");52curl_global_cleanup();53return TEST_ERR_MAJOR_BAD;54}5556test_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");57test_setopt(curl, CURLOPT_VERBOSE, 1L);58test_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket);5960res = curl_easy_perform(curl);6162test_cleanup:6364curl_easy_cleanup(curl);65curl_global_cleanup();6667return res;68}697071