Skip to content

Commit

Permalink
tests: kernel: Fix coverity warning CIDs 211474 and 211479
Browse files Browse the repository at this point in the history
Added assert tests around two of the k_mutex_locks() that
did not have them.

Fixes zephyrproject-rtos#26997
Fixes zephyrproject-rtos#26998

Signed-off-by: David Leach <[email protected]>
  • Loading branch information
dleach02 authored and nashif committed Aug 16, 2020
1 parent 1ab9004 commit 85cad85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/kernel/mutex/mutex_api/src/test_mutex_apis.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static void tmutex_test_lock(struct k_mutex *pmutex,
entry_fn, pmutex, NULL, NULL,
K_PRIO_PREEMPT(0),
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
k_mutex_lock(pmutex, K_FOREVER);
zassert_true(k_mutex_lock(pmutex, K_FOREVER) == 0, NULL);
TC_PRINT("access resource from main thread\n");

/* wait for spawn thread to take action */
Expand All @@ -78,7 +78,7 @@ static void tmutex_test_lock_timeout(struct k_mutex *pmutex,
entry_fn, pmutex, NULL, NULL,
K_PRIO_PREEMPT(0),
K_USER | K_INHERIT_PERMS, K_NO_WAIT);
k_mutex_lock(pmutex, K_FOREVER);
zassert_true(k_mutex_lock(pmutex, K_FOREVER) == 0, NULL);
TC_PRINT("access resource from main thread\n");

/* wait for spawn thread to take action */
Expand Down

0 comments on commit 85cad85

Please sign in to comment.