| 88 | } |
| 89 | |
| 90 | TEST(networking, initial_check) { |
| 91 | CURL *hCurlHandle = curl_easy_init(); |
| 92 | if (!hCurlHandle) |
| 93 | return; |
| 94 | curl_easy_setopt(hCurlHandle, CURLOPT_URL, |
| 95 | "https://cdn.proj.org/fr_ign_ntf_r93.tif"); |
| 96 | |
| 97 | curl_easy_setopt(hCurlHandle, CURLOPT_RANGE, "0-1"); |
| 98 | curl_easy_setopt(hCurlHandle, CURLOPT_WRITEFUNCTION, noop_curl_write_func); |
| 99 | |
| 100 | curl_easy_perform(hCurlHandle); |
| 101 | |
| 102 | long response_code = 0; |
| 103 | curl_easy_getinfo(hCurlHandle, CURLINFO_HTTP_CODE, &response_code); |
| 104 | |
| 105 | curl_easy_cleanup(hCurlHandle); |
| 106 | |
| 107 | networkAccessOK = (response_code == 206); |
| 108 | if (!networkAccessOK) { |
| 109 | fprintf(stderr, "network access not working"); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | #endif |
| 114 |
nothing calls this directly
no test coverage detected