HTTPS test fixes and improvements:

always skip tests if libcurl do not support HTTPS (instead of failing)
return 99 in case of global errors (MHD-unrelated)
print error result if test if failed
fixed ignored result of epoll test in test_https_get_select
allow compilation by C89 compiler
This commit is contained in:
Evgeny Grin (Karlson2k)
2017-04-10 20:00:02 +03:00
parent ab406a9e6a
commit fea6bf18a1
13 changed files with 109 additions and 51 deletions
+12 -5
View File
@@ -96,6 +96,7 @@ main (int argc, char *const *argv)
{
unsigned int errorCount = 0;
FILE *cert;
const char *aes256_sha = "AES256-SHA";
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
#ifdef GCRYCTL_INITIALIZATION_FINISHED
@@ -105,20 +106,26 @@ main (int argc, char *const *argv)
{
fprintf (stderr, "Error (code: %u). l:%d f:%s\n", errorCount, __LINE__,
__FUNCTION__);
return -1;
return 99;
}
if (NULL == curl_version_info (CURLVERSION_NOW)->ssl_version)
{
fprintf (stderr, "Curl does not support SSL. Cannot run the test.\n");
curl_global_cleanup ();
return 77;
}
if ((cert = setup_ca_cert ()) == NULL)
{
fprintf (stderr, MHD_E_TEST_FILE_CREAT);
return -1;
curl_global_cleanup ();
return 99;
}
const char *aes256_sha = "AES256-SHA";
if (curl_uses_nss_ssl() == 0)
{
aes256_sha = "rsa_aes_256_sha";
}
errorCount +=
test_concurent_daemon_pair (NULL, aes256_sha, CURL_SSLVERSION_TLSv1);
@@ -130,5 +137,5 @@ main (int argc, char *const *argv)
fprintf (stderr,
"Failed to remove `%s'\n",
ca_cert_file_name);
return errorCount != 0;
return errorCount != 0 ? 1 : 0;
}