Commit 35c6985e authored by Luca Boccassi's avatar Luca Boccassi

Problem: zmq_stopwatch_intermediate is eligible for STABLE

Solution: do it
parent 22c3ecc4
......@@ -29,6 +29,8 @@
- ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL: Protocol errors with peers or ZAP.
- ZMQ_EVENT_HANDSHAKE_FAILED_AUTH: Failed authentication requests.
See doc/zmq_socket_monitor.txt for more details and error codes.
- zmq_stopwatch_intermediate which returns the time elapsed without stopping
the stopwatch.
* The build-time configuration option to select the poller has been split, and
new API_POLLER (CMake) and --with-api-poller (autoconf) options will now
......
......@@ -610,11 +610,9 @@ ZMQ_EXPORT int zmq_timers_execute (void *timers);
/* Starts the stopwatch. Returns the handle to the watch. */
ZMQ_EXPORT void *zmq_stopwatch_start (void);
#ifdef ZMQ_BUILD_DRAFT_API
/* Returns the number of microseconds elapsed since the stopwatch was */
/* started, but does not stop or deallocate the stopwatch. */
ZMQ_EXPORT unsigned long zmq_stopwatch_intermediate (void *watch_);
#endif
/* Stops the stopwatch. Returns the number of microseconds elapsed since */
/* the stopwatch was started, and deallocates that watch. */
......
......@@ -37,10 +37,6 @@
#ifndef ZMQ_BUILD_DRAFT_API
/* Returns the number of microseconds elapsed since the stopwatch was */
/* started, but does not stop or deallocate the stopwatch. */
unsigned long zmq_stopwatch_intermediate (void *watch_);
/* DRAFT Socket types. */
#define ZMQ_SERVER 12
#define ZMQ_CLIENT 13
......
......@@ -156,21 +156,17 @@ void test_timers ()
// Timer should not have been invoked yet
TEST_ASSERT_SUCCESS_ERRNO (zmq_timers_execute (timers));
#ifdef ZMQ_BUILD_DRAFT_API
if (zmq_stopwatch_intermediate (stopwatch) < full_timeout) {
TEST_ASSERT_FALSE (timer_invoked);
}
#endif
// Wait half the time and check again
long timeout = TEST_ASSERT_SUCCESS_ERRNO (zmq_timers_timeout (timers));
msleep (timeout / 2);
TEST_ASSERT_SUCCESS_ERRNO (zmq_timers_execute (timers));
#ifdef ZMQ_BUILD_DRAFT_API
if (zmq_stopwatch_intermediate (stopwatch) < full_timeout) {
TEST_ASSERT_FALSE (timer_invoked);
}
#endif
// Wait until the end
TEST_ASSERT_SUCCESS_ERRNO (sleep_and_execute (timers));
......@@ -181,11 +177,9 @@ void test_timers ()
timeout = TEST_ASSERT_SUCCESS_ERRNO (zmq_timers_timeout (timers));
msleep (timeout / 2);
TEST_ASSERT_SUCCESS_ERRNO (zmq_timers_execute (timers));
#ifdef ZMQ_BUILD_DRAFT_API
if (zmq_stopwatch_intermediate (stopwatch) < 2 * full_timeout) {
TEST_ASSERT_FALSE (timer_invoked);
}
#endif
// Reset timer and wait half of the time left
TEST_ASSERT_SUCCESS_ERRNO (zmq_timers_reset (timers, timer_id));
......
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