Commit Graph

91 Commits

Author SHA1 Message Date
Daniel Stenberg 0aedccc18a curl_formget: fix FILE * leak
Properly deal with the fact that the last fread() call most probably is
a short read, and when using callbacks in fact all calls can be short
reads. No longer consider a file read done until it returns a 0 from the
read function.

Reported by: Aaron Orenstein
Bug: http://curl.haxx.se/mail/lib-2011-06/0048.html
2011-06-13 22:32:00 +02:00
Dan Fandrich b688f2c260 Fixed test 1309 to pass the torture test
Removing dynamic allocations also simplifies the test.
2011-06-11 00:10:09 -07:00
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
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
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 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
Julien Chaffraix 8702ebff74 unit1305: Fixed the test to match our coding style. 2011-03-20 08:03:25 -07: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
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
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
Guenter Knauf 73b518f269 Fixed C++ style comment not allowed in ISO C90. 2011-01-22 09:52:09 +01:00
Amr Shahin 77f0fcae0e unittest: add 3 tests to test1300
Testing Curl_llist_insert_next
2011-01-20 23:16:30 +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 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 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 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