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:
Sharron LIU 2017-01-22 15:12:14 +08:00 committed by Anas Nashif
commit d9a3c92b5b

View file

@ -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--) {