From 6f3f2b9b52eaf9f19034f893c89988b5dade7fa3 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 11 Aug 2020 12:11:27 +0200 Subject: [PATCH 1/2] tests/xtimer_msg: check result of thread_create() --- tests/xtimer_msg/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/xtimer_msg/main.c b/tests/xtimer_msg/main.c index 49f0b73348..4ad7262f35 100644 --- a/tests/xtimer_msg/main.c +++ b/tests/xtimer_msg/main.c @@ -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); From a9193e0036a583f684f77b4aa9a0d4ba06f5e3ee Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 11 Aug 2020 12:11:49 +0200 Subject: [PATCH 2/2] tests/ztimer_msg: check result of thread_create() --- tests/ztimer_msg/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/ztimer_msg/main.c b/tests/ztimer_msg/main.c index 39d490521f..f4bbf1fce8 100644 --- a/tests/ztimer_msg/main.c +++ b/tests/ztimer_msg/main.c @@ -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);