1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/sema: add test for sema_wait_timed_ztimer()

This commit is contained in:
Hauke Petersen 2021-04-12 11:02:15 +02:00
parent b339e91e18
commit 4cd9e96066
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,7 @@
include ../Makefile.tests_common
USEMODULE += sema
USEMODULE += xtimer
USEMODULE += ztimer_usec
include $(RIOTBASE)/Makefile.include

View File

@ -25,7 +25,6 @@
#include "msg.h"
#include "sema.h"
#include "thread.h"
#include "xtimer.h"
#define TEST_TIME_US 1000
#define TEST_ITERATIONS 4
@ -79,6 +78,11 @@ int main(void)
printf("MAIN ERROR: sema_wait_timed()");
return 1;
}
if (sema_wait_timed_ztimer(&test_sema, ZTIMER_USEC, TEST_TIME_US)
!= -ETIMEDOUT) {
printf("MAIN_ERROR: sema_wait_timed_ztimer()");
return 1;
}
thread_create(stack,
sizeof(stack),