diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-06 11:44:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-06 11:44:22 +0000 |
commit | d86385c9b4cc3a13835579611b08ed713ee17a29 (patch) | |
tree | 5d3a6118c784feb71b91dbf4ea3e006a6fcaf05d | |
parent | e10685804a4e61e7e41747248347474dc9db90ed (diff) | |
download | libmicrohttpd-d86385c9b4cc3a13835579611b08ed713ee17a29.tar.gz libmicrohttpd-d86385c9b4cc3a13835579611b08ed713ee17a29.zip |
-nitpicks in tests
-rw-r--r-- | src/testcurl/https/test_https_time_out.c | 3 | ||||
-rw-r--r-- | src/testcurl/https/tls_test_common.c | 6 | ||||
-rw-r--r-- | src/testcurl/test_get.c | 1 | ||||
-rw-r--r-- | src/testcurl/test_quiesce.c | 6 |
4 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/https/test_https_time_out.c b/src/testcurl/https/test_https_time_out.c index cafe5545..16b171ac 100644 --- a/src/testcurl/https/test_https_time_out.c +++ b/src/testcurl/https/test_https_time_out.c | |||
@@ -62,6 +62,7 @@ test_tls_session_time_out (gnutls_session_t session) | |||
62 | if (ret < 0) | 62 | if (ret < 0) |
63 | { | 63 | { |
64 | fprintf (stderr, "Error: %s\n", MHD_E_FAILED_TO_CONNECT); | 64 | fprintf (stderr, "Error: %s\n", MHD_E_FAILED_TO_CONNECT); |
65 | close (sd); | ||
65 | return -1; | 66 | return -1; |
66 | } | 67 | } |
67 | 68 | ||
@@ -69,6 +70,7 @@ test_tls_session_time_out (gnutls_session_t session) | |||
69 | if (ret < 0) | 70 | if (ret < 0) |
70 | { | 71 | { |
71 | fprintf (stderr, "Handshake failed\n"); | 72 | fprintf (stderr, "Handshake failed\n"); |
73 | close (sd); | ||
72 | return -1; | 74 | return -1; |
73 | } | 75 | } |
74 | 76 | ||
@@ -79,6 +81,7 @@ test_tls_session_time_out (gnutls_session_t session) | |||
79 | if (send (sd, "", 1, 0) == 0) | 81 | if (send (sd, "", 1, 0) == 0) |
80 | { | 82 | { |
81 | fprintf (stderr, "Connection failed to time-out\n"); | 83 | fprintf (stderr, "Connection failed to time-out\n"); |
84 | close (sd); | ||
82 | return -1; | 85 | return -1; |
83 | } | 86 | } |
84 | 87 | ||
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c index 8679280f..b78ecbba 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -40,8 +40,8 @@ setup_ca_cert () | |||
40 | ca_cert_file_name, strerror (errno)); | 40 | ca_cert_file_name, strerror (errno)); |
41 | return NULL; | 41 | return NULL; |
42 | } | 42 | } |
43 | if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem), cert_fd) | 43 | if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem) + 1, cert_fd) |
44 | != strlen (ca_cert_pem)) | 44 | != strlen (ca_cert_pem) + 1) |
45 | { | 45 | { |
46 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 46 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
47 | ca_cert_file_name, strerror (errno)); | 47 | ca_cert_file_name, strerror (errno)); |
@@ -401,7 +401,7 @@ setup_session (gnutls_session_t * session, | |||
401 | return -1; | 401 | return -1; |
402 | } | 402 | } |
403 | memcpy (key->data, srv_key_pem, key->size); | 403 | memcpy (key->data, srv_key_pem, key->size); |
404 | cert->size = strlen (srv_self_signed_cert_pem); | 404 | cert->size = strlen (srv_self_signed_cert_pem) + 1; |
405 | cert->data = malloc (cert->size); | 405 | cert->data = malloc (cert->size); |
406 | if (cert->data == NULL) | 406 | if (cert->data == NULL) |
407 | { | 407 | { |
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c index 33546adc..3795db2a 100644 --- a/src/testcurl/test_get.c +++ b/src/testcurl/test_get.c | |||
@@ -472,6 +472,7 @@ testStopRace (int poll_flag) | |||
472 | if (CONNECT (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0) | 472 | if (CONNECT (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0) |
473 | { | 473 | { |
474 | fprintf(stderr, "connect: %m\n"); | 474 | fprintf(stderr, "connect: %m\n"); |
475 | CLOSE (fd); | ||
475 | return 512; | 476 | return 512; |
476 | } | 477 | } |
477 | 478 | ||
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c index dc131439..ddf794dc 100644 --- a/src/testcurl/test_quiesce.c +++ b/src/testcurl/test_quiesce.c | |||
@@ -384,8 +384,10 @@ testExternalGet () | |||
384 | if (i == 0) { | 384 | if (i == 0) { |
385 | /* quiesce the daemon on the 1st iteration, so the 2nd should fail */ | 385 | /* quiesce the daemon on the 1st iteration, so the 2nd should fail */ |
386 | fd = MHD_quiesce_daemon(d); | 386 | fd = MHD_quiesce_daemon(d); |
387 | close(fd); | 387 | if (-1 == fd) |
388 | c = setupCURL(&cbc); | 388 | abort (); |
389 | close (fd); | ||
390 | c = setupCURL (&cbc); | ||
389 | multi = curl_multi_init (); | 391 | multi = curl_multi_init (); |
390 | mret = curl_multi_add_handle (multi, c); | 392 | mret = curl_multi_add_handle (multi, c); |
391 | } | 393 | } |