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/linger.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/linger.cpp')
-rw-r--r-- | tests/linger.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/linger.cpp b/tests/linger.cpp index 1b1d341..592cf09 100644 --- a/tests/linger.cpp +++ b/tests/linger.cpp @@ -26,31 +26,31 @@ int XS_TEST_MAIN () // Create socket. void *ctx = xs_init (); - assert (ctx); + errno_assert (ctx); void *s = xs_socket (ctx, XS_PUSH); - assert (s); + errno_assert (s); // Set linger to 0.1 second. int linger = 100; int rc = xs_setsockopt (s, XS_LINGER, &linger, sizeof (int)); + errno_assert (rc == 0); // Connect to non-existent endpoing. - assert (rc == 0); rc = xs_connect (s, "tcp://127.0.0.1:5560"); - assert (rc != -1); + errno_assert (rc != -1); // Send a message. rc = xs_send (s, "r", 1, 0); - assert (rc == 1); + errno_assert (rc == 1); // Close the socket. rc = xs_close (s); - assert (rc == 0); + errno_assert (rc == 0); // Terminate the context. This should take 0.1 second. void *watch = xs_stopwatch_start (); rc = xs_term (ctx); - assert (rc == 0); + errno_assert (rc == 0); int ms = (int) xs_stopwatch_stop (watch) / 1000; time_assert (ms, linger); |