mirror of
				https://github.com/zeromq/libzmq.git
				synced 2025-11-04 12:17:39 +01:00 
			
		
		
		
	Problem: missing test case for zmq_poller_wait_all with negative number of events
Solution: add test case
This commit is contained in:
		@@ -178,6 +178,9 @@ void test_wait_corner_cases (void *ctx)
 | 
				
			|||||||
    rc = zmq_poller_wait(poller, &event, -1);
 | 
					    rc = zmq_poller_wait(poller, &event, -1);
 | 
				
			||||||
    assert (rc == -1 && errno == EFAULT);
 | 
					    assert (rc == -1 && errno == EFAULT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    rc = zmq_poller_wait_all (poller, &event, -1, 0);
 | 
				
			||||||
 | 
					    assert (rc == -1 && errno == EINVAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rc = zmq_poller_wait_all (poller, &event, 0, 0);
 | 
					    rc = zmq_poller_wait_all (poller, &event, 0, 0);
 | 
				
			||||||
    assert (rc == -1 && errno == EAGAIN);
 | 
					    assert (rc == -1 && errno == EAGAIN);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -268,13 +271,8 @@ int main (void)
 | 
				
			|||||||
    rc = zmq_connect (bowl, my_endpoint_0);
 | 
					    rc = zmq_connect (bowl, my_endpoint_0);
 | 
				
			||||||
    assert (rc == 0);
 | 
					    assert (rc == 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined _WIN32
 | 
					    fd_t fd;
 | 
				
			||||||
    SOCKET fd;
 | 
					    size_t fd_size = sizeof (fd);
 | 
				
			||||||
    size_t fd_size = sizeof (SOCKET);
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
    int fd;
 | 
					 | 
				
			||||||
    size_t fd_size = sizeof (int);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rc = zmq_getsockopt (bowl, ZMQ_FD, &fd, &fd_size);
 | 
					    rc = zmq_getsockopt (bowl, ZMQ_FD, &fd, &fd_size);
 | 
				
			||||||
    assert (rc == 0);
 | 
					    assert (rc == 0);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user