mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 00:46:05 +01:00
Merge pull request #1984 from hitstergtd/x-testcov-zmq-ctx
This commit is contained in:
commit
9e872d0269
@ -50,7 +50,13 @@ void test_ctx_destroy()
|
||||
// Close the socket
|
||||
rc = zmq_close (socket);
|
||||
assert (rc == 0);
|
||||
|
||||
|
||||
// Test error - API has multiple ways to kill Contexts
|
||||
rc = zmq_ctx_term (NULL);
|
||||
assert (rc == -1 && errno == EFAULT);
|
||||
rc = zmq_term (NULL);
|
||||
assert (rc == -1 && errno == EFAULT);
|
||||
|
||||
// Destroy the context
|
||||
rc = zmq_ctx_destroy (ctx);
|
||||
assert (rc == 0);
|
||||
@ -73,6 +79,10 @@ void test_ctx_shutdown()
|
||||
// Wait for thread to start up and block
|
||||
msleep (SETTLE_TIME);
|
||||
|
||||
// Test error - Shutdown context
|
||||
rc = zmq_ctx_shutdown (NULL);
|
||||
assert (rc == -1 && errno == EFAULT);
|
||||
|
||||
// Shutdown context, if we used destroy here we would deadlock.
|
||||
rc = zmq_ctx_shutdown (ctx);
|
||||
assert (rc == 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user