curl/tests/libtest
Christopher Dannemiller c78044c07e multi: fix curl_multi_waitfds reporting of fd_count
- Make curl_multi_waitfds consistent with the documentation.

Issue Addressed:

 - The documentation of curl_multi_waitfds indicates that users should
   be able to call curl_multi_waitfds with a NULL ufds. However, before
   this change, the function would return CURLM_BAD_FUNCTION_ARGUMENT.
 - Additionally, the documentation suggests that users can use this
   function to determine the number of file descriptors (fds) needed.
   However, the function would stop counting fds if the supplied fds
   were exhausted.

Changes Made:

 - NULL ufds Handling: curl_multi_waitfds can now accept a NULL ufds if
   size is also zero.
 - Counting File Descriptors: If curl_multi_waitfds is passed a NULL
   ufds, or the size of ufds is insufficient, the output parameter
   fd_count will return the number of fds needed. This value may be
   higher than actually needed but never lower.

Testing:

 - Test 2405 has been updated to cover the usage scenarios described
   above.

Fixes https://github.com/curl/curl/issues/15146
Closes https://github.com/curl/curl/pull/15155
2024-12-29 01:05:09 -05:00
..
.checksrc checksrc: ban use of sscanf() 2024-12-13 09:43:05 +01:00
.gitignore tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
CMakeLists.txt binmode: convert to macro and use it from tests 2024-12-21 13:29:24 +01:00
first.c binmode: convert to macro and use it from tests 2024-12-21 13:29:24 +01:00
first.h tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib500.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib501.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib502.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib503.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib504.c test504: fix handling on pending connect 2024-09-26 16:57:51 +02:00
lib505.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib506.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib507.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib508.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib509.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib510.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib511.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib512.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib513.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib514.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib515.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib516.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib517.c lib517: extend the getdate test with quotes and leading "junk" 2024-12-11 09:19:50 +01:00
lib518.c select: use poll() if existing, avoid poll() with no sockets 2024-10-01 15:11:50 +02:00
lib519.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib520.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib521.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib523.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib524.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib525.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib526.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib530.c Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
lib533.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib536.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib537.c select: use poll() if existing, avoid poll() with no sockets 2024-10-01 15:11:50 +02:00
lib539.c tests: provide FTP directory contents in the test file 2024-07-29 13:04:24 +02:00
lib540.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib541.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib542.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib543.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib544.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib547.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib549.c tidy-up: misc spelling (bit, ASCII) 2024-08-15 15:30:09 +02:00
lib552.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib553.c cmake: allow building tests in unity mode 2024-09-19 21:32:58 +02:00
lib554.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib555.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib556.c test556: improve robustness 2024-08-09 09:38:19 +02:00
lib557.c build: fix clang-cl builds, add CI job 2024-10-30 23:15:32 +01:00
lib558.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib559.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib560.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib562.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib564.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib566.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib567.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib568.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib569.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib570.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib571.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib572.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib573.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib574.c tests: provide FTP directory contents in the test file 2024-07-29 13:04:24 +02:00
lib575.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib576.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib578.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib579.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib582.c Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
lib583.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib586.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib589.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib590.c getinfo: provide info which auth was used for HTTP and proxy 2024-12-23 23:03:54 +01:00
lib591.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib597.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib598.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib599.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib643.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib650.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib651.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib652.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib653.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib654.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib655.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib658.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib659.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib661.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib666.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib667.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib668.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib670.c cleanup: added space around ternary expressions 2024-09-25 08:02:01 +02:00
lib674.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib676.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib677.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib678.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib694.c getinfo: provide info which auth was used for HTTP and proxy 2024-12-23 23:03:54 +01:00
lib1156.c cleanup: added space around ternary expressions 2024-09-25 08:02:01 +02:00
lib1301.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1485.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib1500.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1501.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1502.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1506.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1507.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1508.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1509.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib1510.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1511.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1512.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1513.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1514.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1515.c test1515: add tracing and more debug info 2024-10-03 14:41:55 +02:00
lib1517.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1518.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1520.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1522.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1523.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1525.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1526.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1527.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1528.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1529.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1530.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1531.c tidy-up: misc 2024-12-24 01:27:26 +01:00
lib1532.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1533.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1534.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1535.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1536.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1537.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1538.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1540.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib1541.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib1542.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1545.c build: tidy up deprecation suppression, enable warnings for clang 2024-09-21 00:59:52 +02:00
lib1550.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1551.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1552.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1553.c multi: fix multi_wait() timeout handling 2024-05-30 08:29:00 +02:00
lib1554.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1555.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1556.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib1557.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1558.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1559.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1560.c urlapi: normalize the IPv6 address 2024-10-03 16:05:03 +02:00
lib1564.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1565.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1567.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1568.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1569.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1591.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1592.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1593.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1594.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1597.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1598.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1662.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1900.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1901.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1903.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1905.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1906.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1907.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1908.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1910.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1911.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1912.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1913.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1915.c test1915: add tracing and connect timeout 2024-10-03 16:06:08 +02:00
lib1916.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1918.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1919.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1933.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1934.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1935.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1936.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1937.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1938.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1939.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1940.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
lib1945.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1947.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1948.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1955.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1956.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1957.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1958.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1959.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1960.c Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
lib1964.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib1970.c misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
lib1971.c misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
lib1972.c misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
lib1973.c misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
lib1974.c misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
lib1975.c misc: cleanup after removing years from copyright 2024-07-30 14:11:48 +02:00
lib2301.c WebSockets: make support official (non-experimental) 2024-09-27 13:20:25 +02:00
lib2302.c WebSockets: make support official (non-experimental) 2024-09-27 13:20:25 +02:00
lib2304.c WebSockets: make support official (non-experimental) 2024-09-27 13:20:25 +02:00
lib2305.c WebSockets: make support official (non-experimental) 2024-09-27 13:20:25 +02:00
lib2306.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib2308.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
lib2309.c duphandle: also init netrc 2024-11-07 09:47:53 +01:00
lib2402.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib2404.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib2405.c multi: fix curl_multi_waitfds reporting of fd_count 2024-12-29 01:05:09 -05:00
lib2502.c test2502: add libtest debug tracing 2024-09-26 16:57:13 +02:00
lib3010.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3025.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3026.c tidy-up: rename CURL_WINDOWS_APP to CURL_WINDOWS_UWP 2024-09-19 19:24:12 +02:00
lib3027.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3100.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3101.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3102.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3103.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
lib3104.c cookie: fix crash in netscape cookie parsing 2024-12-27 13:16:08 -05:00
lib3207.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
libauthretry.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
libntlmconnect.c tests: speed up builds with single-binary test bundles 2024-09-22 09:51:15 +02:00
libprereq.c tests: make the unit test result type CURLcode 2024-05-12 18:53:07 +02:00
Makefile.am binmode: convert to macro and use it from tests 2024-12-21 13:29:24 +01:00
Makefile.inc cookie: fix crash in netscape cookie parsing 2024-12-27 13:16:08 -05:00
mk-lib1521.pl mk-lib1521: fix the long return code check 2024-10-23 00:41:05 +02:00
stub_gssapi.c tests: avoid int/size_t conversion size/sign warnings 2024-01-24 15:03:05 +01:00
stub_gssapi.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
test307.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
test610.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
test613.pl test613: stop showing an error on missing output file 2023-10-13 20:28:58 -07:00
test1013.pl test1013.pl: require case match for features, order match for protos, fix issue 2024-08-29 13:56:05 +02:00
test1022.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
test.h tidy-up: misc 2024-12-24 01:27:26 +01:00
testtrace.c tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
testtrace.h tests: fix callback signatures to please UndefinedBehaviorSanitizer 2024-10-15 14:33:47 +02:00
testutil.c tidy-up: rename CURL_WINDOWS_APP to CURL_WINDOWS_UWP 2024-09-19 19:24:12 +02:00
testutil.h windows: use built-in _WIN32 macro to detect Windows 2023-11-22 15:42:25 +00:00