1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

2352 Commits

Author SHA1 Message Date
Daniel Stenberg
c4dd8df081 splay: add unit tests
The test code that was #ifdef'ed in the code was converted into unit
tests in test case 1309. I also removed the #if 0'ed code from splay.c
2011-06-10 20:19:35 +02:00
Daniel Stenberg
36a22f9074 unit test formpost: added test case 1308
This is a few first rather basic tests of curl_formadd() and
curl_formget(). Should serve as building blocks to add more variations
to the test.
2011-06-10 12:03:29 +02:00
Daniel Stenberg
c0b9dd27b5 HTTP time condition: force closure for 200 OK
When a time condition isn't met, so that no body is delivered to the
application even though a 2xx response is being read from the server, we
must close the connection to avoid a re-use of the connection to be
completely tricked.

Added test 1128 to verify.
2011-06-07 13:40:11 +02:00
Yang Tse
2a31dde76c unit tests: attempt to fix linkage issue 2011-06-02 22:26:01 +02:00
Yang Tse
aa76dec33a unit tests: more build adjustments 2011-06-01 21:40:09 +02:00
Yang Tse
685359d4c3 makefile: avoid preprocessor definition usage when linking 2011-06-01 14:43:25 +02:00
Daniel Stenberg
3d64ed25df testcurl.pl: allow configure args to use '=' 2011-05-31 13:35:26 +02:00
Yang Tse
f5d78919af distribution: Fix EXTRA_DIST letter case 2011-05-27 13:37:20 +02:00
Yang Tse
5d39dea3b3 compiler warning: fix
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored
2011-05-26 12:40:04 +02:00
Yang Tse
9f390a356e unit tests: build adjustment
Also define UNITTESTS macro when building unit test sources.

Fixing compiler warning: external definition with no prior declaration
2011-05-25 20:24:03 +02:00
Yang Tse
9b5343054a unit tests: README, adjust header inclusion order 2011-05-24 21:23:52 +02:00
Yang Tse
ec33742d1b compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:35:08 +02:00
Yang Tse
2ea31b0e6f compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:29:50 +02:00
Yang Tse
de70ddb749 compiler warning: fix
Fix compiler warning: argument is incompatible with corresponding format
string conversion
2011-05-24 17:24:59 +02:00
Yang Tse
8b849265d8 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:39:42 +02:00
Yang Tse
02f3ff3b0a unit tests: adjust header inclusion order
Additionally, prevent multiple inclusions of curl_config.h
2011-05-21 13:22:11 +02:00
Yang Tse
b578534508 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585: Fix opensocket return type, and avoid function name clash.
2011-05-19 22:28:28 +02:00
Daniel Stenberg
873d70a6d8 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585 and 586 were added. Using a modified lib500.c
2011-05-18 22:56:46 +02:00
Daniel Stenberg
0c8e6f598a tests: added HTTP If-Modified-Since tests
Added test 1126 and 1127 to verify curl's behaviour when If-Modified-Since
is used and a 200 is returned.

The list of test cases in Makefile.am is now sorted numerically.
2011-05-13 08:55:15 +02:00
Daniel Stenberg
3b1b26578f proxy: allow socks:// prefix in proxy string
Inspired by a patch from OB.Conseil. Added test case 708 to verify.
2011-04-28 15:08:09 +02:00
Daniel Stenberg
4a42e5cdaa multi-socks: fix connect to proxy
When connecting to a socks or similar proxy we do the proxy handshake at
once when we know the TCP connect is completed and we only consider the
"connection" complete after the proxy handshake. This fixes test 564
which is now no longer considered disabled.

Reported by: Dmitri Shubin
Bug: http://curl.haxx.se/mail/lib-2011-04/0127.html
2011-04-28 10:06:49 +02:00
Dan Fandrich
d8373cb992 Fixed test 1023 when using daily snapshots 2011-04-21 14:47:35 -07:00
Dan Fandrich
7872c8d5a2 Fixed closing test tag 2011-04-20 16:51:44 -07:00
Dan Fandrich
1b6df743f6 Fixed test 1022 when using daily snapshots 2011-04-20 14:11:12 -07:00
Daniel Stenberg
8e4fb01e64 transfer-encoding: added new option and cmdline
Added CURLOPT_TRANSFER_ENCODING as the option to set to request Transfer
Encoding in HTTP requests (if built zlib enabled). I also renamed
CURLOPT_ENCODING to CURLOPT_ACCEPT_ENCODING (while keeping the old name
around) to reduce the confusion when we have to encoding options for
HTTP.

