summaryrefslogtreecommitdiff
path: root/tests/max_sockets.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-06-14 08:14:09 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-06-14 08:14:09 +0200
commit0bb0d07abd789d4efa285e757efd14b3717db0a1 (patch)
treeaeb958d774ff994ac0c0c69c72dd4f3548e76cad /tests/max_sockets.cpp
parent1f6d8da319eb536782c0f9d0b30bcc085ede646f (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/max_sockets.cpp')
-rw-r--r--tests/max_sockets.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/max_sockets.cpp b/tests/max_sockets.cpp
index 5890d0f..c09f205 100644
--- a/tests/max_sockets.cpp
+++ b/tests/max_sockets.cpp
@@ -26,25 +26,25 @@ int XS_TEST_MAIN ()
// Create context and set MAX_SOCKETS to 1.
void *ctx = xs_init ();
- assert (ctx);
+ errno_assert (ctx);
int max_sockets = 1;
int rc = xs_setctxopt (ctx, XS_MAX_SOCKETS, &max_sockets,
sizeof (max_sockets));
- assert (rc == 0);
+ errno_assert (rc == 0);
// First socket should be created OK.
void *s1 = xs_socket (ctx, XS_PUSH);
- assert (s1);
+ errno_assert (s1);
// Creation of second socket should fail.
void *s2 = xs_socket (ctx, XS_PUSH);
- assert (!s2 && errno == EMFILE);
+ errno_assert (!s2 && errno == EMFILE);
// Clean up.
rc = xs_close (s1);
- assert (rc == 0);
+ errno_assert (rc == 0);
rc = xs_term (ctx);
- assert (rc == 0);
+ errno_assert (rc == 0);
return 0;
}