summaryrefslogtreecommitdiff
path: root/tests/libtest/lib552.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-04-03 11:57:34 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-04-03 11:57:34 +0200
commit365322b8bcf9efb6a361473d227b70f2032212ce (patch)
tree1c6aa49fce74e802ac29e33098abf4c81ed4836b /tests/libtest/lib552.c
parentc7e4266a2e52d0dd0ad446044174c60ebfe10f73 (diff)
downloadgnurl-365322b8bcf9efb6a361473d227b70f2032212ce.tar.gz
gnurl-365322b8bcf9efb6a361473d227b70f2032212ce.tar.bz2
gnurl-365322b8bcf9efb6a361473d227b70f2032212ce.zip
tests/libtest: follow our code style guidelines better
... checksrc of all test code is pending.
Diffstat (limited to 'tests/libtest/lib552.c')
-rw-r--r--tests/libtest/lib552.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c
index 408b60cdb..e63cebc49 100644
--- a/tests/libtest/lib552.c
+++ b/tests/libtest/lib552.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -63,14 +63,14 @@ void dump(const char *text,
for(c = 0; (c < width) && (i+c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
- if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
+ if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
i+=(c+2-width);
break;
}
fprintf(stream, "%c",
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
- if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
+ if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
@@ -121,12 +121,14 @@ int my_trace(CURL *handle, curl_infotype type,
static size_t current_offset = 0;
-static char databuf[70000]; /* MUST be more than 64k OR MAX_INITIAL_POST_SIZE */
+static char databuf[70000]; /* MUST be more than 64k OR
+ MAX_INITIAL_POST_SIZE */
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t amount = nmemb * size; /* Total bytes curl wants */
- size_t available = sizeof(databuf) - current_offset; /* What we have to give */
+ size_t available = sizeof(databuf) - current_offset; /* What we have to
+ give */
size_t given = amount < available ? amount : available; /* What is given */
(void)stream;
memcpy(ptr, databuf + current_offset, given);
@@ -135,7 +137,8 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
}
-static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *stream)
+static size_t write_callback(void *ptr, size_t size, size_t nmemb,
+ void *stream)
{
int amount = curlx_uztosi(size * nmemb);
printf("%.*s", amount, (char *)ptr);
@@ -147,7 +150,7 @@ static size_t write_callback(void *ptr, size_t size, size_t nmemb, void *stream)
static curlioerr ioctl_callback(CURL * handle, int cmd, void *clientp)
{
(void)clientp;
- if (cmd == CURLIOCMD_RESTARTREAD ) {
+ if(cmd == CURLIOCMD_RESTARTREAD ) {
printf("APPLICATION: recieved a CURLIOCMD_RESTARTREAD request\n");
printf("APPLICATION: ** REWINDING! **\n");
current_offset = 0;
@@ -181,7 +184,7 @@ int test(char *URL)
test_setopt(curl, CURLOPT_VERBOSE, 1L);
/* setup repeated data string */
- for (i=0; i < sizeof(databuf); ++i)
+ for(i=0; i < sizeof(databuf); ++i)
databuf[i] = fill[i % sizeof fill];
/* Post */
@@ -206,7 +209,8 @@ int test(char *URL)
test_setopt(curl, CURLOPT_URL, URL);
- /* Accept any auth. But for this bug configure proxy with DIGEST, basic might work too, not NTLM */
+ /* Accept any auth. But for this bug configure proxy with DIGEST, basic
+ might work too, not NTLM */
test_setopt(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
res = curl_easy_perform(curl);