summaryrefslogtreecommitdiff
path: root/tests/timeo.cpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-03-13 12:19:31 +0100
committerMartin Lucina <martin@lucina.net>2012-03-13 12:19:31 +0100
commit5749a18faea208ad19f39612c3c55166ca409fef (patch)
tree51976654ec6b706293820fe6b104f8f41774b5f4 /tests/timeo.cpp
parent4ae2af8c9a3f9f928b411eb31b4007a4ce8f26ba (diff)
xs_utils cleanup 1/2 (minimize exported api)
Reduced xs_utils to the minimum functions required (xs_stopwatch_*) xs_sleep, xs_thread_* are internal to unit tests and have been moved to testutil.hpp, useless use of xs_sleep in perf/ has been removed. Signed-off-by: Martin Lucina <martin@lucina.net>
Diffstat (limited to 'tests/timeo.cpp')
-rw-r--r--tests/timeo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/timeo.cpp b/tests/timeo.cpp
index 000e718..e2dcbb8 100644
--- a/tests/timeo.cpp
+++ b/tests/timeo.cpp
@@ -26,12 +26,12 @@ extern "C"
{
// Worker thread connects after delay of 1 second. Then it waits
// for 1 more second, so that async connect has time to succeed.
- xs_sleep (1);
+ sleep (1);
void *sc = xs_socket (ctx_, XS_PUSH);
assert (sc);
int rc = xs_connect (sc, "inproc://timeout_test");
assert (rc == 0);
- xs_sleep (1);
+ sleep (1);
rc = xs_close (sc);
assert (rc == 0);
}
@@ -72,7 +72,7 @@ int XS_TEST_MAIN ()
timeout = 2000;
rc = xs_setsockopt(sb, XS_RCVTIMEO, &timeout, timeout_size);
assert (rc == 0);
- void *thread = xs_thread_create (timeo_worker, ctx);
+ void *thread = thread_create (timeo_worker, ctx);
assert (thread);
watch = xs_stopwatch_start ();
rc = xs_recv (sb, buf, 32, 0);
@@ -80,7 +80,7 @@ int XS_TEST_MAIN ()
assert (xs_errno () == EAGAIN);
elapsed = xs_stopwatch_stop (watch);
assert (elapsed > 1900000 && elapsed < 2100000);
- xs_thread_join (thread);
+ thread_join (thread);
// Check that timeouts don't break normal message transfer.
void *sc = xs_socket (ctx, XS_PUSH);