cURL / Mailing Lists / curl-library / Single Mail


Re: thought on testing function in select.c

From: Daniel Stenberg <>
Date: Sun, 10 Jul 2011 23:30:18 +0200 (CEST)

On Thu, 7 Jul 2011, Amr Shahin wrote:

> have a the test to pass file descriptors to Curl_poll. run a separate
> thread/process that will write to specified files. make sure Curl_poll
> returned and has the correct info set.
> I do feel though that this test is a bit complex, if there are better ideas
> please share them.

They're really hard to unit test sensibly, yes. The hard part about using
threads is that we need to detect and use a threading lib that libcurl may not
use by itself.

I guess an alternative approach is to simply use the functions when connecting
to a test server using sockets, as we already have such test servers but
that's still a pretty complicated setup for a unit test.

List admin:
Received on 2011-07-10