Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
freediameter
Commits
d21c3a41
Commit
d21c3a41
authored
Sep 22, 2011
by
Sebastien Decugis
Browse files
Add a test for timeout on fifo
parent
80ac7748
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/testfifo.c
View file @
d21c3a41
...
...
@@ -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
)
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment