tests: kernel: msgq: fix unused value

"ret" returned from k_msgq_put() should be checked.

Coverity-CID: 160084

Change-Id: I192db3a67ab9489e8338f6636d4c2a6935e98d74
Signed-off-by: Sharron LIU <sharron.liu@intel.com>
This commit is contained in:
Sharron LIU 2017-01-23 13:03:20 +08:00 committed by Anas Nashif
commit cd35f06de8

View file

@ -37,6 +37,7 @@ void test_msgq_purge_when_put(void)
/*fill the queue to full*/
for (int i = 0; i < MSGQ_LEN; i++) {
ret = k_msgq_put(&msgq, (void *)&data[i], K_NO_WAIT);
assert_equal(ret, 0, NULL);
}
/*create another thread waiting to put msg*/
k_tid_t tid = k_thread_spawn(tstack, STACK_SIZE,
@ -51,6 +52,6 @@ void test_msgq_purge_when_put(void)
/*verify msg put after purge*/
for (int i = 0; i < MSGQ_LEN; i++) {
ret = k_msgq_put(&msgq, (void *)&data[i], K_NO_WAIT);
assert_false(ret, NULL);
assert_equal(ret, 0, NULL);
}
}