tighten formatting rules

This commit is contained in:
Christian Grothoff committed 2019-10-31 13:06:08 +01:00
1 parent e0a0762845
commit 7389c34528
160 files changed
+902 -529

No files matched your search

+5 -5
View File
@@ -101,7 +101,7 @@ testInternalSelectGet ()
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return 32;
}
@@ -177,10 +177,10 @@ testInternalSelectGet ()
if (EINTR != errno)
abort ();
#else
if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
ws.
fd_count)
||(0 != es.fd_count) )
if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 !=
ws.
fd_count)
|| (0 != es.fd_count) )
abort ();
Sleep (1000);
#endif
+4 -4
View File
@@ -74,7 +74,7 @@ test_secure_get (FILE *test_fd,
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return -1;
}
@@ -148,8 +148,8 @@ curlExcessFound (CURL *c,
(void) c; /* Unused. Silence compiler warning. */
if ((CURLINFO_TEXT == type)
&&(size >= str_size)
&&(0 == strncmp (excess_found, data, str_size)))
&& (size >= str_size)
&& (0 == strncmp (excess_found, data, str_size)))
*(int *) cls = 1;
return 0;
}
@@ -189,7 +189,7 @@ testEmptyGet (int poll_flag)
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return 32;
}
@@ -70,6 +70,7 @@ https_transfer_thread_adapter (void *args)
return &nonnull;
}
/**
* Test non-parallel requests.
*
+5 -5
View File
@@ -118,7 +118,7 @@ testExternalGet (int flags)
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return 32;
}
@@ -201,10 +201,10 @@ testExternalGet (int flags)
if (EINTR != errno)
abort ();
#else
if ((WSAEINVAL != WSAGetLastError ()) ||(0 != rs.fd_count) ||(0 !=
ws.
fd_count)
||(0 != es.fd_count) )
if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 !=
ws.
fd_count)
|| (0 != es.fd_count) )
abort ();
Sleep (1000);
#endif
+2 -2
View File
@@ -78,7 +78,7 @@ test_concurent_daemon_pair (void *cls,
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d1, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d1); return -1;
}
@@ -103,7 +103,7 @@ test_concurent_daemon_pair (void *cls,
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d2, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d1);
MHD_stop_daemon (d2);
+3 -1
View File
@@ -132,7 +132,7 @@ test_query_session ()
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d);
free (cbc.buf);
@@ -188,6 +188,8 @@ test_query_session ()
free (cbc.buf);
return 0;
}
#endif
int
+5 -3
View File
@@ -120,7 +120,6 @@ load_keys (const char *hostname,
}
/**
* @param session the session we are giving a cert for
* @param req_ca_dn NULL on server side
@@ -297,7 +296,7 @@ main (int argc, char *const *argv)
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return -1;
}
@@ -318,10 +317,13 @@ main (int argc, char *const *argv)
#else
int main (void)
int
main (void)
{
fprintf (stderr,
"SNI not supported by GnuTLS < 3.0\n");
return 77;
}
#endif
+1 -1
View File
@@ -144,7 +144,7 @@ main (int argc, char *const *argv)
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return -1;
}
+1 -2
View File
@@ -38,7 +38,6 @@ extern const char srv_signed_cert_pem[];
extern const char srv_signed_key_pem[];
/* perform a HTTP GET request via SSL/TLS */
static int
test_secure_get (void *cls, char *cipher_suite, int proto_version)
@@ -70,7 +69,7 @@ test_secure_get (void *cls, char *cipher_suite, int proto_version)
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return -1;
}
+2 -3
View File
@@ -132,8 +132,7 @@ test_hello_extension (gnutls_session_t session, int port, extensions_t exten_t,
* len = ciphersuite data + 2 bytes ciphersuite length \
* 1 byte compression length + 1 byte compression data + \
* 2 bytes extension length, extensions data
*/
ciphersuite_len = MHD__gnutls_copy_ciphersuites (session, extdata,
*/ciphersuite_len = MHD__gnutls_copy_ciphersuites (session, extdata,
sizeof (extdata));
exten_data_len = ext_count * (2 + 2 + ext_length);
datalen += ciphersuite_len + 2 + 2 + exten_data_len;
@@ -259,7 +258,7 @@ main (int argc, char *const *argv)
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (d); return -1;
}
+7 -1
View File
@@ -232,6 +232,7 @@ http_dummy_ahc (void *cls,
return 0;
}
/**
* send a test http request to the daemon
* @param url
@@ -414,6 +415,7 @@ cleanup:
return ret;
}
/**
* setup test case
*
@@ -439,7 +441,7 @@ setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list
{
const union MHD_DaemonInfo *dinfo;
dinfo = MHD_get_daemon_info (*d, MHD_DAEMON_INFO_BIND_PORT);
if ((NULL == dinfo) ||(0 == dinfo->port) )
if ((NULL == dinfo) || (0 == dinfo->port) )
{
MHD_stop_daemon (*d);
return 0;
@@ -450,12 +452,14 @@ setup_testcase (struct MHD_Daemon **d, int port, int daemon_flags, va_list
return port;
}
void
teardown_testcase (struct MHD_Daemon *d)
{
MHD_stop_daemon (d);
}
int
setup_session (gnutls_session_t *session,
gnutls_datum_t *key,
@@ -501,6 +505,7 @@ setup_session (gnutls_session_t *session,
return 0;
}
int
teardown_session (gnutls_session_t session,
gnutls_datum_t *key,
@@ -518,6 +523,7 @@ teardown_session (gnutls_session_t session,
return 0;
}
/* TODO test_wrap: change sig to (setup_func, test, va_list test_arg) */
int
test_wrap (const char *test_name, int