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

Merge pull request #14742 from kaspar030/fix_timer_msg_tests

tests/[xz]timer_msg: check result of thread_create()
This commit is contained in:
benpicco 2020-08-12 14:03:42 +02:00 committed by GitHub
commit e1c6f11fd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -28,6 +28,8 @@
#include "thread.h"
#include "msg.h"
#include "test_utils/expect.h"
char timer_stack[THREAD_STACKSIZE_DEFAULT];
char timer_stack_local[THREAD_STACKSIZE_DEFAULT];
@ -103,6 +105,8 @@ int main(void)
NULL,
"timer");
expect(pid_is_valid(pid));
puts("sending 1st msg");
m.content.ptr = &msg_a;
msg_try_send(&m, pid);
@ -120,6 +124,8 @@ int main(void)
NULL,
"timer local");
expect(pid_is_valid(pid2));
while (1) {
xtimer_sleep(1);
msg_try_send(&m, pid2);

View File

@ -29,6 +29,8 @@
#include "msg.h"
#include "timex.h"
#include "test_utils/expect.h"
#ifdef MODULE_ZTIMER_MSEC
#define ZTIMER ZTIMER_MSEC
#define TICKS_PER_SEC MS_PER_SEC
@ -112,6 +114,8 @@ int main(void)
NULL,
"timer");
expect(pid_is_valid(pid));
puts("sending 1st msg");
m.content.ptr = &msg_a;
msg_try_send(&m, pid);
@ -129,6 +133,8 @@ int main(void)
NULL,
"timer local");
expect(pid_is_valid(pid2));
while (1) {
ztimer_sleep(ZTIMER, 1 * TICKS_PER_SEC);
msg_try_send(&m, pid2);