aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
AgeCommit message (Collapse)Author
2017-05-01tests: declare TU-local variables staticMarcel Raad
This fixes missing-variable-declarations warnings when building with clang.
2017-04-30unit1604: fixed indentationDan Fandrich
2017-04-30unit1604: fixed compilation under Windows, broken in the previous commitDan Fandrich
2017-04-30tests: fixed OOM handling of unit tests to abort testDan Fandrich
It's dangerous to continue to run the test when a memory alloc fails.
2017-04-22llist: no longer uses mallocDaniel Stenberg
The 'list element' struct now has to be within the data that is being added to the list. Removes 16.6% (tiny) mallocs from a simple HTTP transfer. (96 => 80) Also removed return codes since the llist functions can't fail now. Test 1300 updated accordingly. Closes #1435
2017-04-16unit1303: fix compiler warningMarcel Raad
MinGW-w64 complains: warning: conversion to 'long int' from 'time_t {aka long long int}' may alter its value [-Wconversion] Fix this by using the correct type.
2017-04-06test1606: verify speedcheckDaniel Stenberg
2017-04-04tests: added test for Curl_splaygetbest to unit1309Dániel Bakai
This checks the new behavior of Curl_splaygetbest, so that the smallest node not larger than the key is removed, and FIFO behavior is kept even when there are multiple nodes with the same key. Closes #1358
2017-04-04multi: fix queueing of pending easy handlesDániel Bakai
Multi handles repeatedly invert the queue of pending easy handles when used with CURLMOPT_MAX_TOTAL_CONNECTIONS. This is caused by a multistep process involving Curl_splaygetbest and violates the FIFO property of the multi handle. This patch fixes this issue by redefining the "best" node in the context of timeouts as the "smallest not larger than now", and implementing the necessary data structure modifications to do this effectively, namely: - splay nodes with the same key are now stored in a doubly-linked circular list instead of a non-circular one to enable O(1) insertion to the tail of the list - Curl_splayinsert inserts nodes with the same key to the tail of the same list - in case of multiple nodes with the same key, the one on the head of the list gets selected
2017-04-04llist: replace Curl_llist_alloc with Curl_llist_initDaniel Stenberg
No longer allocate the curl_llist head struct for lists separately. Removes 17 (15%) tiny allocations in a normal "curl localhost" invoke. closes #1381
2017-03-26spelling fixesklemens
Closes #1356
2017-03-14build: removed redundant DEPENDENCIES from makefilesDan Fandrich
2016-12-14checksrc: warn for assignments within if() expressionsDaniel Stenberg
... they're already frowned upon in our source code style guide, this now enforces the rule harder.
2016-12-13checksrc: stricter no-space-before-paren enforcementDaniel Stenberg
In order to make the code style more uniform everywhere
2016-11-24checksrc: move open braces to comply with function declaration styleDaniel Stenberg
2016-11-24checksrc: white space edits to comply to stricter checksrcDaniel Stenberg
2016-11-24checksrc: code style: use 'char *name' styleDaniel Stenberg
2016-11-04dist: add CMakeLists.txt to the tarballJakub Zakrzewski
2016-10-31unit1301: keep testing curl_strequalDaniel Stenberg
as that is still part of the API, fix from 8fe4bd084412f30
2016-10-31strcasecompare: is the new name for strequal()Daniel Stenberg
... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
2016-09-14test1605: verify negative input lengths to (un)escape functionsDaniel Stenberg
2016-09-10CMake: Don't build unit tests if private symbols are hiddenJakub Zakrzewski
This only excludes building unit tests from default build ( 'all' Make target or "Build Solution" in VisualStudio). The projects and Make targets will still be generated and shown in supporting IDEs. Fixes https://github.com/curl/curl/issues/981 Reported-by: Randy Armstrong Closes https://github.com/curl/curl/pull/990
2016-06-22internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg
2016-06-21cmake: now using BUILD_TESTING=ON/OFFSergei Nikulov
CMake build now using BUILD_TESTING=ON/OFF (default is OFF) to build tests and enabling CTest integration. Options BUILD_CURL_TESTS and BUILD_DASHBOARD_REPORTS was removed. Closes #882 Reviewed-by: Brad King
2016-04-19make/checksrc: use $srcdir, not $top_srcdirDaniel Stenberg
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