tests: kernel: mpool: fix assert side effect
assert should not contain "i++" which might work differently in a non-debug build. Coverity-CID: 160469 Change-Id: Id8fd50127dd93de1676b812ac0888c9ec2e1b5de Signed-off-by: Sharron LIU <sharron.liu@intel.com>
This commit is contained in:
parent
41d805a235
commit
d9a3c92b5b
1 changed files with 4 additions and 2 deletions
|
@ -94,7 +94,8 @@ void test_mpool_alloc_size(void)
|
|||
assert_true(k_mem_pool_alloc(&kmpool, &block[i], size,
|
||||
K_NO_WAIT) == 0, NULL);
|
||||
assert_not_null(block[i].data, NULL);
|
||||
assert_true((uint32_t)(block[i++].data) % BLK_ALIGN == 0, NULL);
|
||||
assert_true((uint32_t)(block[i].data) % BLK_ALIGN == 0, NULL);
|
||||
i++;
|
||||
size = size >> 2;
|
||||
}
|
||||
while (i--) {
|
||||
|
@ -111,7 +112,8 @@ void test_mpool_alloc_size(void)
|
|||
assert_true(k_mem_pool_alloc(&kmpool, &block[i], size,
|
||||
K_NO_WAIT) == 0, NULL);
|
||||
assert_not_null(block[i].data, NULL);
|
||||
assert_true((uint32_t)(block[i++].data) % BLK_ALIGN == 0, NULL);
|
||||
assert_true((uint32_t)(block[i].data) % BLK_ALIGN == 0, NULL);
|
||||
i++;
|
||||
size = size << 2;
|
||||
}
|
||||
while (i--) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue