diff options
author | Yang Tse <yangsita@gmail.com> | 2007-01-30 03:48:29 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-01-30 03:48:29 +0000 |
commit | bad67830b3bfbd44219ef5f6d467c0ed9dedd063 (patch) | |
tree | 73fc8f1ad85336b8eba3c8f63a4703b5c12c3d91 | |
parent | db22c8303119f8d91c4988471f0bb169071940b2 (diff) |
skip test on platforms on which we use select() instead
of poll() and select() happens to be bound by FD_SETSIZE
-rw-r--r-- | tests/libtest/lib518.c | 27 | ||||
-rw-r--r-- | tests/libtest/lib537.c | 27 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c index ffe38961e..47cea8244 100644 --- a/tests/libtest/lib518.c +++ b/tests/libtest/lib518.c @@ -344,6 +344,33 @@ static int rlimit(int keep_open) sprintf(strbuff, fmt, num_open.rlim_max); fprintf(stderr, "%s file descriptors open\n", strbuff); +#if !defined(HAVE_POLL_FINE) && \ + !defined(CURL_HAVE_WSAPOLL) && \ + !defined(USE_WINSOCK) && \ + !defined(TPF) + + /* + * when using select() instead of poll() we cannot test + * libcurl functionality with a socket number equal or + * greater than FD_SETSIZE. In any case, macro VERIFY_SOCK + * in lib/select.c enforces this check and protects libcurl + * from a possible crash. The effect of this protection + * is that test 518 will always fail, since the actual + * call to select() never takes place. We skip test 518 + * with an indication that select limit would be exceeded. + */ + + sprintf(strbuff2, fmt, num_open.rlim_max); + sprintf(strbuff, "fds open %s > select limit %d", + strbuff2, FD_SETSIZE); + store_errmsg(strbuff, 0); + fprintf(stderr, "%s\n", msgbuff); + close_file_descriptors(); + free(memchunk); + return -10; + +#endif + /* free the chunk of memory we were reserving so that it becomes becomes available to the test */ diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c index ab24b4242..ebd100e50 100644 --- a/tests/libtest/lib537.c +++ b/tests/libtest/lib537.c @@ -340,6 +340,33 @@ static int rlimit(int keep_open) sprintf(strbuff, fmt, num_open.rlim_max); fprintf(stderr, "%s file descriptors open\n", strbuff); +#if !defined(HAVE_POLL_FINE) && \ + !defined(CURL_HAVE_WSAPOLL) && \ + !defined(USE_WINSOCK) && \ + !defined(TPF) + + /* + * when using select() instead of poll() we cannot test + * libcurl functionality with a socket number equal or + * greater than FD_SETSIZE. In any case, macro VERIFY_SOCK + * in lib/select.c enforces this check and protects libcurl + * from a possible crash. The effect of this protection + * is that test 537 will always fail, since the actual + * call to select() never takes place. We skip test 537 + * with an indication that select limit would be exceeded. + */ + + sprintf(strbuff2, fmt, num_open.rlim_max); + sprintf(strbuff, "fds open %s > select limit %d", + strbuff2, FD_SETSIZE); + store_errmsg(strbuff, 0); + fprintf(stderr, "%s\n", msgbuff); + close_file_descriptors(); + free(memchunk); + return -8; + +#endif + /* free the chunk of memory we were reserving so that it becomes becomes available to the test */ |