summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSharron LIU <sharron.liu@intel.com>2017-01-23 13:03:20 +0800
committerAnas Nashif <nashif@linux.intel.com>2017-01-24 13:36:15 +0000
commitcd35f06de8e1a7df5bb51a929da046b5151a7fa9 (patch)
tree1ec9c07060ec26008aab2415a6e6767c0775d208 /tests
parentee659ae1a1de7896528d3a4ad3f69f7d0d96c2d8 (diff)
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/kernel/msgq/msgq_api/src/test_msgq_purge.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c b/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c
index 38eaef420..3958f3746 100644
--- a/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c
+++ b/tests/kernel/msgq/msgq_api/src/test_msgq_purge.c
@@ -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);
}
}