summaryrefslogtreecommitdiff
path: root/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* dedotdot: fixed output for ".." and "." only inputDaniel Stenberg2017-06-031-1/+8
| | | | | | | Found when updating test 1395, which I did to increase test coverage of this source file... Closes #1535
* tests: fix -Wcast-qual warningsMarcel Raad2017-05-052-4/+5
| | | | Avoid casting string literals to non-const char *.
* unit1305: fix compiler warningMarcel Raad2017-05-051-5/+2
| | | | calloc and ai_addrlen expect different (usually unsigned) types.
* unit1606: do not print/access bufferDaniel Stenberg2017-05-011-1/+0
| | | | It was a wrong assumption that it could do that!
* tests: declare TU-local variables staticMarcel Raad2017-05-012-2/+2
| | | | | This fixes missing-variable-declarations warnings when building with clang.
* unit1604: fixed indentationDan Fandrich2017-04-301-12/+12
|
* unit1604: fixed compilation under Windows, broken in the previous commitDan Fandrich2017-04-301-14/+19
|
* tests: fixed OOM handling of unit tests to abort testDan Fandrich2017-04-304-4/+6
| | | | It's dangerous to continue to run the test when a memory alloc fails.
* llist: no longer uses mallocDaniel Stenberg2017-04-221-72/+57
| | | | | | | | | | | | 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
* unit1303: fix compiler warningMarcel Raad2017-04-161-2/+2
| | | | | | | 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.
* test1606: verify speedcheckDaniel Stenberg2017-04-062-1/+94
|
* tests: added test for Curl_splaygetbest to unit1309Dániel Bakai2017-04-041-3/+35
| | | | | | | | 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
* multi: fix queueing of pending easy handlesDániel Bakai2017-04-041-1/+1
| | | | | | | | | | | | | | | | | | 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
* llist: replace Curl_llist_alloc with Curl_llist_initDaniel Stenberg2017-04-041-57/+50
| | | | | | | | No longer allocate the curl_llist head struct for lists separately. Removes 17 (15%) tiny allocations in a normal "curl localhost" invoke. closes #1381
* spelling fixesklemens2017-03-261-2/+2
| | | | Closes #1356
* build: removed redundant DEPENDENCIES from makefilesDan Fandrich2017-03-141-3/+0
|
* checksrc: warn for assignments within if() expressionsDaniel Stenberg2016-12-141-3/+6
| | | | | ... they're already frowned upon in our source code style guide, this now enforces the rule harder.
* checksrc: stricter no-space-before-paren enforcementDaniel Stenberg2016-12-131-1/+1
| | | | In order to make the code style more uniform everywhere
* checksrc: move open braces to comply with function declaration styleDaniel Stenberg2016-11-242-23/+24
|
* checksrc: white space edits to comply to stricter checksrcDaniel Stenberg2016-11-242-2/+2
|
* checksrc: code style: use 'char *name' styleDaniel Stenberg2016-11-241-3/+3
|
* dist: add CMakeLists.txt to the tarballJakub Zakrzewski2016-11-041-1/+1
|
* unit1301: keep testing curl_strequalDaniel Stenberg2016-10-311-7/+7
| | | | as that is still part of the API, fix from 8fe4bd084412f30
* strcasecompare: is the new name for strequal()Daniel Stenberg2016-10-311-8/+8
| | | | | | | ... 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 "-").
* test1605: verify negative input lengths to (un)escape functionsDaniel Stenberg2016-09-142-1/+52
|
* CMake: Don't build unit tests if private symbols are hiddenJakub Zakrzewski2016-09-101-3/+11
| | | | | | | | | | | 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
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-223-3/+3
|
* cmake: now using BUILD_TESTING=ON/OFFSergei Nikulov2016-06-211-0/+46
| | | | | | | | | | 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
* make/checksrc: use $srcdir, not $top_srcdirDaniel Stenberg2016-04-191-1/+1
|
* checksrc/makefile.am: use $top_srcdir to find source filesDaniel Stenberg2016-04-181-1/+1
| | | | ... to properly support out of source tree builds.
* tests: Fixed header files to comply with our code styleSteve Holme2016-04-031-2/+2
|
* code: style updatesDaniel Stenberg2016-04-039-55/+55
|
* unit: make unit test source code checksrc compliantDaniel Stenberg2016-04-0312-67/+110
|
* checksrc: run checksrc in tests when 'make checksrc' in rootDaniel Stenberg2016-04-031-1/+4
|
* unit1604: fix snprintfDaniel Stenberg2016-04-031-2/+2
| | | | | | | | follow-up to 0326b06 sizeof(pointer) is no good for the buffer size! Reported-by: Viktor Szakats
* unittests: Fixed compilation warningsSteve Holme2016-04-031-2/+2
| | | | | | | | 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.
* tool_doswin: Support for literal path prefix \\?\Jay Satiro2016-02-091-0/+19
| | | | For example something like --output \\?\C:\foo
* unit1604: Fix unit setup return codeJay Satiro2016-02-051-1/+1
|
* tool_doswin: Improve sanitization processingJay Satiro2016-02-052-1/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-0320-20/+20
|
* dotdot: allow an empty input string tooDaniel Stenberg2016-02-021-1/+4
| | | | | | | 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.
* unit1603: Demote hash mismatch failure to a warningdfandrich2015-11-121-10/+9
| | | | | | | 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.
* unit1603: Added unit tests for hash functionsdfandrich2015-11-123-3/+155
|
* unit1602: Fixed failure in torture testdfandrich2015-11-121-24/+23
|
* test1601: fix compilation with --enable-debug and --disable-crypto-authDan Fandrich2015-10-161-0/+2
|
* hostip: fix unintended destruction of hash tableAnthony Avina2015-05-183-2/+85
| | | | .. and added unit1602 for hash.c
* hostcache: made all host caches use structs, not pointersDaniel Stenberg2015-05-121-6/+7
| | | | | | 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.
* tests/unit/.gitignore: hide unit1601 and above, tooKamil Dudka2015-04-221-2/+1
|
* fix refreshing of obsolete dns cache entriesStefan Bühler2015-04-031-0/+1
| | | | | | | | | | | | - 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
* Bug #149: Deletion of unnecessary checks before calls of the function "free"Markus Elfring2015-03-161-3/+1
| | | | | | | | | | | 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>