aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
AgeCommit message (Collapse)Author
2016-04-18checksrc/makefile.am: use $top_srcdir to find source filesDaniel Stenberg
... to properly support out of source tree builds.
2016-04-03tests: Fixed header files to comply with our code styleSteve Holme
2016-04-03code: style updatesDaniel Stenberg
2016-04-03unit: make unit test source code checksrc compliantDaniel Stenberg
2016-04-03checksrc: run checksrc in tests when 'make checksrc' in rootDaniel Stenberg
2016-04-03unit1604: fix snprintfDaniel Stenberg
follow-up to 0326b06 sizeof(pointer) is no good for the buffer size! Reported-by: Viktor Szakats
2016-04-03unittests: Fixed compilation warningsSteve Holme
warning: implicit declaration of function 'sprintf_was_used' [-Wimplicit-function-declaration] Follow up to the modications made to tests/libtest in commit 55452ebdff as we prefer not to use sprintf() now.
2016-02-09tool_doswin: Support for literal path prefix \\?\Jay Satiro
For example something like --output \\?\C:\foo
2016-02-05unit1604: Fix unit setup return codeJay Satiro
2016-02-05tool_doswin: Improve sanitization processingJay Satiro
- Add unit test 1604 to test the sanitize_file_name function. - Use -DCURL_STATICLIB when building libcurltool for unit testing. - Better detection of reserved DOS device names. - New flags to modify sanitize behavior: SANITIZE_ALLOW_COLONS: Allow colons SANITIZE_ALLOW_PATH: Allow path separators and colons SANITIZE_ALLOW_RESERVED: Allow reserved device names SANITIZE_ALLOW_TRUNCATE: Allow truncating a long filename - Restore sanitization of banned characters from user-specified outfile. Prior to this commit sanitization of a user-specified outfile was temporarily disabled in 2b6dadc because there was no way to allow path separators and colons through while replacing other banned characters. Now in such a case we call the sanitize function with SANITIZE_ALLOW_PATH which allows path separators and colons to pass through. Closes https://github.com/curl/curl/issues/624 Reported-by: Octavio Schroeder
2016-02-03URLs: change all http:// URLs to https://Daniel Stenberg
2016-02-02dotdot: allow an empty input string tooDaniel Stenberg
It isn't used by the code in current conditions but for safety it seems sensible to at least not crash on such input. Extended unit test 1395 to verify this too as well as a plain "/" input.
2015-11-12unit1603: Demote hash mismatch failure to a warningdfandrich
The hashes can vary between architectures (e.g. Sparc differs from x86_64). This is not a fatal problem but just reduces the coverage of these white-box tests, as the assumptions about into which hash bucket each key falls are no longer valid.
2015-11-12unit1603: Added unit tests for hash functionsdfandrich
2015-11-12unit1602: Fixed failure in torture testdfandrich
2015-10-16test1601: fix compilation with --enable-debug and --disable-crypto-authDan Fandrich
2015-05-18hostip: fix unintended destruction of hash tableAnthony Avina
.. and added unit1602 for hash.c
2015-05-12hostcache: made all host caches use structs, not pointersDaniel Stenberg
This avoids unnecessary dynamic allocs and as this also removed the last users of *hash_alloc() and *hash_destroy(), those two functions are now removed.
2015-04-22tests/unit/.gitignore: hide unit1601 and above, tooKamil Dudka
2015-04-03fix refreshing of obsolete dns cache entriesStefan Bühler
- cache entries must be also refreshed when they are in use - have the cache count as inuse reference too, freeing timestamp == 0 special value - use timestamp == 0 for CURLOPT_RESOLVE entries which don't get refreshed - remove CURLOPT_RESOLVE special inuse reference (timestamp == 0 will prevent refresh) - fix Curl_hostcache_clean - CURLOPT_RESOLVE entries don't have a special reference anymore, and it would also release non CURLOPT_RESOLVE references - fix locking in Curl_hostcache_clean - fix unit1305.c: hash now keeps a reference, need to set inuse = 1
2015-03-16Bug #149: Deletion of unnecessary checks before calls of the function "free"Markus Elfring
The function "free" is documented in the way that no action shall occur for a passed null pointer. It is therefore not needed that a function caller repeats a corresponding check. http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first This issue was fixed by using the software Coccinelle 1.0.0-rc24. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2015-03-05openssl: remove all uses of USE_SSLEAYDaniel Stenberg
SSLeay was the name of the library that was subsequently turned into OpenSSL many moons ago (1999). curl does not work with the old SSLeay library since years. This is now reflected by only using USE_OPENSSL in code that depends on OpenSSL.
2015-02-04unit1600: Fix compilation when NTLM is disabledDan Fandrich
2015-02-03unit1601: MD5 unit testsDaniel Stenberg
2015-02-03unit1600: unit test for Curl_ntlm_core_mk_nt_hashDaniel Stenberg
2015-02-03unit1600: NTLM unit testDaniel Stenberg
2014-10-13vtls: remove QsoSSLPatrick Monnerat
2014-07-25Curl_base64url_encode: unit-tested in 1302Daniel Stenberg
2014-07-12Fixed some "statement not reached" warningsDan Fandrich
2014-05-15timers: fix timer regression involving redirects / reconnectsDaniel Stenberg
In commit 0b3750b5c23c25f (released in 7.36.0) we fixed a timeout issue but instead broke the timings. To fix this, I introduce a new timestamp to use for the timeouts and restored the previous timestamp and timestamp position so that the old timer functionality is restored. In addition to that, that change also broke connection timeouts for when more than one connect was used (as it would then count the total time from the first connect and not for the most recent one). Now Curl_timeleft() has been modified so that it checks against different start times depending on which timeout it checks. Test 1303 is updated accordingly. Bug: http://curl.haxx.se/mail/lib-2014-05/0147.html Reported-by: Ryan Braud
2014-05-04mprintf: allow %.s with data not being zero terminatedDaniel Stenberg
If the precision is indeed shorter than the string, don't strlen() to find the end because that's not how the precision operator works. I also added a unit test for curl_msnprintf to make sure this works and that the fix doesn't a few other basic use cases. I found a POSIX compliance problem that I marked TODO in the unit test, and I figure we need to add more tests in the future. Reported-by: Török Edwin
2014-04-28copyright: Updated following recent editsSteve Holme
2014-04-29Added a few more const where possibleDan Fandrich
2014-04-28unit1395: Fixed null pointer dereference on torture testDan Fandrich
2014-03-26test1397: Fixed compilation with some SSL backendsDan Fandrich
The test is only valid when one of four SSL backends is in use, and must otherwise return success.
2014-03-25test1397: unit test for certificate name wildcard handlingRichard J. Moore
2014-01-28unit1304: make the test pass the OOM torture testsDan Fandrich
2014-01-28unit1396: make the test pass the OOM torture testsDan Fandrich
2014-01-03unittests: do not include curl_memory.hMarc Hoersken
memdebug.h already contains all required definitions and including curl_memory.h causes errors like the following: tests/unit/unit1394.c:119: undefined reference to `Curl_cfree' tests/unit/unit1394.c:120: undefined reference to `Curl_cfree'
2013-12-01base64: Extended validation to look for invalid charactersSteve Holme
Extended the basic validation in commit e17c1b25bc33eb to return a failure when invalid base64 characters are included.
2013-10-30base64: Added basic validation to base64 input string when decodingSteve Holme
A base64 string should be a multiple of 4 characters in length, not contain any more than 2 padding characters and only contain padding characters at the end of string. For example: Y3VybA== Strings such as the following are considered invalid: Y= - Invalid length Y== - Invalid length Y=== - More than two padding characters Y=x= - Padding character contained within string
2013-08-29unit1304: include memdebug and free everything correctlyDaniel Stenberg
2013-08-20netrc: handle longer username and passwordJonathan Nieder
libcurl truncates usernames and passwords it reads from .netrc to LOGINSIZE and PASSWORDSIZE (64) characters without any indication to the user, to ensure the values returned from Curl_parsenetrc fit in a caller-provided buffer. Fix the interface by passing back dynamically allocated buffers allocated to fit the user's input. The parser still relies on a 256-character buffer to read each line, though. So now you can include an ~246-character password in your .netrc, instead of the previous limit of 63 characters. Reported-by: Colby Ranger
2013-06-22dotdot: introducing dot file path cleanupDaniel Stenberg
RFC3986 details how a path part passed in as part of a URI should be "cleaned" from dot sequences before getting used. The described algorithm is now implemented in lib/dotdot.c with the accompanied test case in test 1395. Bug: http://curl.haxx.se/bug/view.cgi?id=1200 Reported-by: Alex Vinnik
2013-06-22unit1396: unit tests to verify curl_easy_(un)escapeDaniel Stenberg
2013-05-06build: fixed unit1394 for debug and metlink buildsDaniel Stenberg
2013-05-06unit1394.c: plug the curl tool unit test inKamil Dudka
2013-05-06unit1394.c: basis of a unit test for parse_cert_parameter()Jared Jennings
2013-05-06src/Makefile.am: build static lib for unit tests if enabledKamil Dudka
2013-03-15unit1330.c: fix dateYang Tse