Commit d21c3a41 authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Add a test for timeout on fifo

parent 80ac7748
......@@ -187,6 +187,17 @@ int main(int argc, char *argv[])
CHECK( 0, fd_fifo_length(queue, &count) );
CHECK( 0, count);
/* Check the timedget actually timesout */
CHECK(0, clock_gettime(CLOCK_REALTIME, &ts));
ts.tv_nsec += 1000000; /* 1 millisecond */
if (ts.tv_nsec >= 1000000000L) {
ts.tv_nsec -= 1000000000L;
ts.tv_sec += 1;
}
CHECK( ETIMEDOUT, fd_fifo_timedget(queue, &msg, &ts) );
CHECK( 0, fd_fifo_length(queue, &count) );
CHECK( 0, count);
/* We're done for basic tests */
CHECK( 0, fd_fifo_del(&queue) );
}
......
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