summaryrefslogtreecommitdiff
path: root/tests/selpolltest.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't use pcap_lookupdev() in the tests.Guy Harris2017-09-081-2/+6
| | | | | | | | | | If we ever run the tests on Windows NT, they might get back a UTF-16 string, which they won't handle correctly. On UN*X, it's just a simple wrapper around pcap_findalldevs(), so it's not worth testing. On MS-DOS, it basically duplicates what pcap_findalldevs() does.
* Move all the function attributes from funcattrs.h to pcap/funcattrs.h.Guy Harris2017-09-081-1/+1
| | | | That lets us use any of them in public declarations, if we ever need to.
* Use compiler #defines to determine how to handle some function attributes.Guy Harris2017-03-191-49/+2
| | | | | | | | | | | | | | | | Take the set of tests in the test programs that check compiler and version to decide how to mark functions as printflike or as not returning, and put them into a header. Use that throughout the libpcap code, rather than doing configuration-time tests that have to be replicated in the autoconf script and CMake files. That obviates the need to put those tests into CMakeLists.txt and means that, if we ever make functions with those attributes available by code outside libpcap (for example, if we ever introduce a plugin mechanism for libpcap, to allow third-party pcap modules to be maintained separately from libpcap), we can use those declarations (making a public header file dependent on the results of a configure script usually doesn't work well, for a variety of reasons).
* Fix test programs to build on more platforms.Guy Harris2015-11-031-3/+56
| | | | | | | | | | | | | | | Add a bunch of compiler checks to define various macros for attributes to be assigned to functions and variables. The Single UNIX Specification says inet_addr() returns (in_addr_t)(-1) on an error; check for that, as INADDR_NONE isn't defined on all UN*Xes. (Microsoft's documentation says inet_addr() returns INADDR_NONE, but that's probably just -1 or 0xffffffff.) Check whether we have sys/select.h and, if we don't, include sys/time.h instead; some older UN*Xes don't have sys/select.h. Get rid of some unused #defines in Win32/Include/Gnuc.h.
* Add a "getopt.h" header and include it instead of <unistd.h> on Windows.Guy Harris2015-11-011-5/+1
| | | | | | | | | | | | | We include <unistd.h> for getopt(), but, on Windows, we supply our own getopt() (as it's a UN*X API), so supply our own header and include that instead. While we're at it, mark the copyright strings as unused (to squelch compiler warnings), and don't include the headers for select() or poll() in capturetest.c, as we don't use those APIs there (that's what selpolltest(), which is UN*X-only, is for). <unistd.h> or "getopt.h" should declare the getopt() external variables, so don't declare them ourselves.
* Add tests to CMakeDmytro Ovdiienko2015-09-221-0/+8
|
* Move test source to a tests directory, add a new test for nonblocking mode.Guy Harris2010-03-311-0/+350