tests: TEST_FAIL() support for os_get_random()
This allows more testing for rarely executed error paths. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
7ba94fc4b0
commit
5de6823f7a
1 changed files with 3 additions and 0 deletions
|
@ -80,6 +80,9 @@ int os_get_reltime(struct os_reltime *t)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
if (TEST_FAIL())
|
||||||
|
return -1;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
res = clock_gettime(clock_id, &ts);
|
res = clock_gettime(clock_id, &ts);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue