Guard slabcur fetching in extent_util

This commit is contained in:
Yinan Zhang
2019-10-28 09:24:42 -07:00
parent 4786099a3a
commit bd6e28d6a3
3 changed files with 11 additions and 7 deletions

View File

@@ -94,10 +94,8 @@ TEST_BEGIN(test_query) {
"Extent region count exceeded size");
assert_zu_ne(NREGS_READ(out), 0,
"Extent region count must be positive");
assert_ptr_not_null(SLABCUR_READ(out),
"Current slab is null");
assert_true(NFREE_READ(out) == 0
|| SLABCUR_READ(out) <= p,
assert_true(NFREE_READ(out) == 0 || (SLABCUR_READ(out)
!= NULL && SLABCUR_READ(out) <= p),
"Allocation should follow first fit principle");
if (config_stats) {
assert_zu_le(BIN_NFREE_READ(out),