diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-06-14 08:14:09 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-06-14 08:14:09 +0200 |
commit | 0bb0d07abd789d4efa285e757efd14b3717db0a1 (patch) | |
tree | aeb958d774ff994ac0c0c69c72dd4f3548e76cad /tests/msg_flags.cpp | |
parent | 1f6d8da319eb536782c0f9d0b30bcc085ede646f (diff) |
errno errors reported in tests
Till now when a test failed the value or errno haven't
been reported. This patch fixes the problem.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'tests/msg_flags.cpp')
-rw-r--r-- | tests/msg_flags.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/msg_flags.cpp b/tests/msg_flags.cpp index 3f3b3b1..e83e4d2 100644 --- a/tests/msg_flags.cpp +++ b/tests/msg_flags.cpp @@ -26,57 +26,57 @@ int XS_TEST_MAIN () // Create the infrastructure void *ctx = xs_init (); - assert (ctx); + errno_assert (ctx); void *sb = xs_socket (ctx, XS_XREP); - assert (sb); + errno_assert (sb); int rc = xs_bind (sb, "inproc://a"); - assert (rc != -1); + errno_assert (rc != -1); void *sc = xs_socket (ctx, XS_XREQ); - assert (sc); + errno_assert (sc); rc = xs_connect (sc, "inproc://a"); - assert (rc != -1); + errno_assert (rc != -1); // Send 2-part message. rc = xs_send (sc, "A", 1, XS_SNDMORE); - assert (rc == 1); + errno_assert (rc == 1); rc = xs_send (sc, "B", 1, 0); - assert (rc == 1); + errno_assert (rc == 1); // Identity comes first. xs_msg_t msg; rc = xs_msg_init (&msg); - assert (rc == 0); + errno_assert (rc == 0); rc = xs_recvmsg (sb, &msg, 0); - assert (rc >= 0); + errno_assert (rc >= 0); int more; size_t more_size = sizeof (more); rc = xs_getmsgopt (&msg, XS_MORE, &more, &more_size); - assert (rc == 0); + errno_assert (rc == 0); assert (more == 1); // Then the first part of the message body. rc = xs_recvmsg (sb, &msg, 0); - assert (rc == 1); + errno_assert (rc == 1); more_size = sizeof (more); rc = xs_getmsgopt (&msg, XS_MORE, &more, &more_size); - assert (rc == 0); + errno_assert (rc == 0); assert (more == 1); // And finally, the second part of the message body. rc = xs_recvmsg (sb, &msg, 0); - assert (rc == 1); + errno_assert (rc == 1); more_size = sizeof (more); rc = xs_getmsgopt (&msg, XS_MORE, &more, &more_size); - assert (rc == 0); + errno_assert (rc == 0); assert (more == 0); // Deallocate the infrastructure. rc = xs_close (sc); - assert (rc == 0); + errno_assert (rc == 0); rc = xs_close (sb); - assert (rc == 0); + errno_assert (rc == 0); rc = xs_term (ctx); - assert (rc == 0); + errno_assert (rc == 0); return 0 ; } |