tests: logging: Add actual buf_check()
Check buf_check() results. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
b5fd057d90
commit
2ea492e4a9
1 changed files with 3 additions and 3 deletions
|
@ -114,7 +114,7 @@ ZTEST(test_log_cache, test_log_cache_basic)
|
||||||
|
|
||||||
/* Try to find id0 with success. */
|
/* Try to find id0 with success. */
|
||||||
cache_get(&cache, id0.raw, &buf, true, __LINE__);
|
cache_get(&cache, id0.raw, &buf, true, __LINE__);
|
||||||
buf_check(buf, 1);
|
zassert_true(buf_check(buf, 1), "Buffer check failed");
|
||||||
|
|
||||||
/* Miss id1 in cache then put it */
|
/* Miss id1 in cache then put it */
|
||||||
cache_get(&cache, id1.raw, &buf, false, __LINE__);
|
cache_get(&cache, id1.raw, &buf, false, __LINE__);
|
||||||
|
@ -139,7 +139,7 @@ ZTEST(test_log_cache, test_log_cache_basic)
|
||||||
|
|
||||||
/* id0 is evicted since it is the oldest one. */
|
/* id0 is evicted since it is the oldest one. */
|
||||||
cache_get(&cache, id0.raw, &buf, false, __LINE__);
|
cache_get(&cache, id0.raw, &buf, false, __LINE__);
|
||||||
buf_check(buf, 1);
|
zassert_true(buf_check(buf, 1), "Buffer check failed");
|
||||||
log_cache_put(&cache, buf);
|
log_cache_put(&cache, buf);
|
||||||
|
|
||||||
/* And id0 is now in cache */
|
/* And id0 is now in cache */
|
||||||
|
@ -147,7 +147,7 @@ ZTEST(test_log_cache, test_log_cache_basic)
|
||||||
|
|
||||||
/* buf id1 got evicted */
|
/* buf id1 got evicted */
|
||||||
cache_get(&cache, id1.raw, &buf, false, __LINE__);
|
cache_get(&cache, id1.raw, &buf, false, __LINE__);
|
||||||
buf_check(buf, 2);
|
zassert_true(buf_check(buf, 2), "Buffer check failed");
|
||||||
log_cache_put(&cache, buf);
|
log_cache_put(&cache, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue