mirror of
https://github.com/curl/curl.git
synced 2026-06-24 18:55:39 +03:00
tunits: initialize global tool_stderr
To avoid difficult to track down crashes when a tested function ends up outputing a message via `errorf()`, `warnf()` or siblings. Cherry-picked from #21449 Closes #21454
This commit is contained in:
parent
4d89043fbc
commit
e2f84e6ba9
1 changed files with 8 additions and 0 deletions
|
|
@ -27,6 +27,10 @@
|
|||
#include <locale.h> /* for setlocale() */
|
||||
#endif
|
||||
|
||||
#if defined(UNITTESTS) && !defined(BUILDING_LIBCURL)
|
||||
#include "tool_stderr.h" /* for tool_init_stderr() */
|
||||
#endif
|
||||
|
||||
int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc,
|
||||
struct timeval *tv)
|
||||
{
|
||||
|
|
@ -276,6 +280,10 @@ int main(int argc, const char **argv)
|
|||
testnum = (int)num;
|
||||
}
|
||||
|
||||
#if defined(UNITTESTS) && !defined(BUILDING_LIBCURL)
|
||||
tool_init_stderr();
|
||||
#endif
|
||||
|
||||
result = entry_func(URL);
|
||||
curl_mfprintf(stderr, "Test ended with result %d\n", result);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue