Commit 9e872d02 authored by Constantin Rack's avatar Constantin Rack

Merge pull request #1984 from hitstergtd/x-testcov-zmq-ctx

parents f8c93d50 4842b6bd
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment