Commit Graph

34 Commits

Author SHA1 Message Date
Simon Giesecke
779d120fa3 Problem: tests do not follow naming style
Solution: apply naming style
2018-05-27 13:24:08 +02:00
Luca Boccassi
d81a041f18
Merge pull request #3103 from sigiesec/win-warnings-as-errors
Warnings in Windows builds
2018-05-14 22:53:04 +01:00
Simon Giesecke
3ee65906af Problem: various warnings regarding SOCKET vs. int in test_security_curve
Solution: Use fd_t
2018-05-14 21:09:56 +02:00
Simon Giesecke
e8877f78a9 Problem: zmq_poller_[add/modify] accept invalid events arguments silently
Solution: check and return an error on invalid arguments. Fixes #3088
2018-05-14 14:58:36 +02:00
Simon Giesecke
2cd147e5ff Problem: misleading comment for calling zmq_poller_add with events == 0
Solution: change comment, and add test case for zmq_poller_modify with events == 0
2018-05-14 11:29:24 +02:00
Simon Giesecke
cdc298f567 Problem: bind_loopback_ipv4 not reusable
Solution: Moved bind_loopback_ipv4 to testutil_unity to allow for reuse
2018-03-16 15:21:39 +01:00
Simon Giesecke
7bd57ba83b Problem: test case tests multiple aspects
Solution: split test case
2018-03-15 16:43:34 +01:00
Simon Giesecke
3e374d98f1 Problem: test case tests multiple aspects
Solution: split test case
2018-03-15 16:43:33 +01:00
Simon Giesecke
eb0307a9a6 Problem: test case tests multiple aspects
Solution: split test case
2018-03-15 16:43:32 +01:00
Simon Giesecke
10dae6e830 Problem: test_poller not using unity
Solution: migrate to unity, and split test cases
2018-03-15 16:43:30 +01:00
sigiesec
41f459e1dc Problem: formatting inconsistent
Solution: applied clang-format
2018-02-02 15:47:43 +01:00
Luca Boccassi
0382118371 Problem: unused variable in test_wait_corner_cases
Solution: don't pass it
2017-09-01 19:55:51 +01:00
sigiesec
8ae91fdf9a Problem: no test cases for zmq_poller_add*, zmq_poller_modify*, zmq_poller_remove* corner cases
Solution: added test cases
2017-08-22 20:22:39 +02:00
sigiesec
68f416c0ca Problem: missing test case for zmq_poller_wait_all with negative number of events
Solution: add test case
2017-08-22 20:04:55 +02:00
sigiesec
a71f7b0405 Problem: zmq_poller_* uses ETIMEDOUT (instead of the usual EAGAIN) to indicate timeouts
Solution: replace ETIMEDOUT within socket_poller_t and all client code by EAGAIN

Fixes #2713
2017-08-22 20:00:29 +02:00
sigiesec
6a3c053a3e Problem: EFAULT is returned for bad file descriptors passed to zmq_poller_*_fd
Solution: Return EBADF instead
2017-08-22 19:43:56 +02:00
sigiesec
74303b08e6 Problem: calling zmq_poller_wait* with NULL events causes an assertion, as opposed to other NULL arguments, which return an error
Solution: return EFAULT when such an operation is attempted
2017-08-22 19:43:56 +02:00
sigiesec
c1a4cfdd9f Problem: waiting on an empty poller with infinite timeout waits forever
Solution: return EFAULT when such an operation is attempted
2017-08-22 19:43:56 +02:00
sigiesec
0c9b16d62a Problem: missing test cases for zmq_poller_* functions called with invalid arguments and corner cases for zmq_poller_wait_*
Solution: added test cases
2017-08-22 19:43:42 +02:00
sigiesec
2e4fc4faf0 Problem: zmq_poller_*_fd functions do not check for invalid fd
Solution: add checks, added test cases
2017-08-22 19:28:07 +02:00
sigiesec
f9af5503b4 Problem: missing test cases for zmq_poller_* functions called with invalid arguments
Solution: added test cases
2017-08-22 19:28:07 +02:00
Luca Boccassi
17637536b8 Problem: use-after-free in test_poller
Solution: remove server socket from poller before closing it
Fixes #2581
2017-05-18 13:10:19 +01:00
Luca Boccassi
5934919f3e Problem: tests bind to hardcoded TCP ports
Solution: use ZMQ_LAST_ENDPOINT in most places. This alllows running
tests in paralle, and on over-booked shared machines where many of
the ports would be already in use.
Keep 3 tests with an hardcoded port, as there are some code paths that
require it (eg: connect before bind), but list those ports in
tests/testutil.hpp as macros so that they do not overlap and still
allow parallel runs.

These changes were inspired by a patch uploaded to Ubuntu by the
package maintainer, Steve Langasek <steve.langasek@ubuntu.com>.
Thank you Steve!
2017-05-01 22:57:05 +01:00
hitstergtd
477cc1cb12 Problem: zmq_poller_destroy parameter checking
Solution:
- Add checks for **poller_p_ to ensure that we do not segfault when either it
  or the value within it are NULL
- Add tests for the above and increase error state coverage
2016-05-12 18:09:59 +01:00
Doron Somech
a747f72450 problem:closed poller still associated with socket 2016-05-05 13:50:33 +03:00
Luca Boccassi
f0a34e0ff5 Problem: test_poller/use_fd_ipc/tcp use draft API
Solution: only use ZMQ_SERVER/CLIENT if the defines are available.
2016-05-02 21:46:47 +01:00
Patrik Wenger
621c965fae Problem: tricky return value from zmq::socket_poller_t::wait when poller is empty
Solution: return -1 (no event) instead of 0 (event)

For some reason, this just returns 0 if there are no sockets registered
on the poller. Usually this would mean there has been an event. So the
caller would have to check the return value AND the event, or write code
that takes the number of registered sockets into consideration.

By returning -1 and setting errno = ETIMEDOUT like in the usual timeout
cases, it's more consistent and convenient.

Test case included.
2016-04-12 20:11:50 +02:00
Constantin Rack
7da3ee138e Problem: deprecated zmq_utils.h is still included
Solution: remove all remaining references to `zmq_utils.h`
2016-02-01 11:34:36 +01:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
Pieter Hintjens
7893a6ac26 Problem: zmq poller API is not CLASS conformant
Solution: change zmq_poller_close(p) to zmq_poller_destroy(&p)
2015-12-21 11:01:16 +01:00
somdoron
da2bc60abe Removing zmq_pollfd as it is replaced by zmq_poller 2015-10-22 11:52:24 +03:00
somdoron
24fc0d4e89 drop the socket postfix from poller methods 2015-10-21 14:04:33 +03:00
somdoron
476ba22e0a ZMQ_Poller support more event types 2015-10-21 10:14:36 +03:00
somdoron
6501b8089f port zpoller to libzmq as zmq_poller 2015-10-18 21:07:23 +03:00