--tr-encoding is now the new command line option for curl to request
this, and thus I updated the test cases accordingly.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
9d191a6a40 TE: do the Connection: header
When TE: is inserted in the request, we must add a "Connection: TE" as
well to be HTTP 1.1 compliant. If a custom Connection: header is passed
in, we must use that and only append TE to it. Test case 1125 verifies
TE: + custom Connection:.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
be973b6f91 test1124: verify gzip AND chunked transfer-encoding 2011-04-18 19:46:21 +02:00
Daniel Stenberg
0790b27910 HTTP: add support for gzip and deflate Transfer-Encoding
Transfer-Encoding differs from Content-Encoding in a few subtle ways,
but primarily it concerns the transfer only and not the content so when
discovered to be compressed we know we have to uncompress it. There will
only arrive compressed transfers in a response after we have requested
them with the appropriate TE: header.

Test case 1122 and 1123 verify.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
82ecc85d9e curl-config: fix --version
curl-config --version didn't output the correct version string (bug
introduced in commit 0355e33b5f), and unfortunately the test
case 1022 that was supposed to check for this was broken.

This change fixes the test to detect this problem and it fixes the
output.

Bug: http://curl.haxx.se/bug/view.cgi?id=3288727
2011-04-18 09:03:12 +02:00
Chris Smowton
d54668eb00 HTTP pipelining: Fix handling of zero-length responses
Also add test case 584 for the same

Bug: http://curl.haxx.se/bug/view.cgi?id=3214223
2011-04-07 14:18:07 +02:00
Dan Fandrich
c22c258029 Changed some nonportable types 2011-04-05 22:31:45 -07:00
Daniel Stenberg
9680df4807 headers: more copyright headers added 2011-03-22 22:48:11 +01:00
Julien Chaffraix
8702ebff74 unit1305: Fixed the test to match our coding style. 2011-03-20 08:03:25 -07:00
Dan Fandrich
7f57fb359d Added two more POP3 tests 2011-03-18 13:59:48 -07:00
Daniel Stenberg
4b51484a68 symbol-scan.pl: detect duplicates
Test 1119 now also makes sure that symbols-in-versions doesn't contain
any duplicates
2011-03-18 15:42:58 +01:00
Dan Fandrich
ef1c18b952 Added support for LISTing a single POP3 message
Added tests for a number of POP3 LIST operations, including one
that shows a curl problem when listing no messages, so is
disabled.
2011-03-17 16:59:30 -07:00
Daniel Stenberg
14e8b13a45 lib582: use curl_socket_t for portability 2011-03-15 18:37:35 +01:00
Guenter Knauf
5a433a033f Removed unused var. 2011-03-15 12:21:58 +01:00
Daniel Stenberg
6c5448d59f test 582: enabled again
Commit ca37692bf4 should now hopefully make it run
2011-03-13 14:11:48 +01:00
Daniel Stenberg
e649a7baae Revert "test582: enabled"
This reverts commit b847818740.
2011-03-13 00:55:27 +01:00
Daniel Stenberg
0718b7e31e test583: verify early SSH multi remove handle
This test case is meant to verify that the logic in commit
60172a0446 actually works. This test failed for me before that
change and it works after it.
2011-03-13 00:18:04 +01:00
Daniel Stenberg
b847818740 test582: enabled 2011-03-12 23:10:58 +01:00
Daniel Stenberg
7612ca2a7e test582: improved info messages 2011-03-12 23:01:16 +01:00
Daniel Stenberg
1aeb635cdd sources: update source headers
All C and H files now (should) feature the proper project curl source
code header, which includes basic info, a copyright statement and some
basic disclaimers.
2011-03-10 12:04:33 +01:00
Daniel Stenberg
08221e738d tests: phase out haxx.se
Instead of using haxx.se as a fixed magic host name in lots of tests,
this is a first step to move toward the generic example.com host
instead.
2011-03-09 23:05:44 +01:00
Daniel Stenberg
16dcd13a2a test523: avoid using haxx.se
... since search engines find what they think is a URL in this, they
hammer www.haxx.se on this port!
2011-03-09 23:05:44 +01:00
Daniel Stenberg
3d3735d9a1 lib582: used for test 582
Accidentally not included in commit 0e74e1d8d8
2011-03-08 08:22:06 +01:00
Henry Ludemann
0e74e1d8d8 sftp-multi: test 582 added
Add test 582 for uploading a file using sftp and the multi interface.

(Patch and test slightly tweaked by Daniel Stenberg)

