diff --git a/tests/data/test1508 b/tests/data/test1508
index f8607e58a0..b276b8b310 100644
--- a/tests/data/test1508
+++ b/tests/data/test1508
@@ -24,7 +24,7 @@ http://%HOSTIP:%HTTPPORT/path/1508
# Verify data after the test has been "shot"
-
+
We are done
diff --git a/tests/data/test1900 b/tests/data/test1900
index 699fb513a0..04c59a826f 100644
--- a/tests/data/test1900
+++ b/tests/data/test1900
@@ -9,7 +9,7 @@ multi
# Server-side
-
+
Adding handle 0
Handle 0 Completed with status 0
Adding handle 1
diff --git a/tests/data/test1901 b/tests/data/test1901
index 4967af39bc..c087cc3840 100644
--- a/tests/data/test1901
+++ b/tests/data/test1901
@@ -9,7 +9,7 @@ multi
# Server-side
-
+
Adding handle 0
Handle 0 Completed with status 0
Adding handle 1
diff --git a/tests/data/test1902 b/tests/data/test1902
index 017a9fe373..a634c46afc 100644
--- a/tests/data/test1902
+++ b/tests/data/test1902
@@ -9,7 +9,7 @@ multi
# Server-side
-
+
Adding handle 0
Handle 0 Completed with status 0
Adding handle 1
diff --git a/tests/data/test1903 b/tests/data/test1903
index 6a5e86b86d..79cae02668 100644
--- a/tests/data/test1903
+++ b/tests/data/test1903
@@ -9,7 +9,7 @@ multi
# Server-side
-
+
Adding handle 0
Handle 0 Completed with status 0
Adding handle 1
diff --git a/tests/data/test500 b/tests/data/test500
index f9b17f37c7..faf3d72711 100644
--- a/tests/data/test500
+++ b/tests/data/test500
@@ -8,18 +8,18 @@ HTTP GET
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
-ETag: "21025-dc7-39462498"
-Accept-Ranges: bytes
-Content-Length: 6
-Connection: close
-Content-Type: text/html
-Funny-head: yesyes
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
-foo-
@@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/500 log/ip500
#
# Verify data after the test has been "shot"
-
+
IP: %HOSTIP
diff --git a/tests/data/test502 b/tests/data/test502
index f73a4eb30b..f8d776b6c8 100644
--- a/tests/data/test502
+++ b/tests/data/test502
@@ -7,7 +7,7 @@ FILE
#
# Server-side
-
+
foo
bar swsclose
bar
diff --git a/tests/data/test506 b/tests/data/test506
index 630e816519..f9d2be4b4d 100644
--- a/tests/data/test506
+++ b/tests/data/test506
@@ -72,7 +72,7 @@ http://%HOSTIP:%HTTPPORT/506
# Verify data after the test has been "shot"
-
+
GLOBAL_INIT
SHARE_INIT
CURLSHOPT_LOCKFUNC
diff --git a/tests/data/test508 b/tests/data/test508
index 5cd4b8c342..44a8bb5910 100644
--- a/tests/data/test508
+++ b/tests/data/test508
@@ -2,13 +2,13 @@
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake swsclose
-Connection: close
-Content-Type: text/html
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
hello
diff --git a/tests/data/test509 b/tests/data/test509
index a6ee7474c1..b467d65f85 100644
--- a/tests/data/test509
+++ b/tests/data/test509
@@ -28,7 +28,7 @@ nothing
#
# Verify data after the test has been "shot"
-
+
seen custom_calloc()
seen custom_malloc()
seen custom_realloc()
diff --git a/tests/data/test510 b/tests/data/test510
index f1f1a3ceb6..5ba0a7fe98 100644
--- a/tests/data/test510
+++ b/tests/data/test510
@@ -9,13 +9,13 @@ HTTP POST
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake swsclose
-Connection: close
-Content-Type: text/html
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
hello
diff --git a/tests/data/test512 b/tests/data/test512
index ce644db6f3..d259f40dff 100644
--- a/tests/data/test512
+++ b/tests/data/test512
@@ -9,7 +9,7 @@ HTTP GET
#
# Server-side
-
+
HTTP/1.1 200 OK swsclose
Date: Thu, 09 Nov 2010 14:49:00 GMT
Server: yes
diff --git a/tests/data/test514 b/tests/data/test514
index a8e66eaad2..ca37a5d659 100644
--- a/tests/data/test514
+++ b/tests/data/test514
@@ -8,18 +8,18 @@ HTTP HEAD
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
-ETag: "21025-dc7-39462498"
-Accept-Ranges: bytes
-Content-Length: 6
-Connection: close
-Content-Type: text/html
-Funny-head: yesyes
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
diff --git a/tests/data/test515 b/tests/data/test515
index d139f29484..526f1e136a 100644
--- a/tests/data/test515
+++ b/tests/data/test515
@@ -8,12 +8,12 @@ HTTP POST
#
# Server-side
-
-HTTP/1.1 200 OK swsclose
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 3
-
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 3
+
OK
diff --git a/tests/data/test516 b/tests/data/test516
index 93f21d6ef1..9bc175bd4c 100644
--- a/tests/data/test516
+++ b/tests/data/test516
@@ -9,12 +9,12 @@ HTTP POST
#
# Server-side
-
-HTTP/1.1 200 OK swsclose
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 3
-
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 3
+
OK
diff --git a/tests/data/test517 b/tests/data/test517
index 7b703b4674..f0cb5a8fd7 100644
--- a/tests/data/test517
+++ b/tests/data/test517
@@ -25,7 +25,7 @@ nothing
#
# Verify data after the test has been "shot"
-
+
0: Sun, 06 Nov 1994 08:49:37 GMT => 784111777
1: Sunday, 06-Nov-94 08:49:37 GMT => 784111777
2: Sun Nov 6 08:49:37 1994 => 784111777
diff --git a/tests/data/test519 b/tests/data/test519
index 1a9768d0e6..b8ca9ab23f 100644
--- a/tests/data/test519
+++ b/tests/data/test519
@@ -9,34 +9,34 @@ HTTP GET
#
# Server-side
-
-HTTP/1.1 200 OK swsbounce
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 8
-
+
+HTTP/1.1 200 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 8
+
content
-HTTP/1.1 200 OK swsclose
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 9
-
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 9
+
content2
-HTTP/1.1 200 OK swsbounce
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 8
-
+HTTP/1.1 200 OK swsbounce
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 8
+
content
-HTTP/1.1 200 OK swsclose
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 9
-
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 9
+
content2
diff --git a/tests/data/test522 b/tests/data/test522
index 5eb114bae4..56d1f3be9a 100644
--- a/tests/data/test522
+++ b/tests/data/test522
@@ -53,7 +53,7 @@ Host: %HOSTIP:%HTTPPORT
Accept: */*
-
+
hello
diff --git a/tests/data/test523 b/tests/data/test523
index 22c421ec4d..7d3db38ef0 100644
--- a/tests/data/test523
+++ b/tests/data/test523
@@ -57,7 +57,7 @@ Accept: */*
Proxy-Connection: Keep-Alive
-
+
hello
diff --git a/tests/data/test535 b/tests/data/test535
index 85515a1b26..6837d2a61a 100644
--- a/tests/data/test535
+++ b/tests/data/test535
@@ -8,23 +8,23 @@ multi
-
-HTTP/1.1 404 Badness
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-ETag: "21025-dc7-39462498"
-Content-Length: 6
-Content-Type: text/html
-Funny-head: yesyes
-
+
+HTTP/1.1 404 Badness
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+ETag: "21025-dc7-39462498"
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
hejsan
-HTTP/1.1 200 Fine
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Content-Length: 13
-Connection: close
-Content-Type: text/html
-
+HTTP/1.1 200 Fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 13
+Connection: close
+Content-Type: text/html
+
fine content
diff --git a/tests/data/test536 b/tests/data/test536
index 51cde158f7..51ac9716f8 100644
--- a/tests/data/test536
+++ b/tests/data/test536
@@ -9,23 +9,23 @@ multi
-
-HTTP/1.1 404 Badness
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-ETag: "21025-dc7-39462498"
-Content-Length: 6
-Content-Type: text/html
-Funny-head: yesyes
-
+
+HTTP/1.1 404 Badness
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+ETag: "21025-dc7-39462498"
+Content-Length: 6
+Content-Type: text/html
+Funny-head: yesyes
+
hejsan
-HTTP/1.1 200 Fine
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Content-Length: 13
-Connection: close
-Content-Type: text/html
-
+HTTP/1.1 200 Fine
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 13
+Connection: close
+Content-Type: text/html
+
fine content
diff --git a/tests/data/test539 b/tests/data/test539
index 593fcac1a7..eaa64d5185 100644
--- a/tests/data/test539
+++ b/tests/data/test539
@@ -8,7 +8,7 @@ FTP
#
# Server-side
-
+
file contents
diff --git a/tests/data/test543 b/tests/data/test543
index df5c1dfbb1..4556330375 100644
--- a/tests/data/test543
+++ b/tests/data/test543
@@ -28,7 +28,7 @@ curl_easy_escape
# There's no MTDM in the protocol here since this code doesn't ask for the
# time/date of the file
-
+
%9C%26K%3DI%04%A1%01%E0%D8%7C%20%B7%EFS%29%FA%1DW%E1
diff --git a/tests/data/test544 b/tests/data/test544
index 963baec78b..78cb5a45e1 100644
--- a/tests/data/test544
+++ b/tests/data/test544
@@ -9,12 +9,12 @@ HTTP POST
#
# Server-side
-
-HTTP/1.1 200 OK swsclose
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Content-Length: 3
-
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 3
+
OK
diff --git a/tests/data/test545 b/tests/data/test545
index 11e3fb9f33..0bba688aef 100644
Binary files a/tests/data/test545 and b/tests/data/test545 differ
diff --git a/tests/data/test549 b/tests/data/test549
index 9ef6ec939c..a248edbf61 100644
--- a/tests/data/test549
+++ b/tests/data/test549
@@ -58,7 +58,7 @@ Accept: */*
Proxy-Connection: Keep-Alive
-
+
hello
diff --git a/tests/data/test550 b/tests/data/test550
index 8fd99a7fd8..a609aa216d 100644
--- a/tests/data/test550
+++ b/tests/data/test550
@@ -58,7 +58,7 @@ Accept: */*
Proxy-Connection: Keep-Alive
-
+
hello
diff --git a/tests/data/test554 b/tests/data/test554
index b08d7741f7..b55fa3d104 100644
--- a/tests/data/test554
+++ b/tests/data/test554
@@ -9,13 +9,13 @@ HTTP POST
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake swsclose
-Connection: close
-Content-Type: text/html
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake swsclose
+Connection: close
+Content-Type: text/html
+
hello
diff --git a/tests/data/test557 b/tests/data/test557
index 3da67e99fc..493cc2289b 100644
--- a/tests/data/test557
+++ b/tests/data/test557
@@ -25,7 +25,7 @@ nothing
#
# Verify data after the test has been "shot"
-
+
All curl_mprintf() unsigned short tests OK!
All curl_mprintf() signed short tests OK!
All curl_mprintf() unsigned int tests OK!
diff --git a/tests/data/test558 b/tests/data/test558
index f8cbfbe8de..7a9ba70619 100644
--- a/tests/data/test558
+++ b/tests/data/test558
@@ -34,7 +34,7 @@ nothing
#
# Verify data after the test has been "shot"
-
+
MEM lib558.c: malloc()
MEM lib558.c: free()
MEM escape.c: malloc()
diff --git a/tests/data/test561 b/tests/data/test561
index 9f437f58d3..a6188eacfe 100644
--- a/tests/data/test561
+++ b/tests/data/test561
@@ -59,7 +59,7 @@ Accept: */*
Proxy-Connection: Keep-Alive
-
+
hello
diff --git a/tests/data/test566 b/tests/data/test566
index 95da61d2d5..9923d8fb80 100644
--- a/tests/data/test566
+++ b/tests/data/test566
@@ -8,18 +8,18 @@ HTTP GET
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
-ETag: "21025-dc7-39462498"
-Accept-Ranges: bytes
-Content-Length: 0
-Connection: close
-Content-Type: text/html
-Funny-head: yesyes
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 0
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
@@ -44,7 +44,7 @@ http://%HOSTIP:%HTTPPORT/566 log/ip566
#
# Verify data after the test has been "shot"
-
+
CL: 0
diff --git a/tests/data/test571 b/tests/data/test571
index bedb5e9201..5e138cdf98 100644
--- a/tests/data/test571
+++ b/tests/data/test571
@@ -83,7 +83,7 @@ rtsp://%HOSTIP:%RTSPPORT/571 log/protofile.txt
-
+
RTP: message size 10, channel 1
RTP: message size 500, channel 0
RTP: message size 196, channel 0
diff --git a/tests/data/test574 b/tests/data/test574
index 1fa4654d4e..c1584480ca 100644
--- a/tests/data/test574
+++ b/tests/data/test574
@@ -82,7 +82,7 @@ EPSV
RETR someothertext.txt
QUIT
-
+
This file should have permissions 444
This file should have permissions 666
This file should have permissions 777
diff --git a/tests/data/test575 b/tests/data/test575
index 5670e6bc63..8133834560 100644
--- a/tests/data/test575
+++ b/tests/data/test575
@@ -100,7 +100,7 @@ EPSV
RETR someothertext.txt
QUIT
-
+
This file should have permissions 444
This file should have permissions 666
This file should have permissions 777
diff --git a/tests/data/test576 b/tests/data/test576
index 4d4b90c803..52a6664f1a 100644
--- a/tests/data/test576
+++ b/tests/data/test576
@@ -34,7 +34,7 @@ ftp://%HOSTIP:%FTPPORT/fully_simulated/UNIX/*
0
-
+
=============================================================
Remains: 14
Filename: .
diff --git a/tests/data/test578 b/tests/data/test578
index 0b6a437316..e4ee4ac17c 100644
--- a/tests/data/test578
+++ b/tests/data/test578
@@ -8,18 +8,18 @@ HTTP POST
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Server: test-server/fake
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
-ETag: "21025-dc7-39462498"
-Accept-Ranges: bytes
-Content-Length: 6
-Connection: close
-Content-Type: text/html
-Funny-head: yesyes
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
-foo-
@@ -45,7 +45,7 @@ http://%HOSTIP:%HTTPPORT/500 log/ip578
#
# Verify data after the test has been "shot"
-
+
PASSED, UL data matched data size
diff --git a/tests/data/test579 b/tests/data/test579
index d21be1be1a..11c81a4287 100644
--- a/tests/data/test579
+++ b/tests/data/test579
@@ -72,7 +72,7 @@ http://%HOSTIP:%HTTPPORT/579 log/ip579
#
# Verify data after the test has been "shot"
-
+
Progress callback called with UL 0 out of 0
Progress callback called with UL 0 out of -1
Progress callback called with UL 8 out of -1
diff --git a/tests/data/test584 b/tests/data/test584
index 582a91120b..309c7b65b1 100644
--- a/tests/data/test584
+++ b/tests/data/test584
@@ -11,31 +11,31 @@ multi
# Silly division of the first request is solely to appease the server which expects n_data_items == n_requests
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 4
-
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 4
+
584
-HTTP/1.1 200 OK
+HTTP/1.1 200 OK
-Server: test-server/fake
+Server: test-server/fake
-Content-Length: 0
-
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 5
-
+Content-Length: 0
+
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 5
+
585
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 4
-
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 4
+
586
@@ -76,26 +76,26 @@ Host: %HOSTIP:%HTTPPORT
Accept: */*
-
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 4
-
+
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 4
+
584
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 0
-
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 5
-
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 0
+
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 5
+
585
-HTTP/1.1 200 OK
-Server: test-server/fake
-Content-Length: 4
-
+HTTP/1.1 200 OK
+Server: test-server/fake
+Content-Length: 4
+
586
diff --git a/tests/data/test598 b/tests/data/test598
index f43bbacd04..11a0dbc3c6 100644
--- a/tests/data/test598
+++ b/tests/data/test598
@@ -12,31 +12,31 @@ curl_easy_reset
#
# Server-side
-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Content-Length: 6
-Connection: close
-Content-Type: text/html
-
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
-foo-
# since the request runs twice
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Content-Length: 6
-Connection: close
-Content-Type: text/html
-
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
-foo-
-HTTP/1.1 200 OK
-Date: Thu, 09 Nov 2010 14:49:00 GMT
-Content-Length: 6
-Connection: close
-Content-Type: text/html
-
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
-foo-
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
index 253acb21dd..9ab7dc7583 100644
--- a/tests/libtest/first.c
+++ b/tests/libtest/first.c
@@ -22,7 +22,15 @@
#include "test.h"
#ifdef HAVE_LOCALE_H
-#include /* for setlocale() */
+# include /* for setlocale() */
+#endif
+
+#ifdef HAVE_IO_H
+# include /* for setmode() */
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include /* for setmode() */
#endif
#ifdef CURLDEBUG
@@ -98,6 +106,14 @@ int main(int argc, char **argv)
{
char *URL;
+#ifdef O_BINARY
+# ifdef __HIGHC__
+ _setmode(stdout, O_BINARY);
+# else
+ setmode(fileno(stdout), O_BINARY);
+# endif
+#endif
+
memory_tracking_init();
/*