[riot-notifications] [RIOT-OS/RIOT] tests: add tests to reproduce #10881 (#10908)

Martine Lenders notifications at github.com
Wed Feb 13 13:02:18 CET 2019


miri64 commented on this pull request.



> +     * used to not call `sched_run()` which was the cause of the bug tested
+     * here */
+    _sched_next();
+    pid = thread_create(_stack, sizeof(_stack), THREAD_PRIORITY_MAIN + 1,
+                        THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
+                        _thread, NULL, "nr2");
+    assert(pid != KERNEL_PID_UNDEF);
+
+    while (1) {
+        msg_t msg = { .type = CANARY_TYPE };
+
+        /* receive blocked */
+        msg_receive(&msg);
+        /* check msg_receive() returned without blocking (i.e. the sending
+         * thread did not get a chance to copy the message over) */
+        assert(msg.type != CANARY_TYPE);

> We don't have conventions on using assert for tests, right?

Nope, but I could include embUnit instead, if you prefer.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10908#discussion_r256365013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190213/024b5627/attachment.html>


More information about the notifications mailing list