Initially marked as disabled until it is fixed in the source.
2011-03-08 00:20:48 +01:00
Dan Fandrich
c60a6153be Moved test 577 into the unit test framework as test 1307 2011-03-04 15:56:40 -08:00
Dan Fandrich
80225b08cd Added unit test 1306 so tests 558 & 559 are now fully replaced 2011-03-04 15:13:12 -08:00
Dan Fandrich
bfc491a2d2 The unit test argument is allowed to be used 2011-03-04 15:11:21 -08:00
Dan Fandrich
fb199cd29d Converted tests 558 & 559 to use the unit test framework as 1305
Test 558 was just a subset of 559 which is something that can be
easily added later.
2011-03-04 14:32:58 -08:00
Dan Fandrich
a8aab6e7d4 Fixed test 1300 to pass the torture test 2011-03-04 13:54:04 -08:00
Dan Fandrich
32aedf1d3d Added abort_* unit test macros
These are for when a test failure makes it impossible to continue
running further tests.
2011-03-04 13:53:15 -08:00
Daniel Stenberg
2345c1dd66 runtests.pl/stopserver: space separate pids
The stopserver function would append pids to kill and could append them
without separating them with space properly. The result would be a very
large number that by (some implementations of) kill would be interpreted
as a negative number and that process group would be wiped...

Bug: http://curl.haxx.se/bug/view.cgi?id=3188836
Reported by: Greg Pratt
2011-02-22 13:42:00 +01:00
Julien Chaffraix
9f8e960a1a tests: Cleaned up netrc testing.
Removed the "netrc_debug" keyword replaced with --netrc-file additions.
Removed the debug code from Curl_parsenetrc as it is superseeded by
--netrc-file.
2011-02-20 21:11:52 -08:00
Julien Chaffraix
311bd4c7b1 netrc: Enable setting up the filename in unit tests.
Unset the environment variable so that we can specify different
filenames in the unit test.
2011-02-10 07:38:48 -08:00
Julien Chaffraix
39d0d787d2 test1304: Added some unit tests for Curl_parsenetrc.
Moved some definitons into the header file so that we can reuse them.
2011-02-10 07:38:48 -08:00
Daniel Stenberg
08a77025c6 unit1300: code style cleanup 2011-02-02 13:35:55 +01:00
Amr Shahin
7a4b5079c6 adding unit tests for Curl_llist_remove 2011-02-02 13:24:04 +01:00
Daniel Stenberg
28c830efd8 test: add test 580 to the dist 2011-01-28 00:24:47 +01:00
Daniel Stenberg
20690e412d tests: more multiple headers checks 2011-01-25 18:09:54 +01:00
Daniel Stenberg
dbcaa00657 HTTP: memory leak on multiple Location:
The HTTP parser allocated memory on each received Location: header
without properly freeing old data. Starting now, the code only considers
the first Location: header and will blissfully ignore subsequent ones.

Bug: http://curl.haxx.se/bug/view.cgi?id=3165129
Reported by: Martin Lemke
2011-01-25 12:06:50 +01:00
Guenter Knauf
73b518f269 Fixed C++ style comment not allowed in ISO C90. 2011-01-22 09:52:09 +01:00
Dan Fandrich
3427bece89 Mention axTLS in some more documentation 2011-01-21 14:27:10 -08:00
Daniel Stenberg
e79c1e39e9 runtests.pl: make -s not show skipped tests 2011-01-20 23:17:22 +01:00
Amr Shahin
77f0fcae0e unittest: add 3 tests to test1300
Testing Curl_llist_insert_next
2011-01-20 23:16:30 +01:00
Daniel Stenberg
511031c8d8 dist: add new certs to tarball 2011-01-19 21:02:54 +01:00
Quinn Slack
59cf93ccdb TLS-SRP: support added when using GnuTLS 2011-01-19 20:35:02 +01:00
Dan Fandrich
ebb9c7ae04 Made unit_setup() return an error code to abort the test early
This makes it possible to skip the call to unit_stop() in such
cases.  Also use Curl_safefree() in unit test 1302 so it will
pass the memory torture test.
2011-01-05 23:53:24 -08:00
Daniel Stenberg
e21b103c3e tests: <info> tag corrections 2011-01-04 23:13:10 +01:00
Daniel Stenberg
0029b2f042 unittest: 1303 tests Curl_timeleft
I came up with 33 different ways to call it and verify that it returns the
correct return code.
2011-01-04 23:13:10 +01:00
Daniel Stenberg
7c5d888ea6 curlcheck.h: add fail()
fail is a new function/macro that a test case can use to indicate a test
failure for cases when the standard macros are not sufficient.
2011-01-04 23:13:10 +01:00
Dan Fandrich
a2c8966d50 Fixed path to allow out-of-tree builds 2011-01-04 12:59:44 -08:00
Daniel Stenberg
1e52ea92eb ignore: all executable unit test cases 2011-01-04 16:51:41 +01:00
Daniel Stenberg
28888a0b41 tests: add 1302 to the package 2011-01-04 16:50:59 +01:00
Daniel Stenberg
1022e754f4 unittest: test base64 encode/decode 2011-01-04 16:42:31 +01:00
Daniel Stenberg
703573c72b curlcheck.h: avoid using NULL pointers 2011-01-04 16:41:42 +01:00
Daniel Stenberg
7af54ef9a5 curlcheck.h: add verify_memory
This check verifies that a pointer contains the correct data.
2011-01-04 16:31:54 +01:00
Daniel Stenberg
1602ed6ba1 curlcheck.h: add newlines in error messages 2011-01-04 16:14:23 +01:00
Daniel Stenberg
9e46318a03 unittest: verify curl_strequal 2011-01-04 16:13:58 +01:00
Daniel Stenberg
83e9fb21aa curlcheck.h: add fail_if() fix code
The UNITTEST_START and UNITTEST_STOP defines needed to do a new brace
level so that test cases can declare variables fine and still remain
fine C89 code.
2011-01-03 23:47:34 +01:00
Daniel Stenberg
5c42b2ceae unittests: basic docs 2011-01-03 23:47:13 +01:00
Daniel Stenberg
82aa386732 ignore: unit test files 2011-01-03 22:52:50 +01:00
Daniel Stenberg
c43ad0f972 unittests: a dedicated feature in tests
The test runner script now knows if unittests can run and the unit test
setup file says it is one. I also made runtests.pl deal with no
<command> tag set, so that the description file can get even simpler.
2011-01-03 22:42:46 +01:00
Daniel Stenberg
53640a3ce0 unittesting: build a separate static lib
When configure --enable-debug has been used, all files in lib/ are now
built twice and a separate static library crafted for unit-testing will
be linked. The unit tests in the tests/unit subdir will use that
library.
2011-01-03 22:16:16 +01:00
Daniel Stenberg
35e1d6538a unittest: framework for unit-testing
This is the first approach at doing fairly clean and easy to write and
debug unit tests.
2011-01-03 19:38:10 +01:00
Yang Tse
15aeb94f3f test harness: take in account that Windows does not support LD_PRELOAD
configure.ac: Test harness libhostname library will not be built for Windows.

runtests.pl: LD_PRELOAD mechanism will not be used to load libhostname
library on operating systems which lack LD_PRELOAD support.
2010-12-28 16:52:20 +01:00
Daniel Stenberg
49465fffdb cookies: tricked dotcounter fixed
Providing multiple dots in a series in the domain field (domain=..com) could
trick the cookie engine to wrongly accept the cookie believing it to be
fine. Since the tailmatching would then match all .com sites, the cookie would
then be sent to all of them.

The code now requires at least one letter between each dot for them to be
counted. Edited test case 61 to verify this.
2010-12-23 22:52:32 +01:00
Daniel Stenberg
e6d99f4ba7 SMTP tests: updated MAIL FROM use
They were all wrong previously since none used the <brackets> they
should for MAIL FROM. Now libcurl adds them itself if the app doesn't so
they end up wrong less easy.
2010-12-22 14:53:13 +01:00
Paul Howarth
1df74d886d tftpd: avoid buffer overflow report from glibc 2010-12-17 19:08:43 +01:00
Yang Tse
f6ebae65d6 axTLS integration: silence runtests.pl perl warning 2010-12-16 17:33:53 +01:00
Eric Hu
a7cf30f808 Minor fixes to pass tests 301 and 306 with a patched axTLS. 2010-12-15 16:05:17 +01:00
Eric Hu
be312336f6 Initial axTLS integration. Connections can be made and some tests pass.
Failed HTTPS tests: 301, 306, 311, 312, 313, 560
311, 312 need more detailed error reporting from axTLS.
313 relates to CRL, which hasn't been implemented yet.
2010-12-15 16:05:17 +01:00
Yang Tse
34127c7adc sws: fix compier warning: external definition with no prior declaration 2010-12-06 14:51:44 +01:00
Yang Tse
07f60235b0 fix compiler warning: rounding, sign extension, or loss of accuracy may result 2010-12-02 18:46:13 +01:00
Yang Tse
5db0a412ff atoi: remove atoi usage 2010-11-28 23:11:14 +01:00
Yang Tse
ef24ecde68 symbol-scan: use configure script knowledge about how to run the C preprocessor 2010-11-25 21:05:20 +01:00
Yang Tse
e8bc33d0a3 ignore file generated by configure 2010-11-25 13:34:47 +01:00
Dan Fandrich
1bb05ac16f Check for errors while preprocessing curl.h in test 1119
This showed a problem when running the test out-of-tree, so
an include path is now being added to pick up the generated
curlbuild.h file.
2010-11-19 15:54:21 -08:00