hpdata: Add a test.
We're about to make the functionality here more complicated; testing hpdata directly (rather than relying on user's tests) will make debugging easier.
This commit is contained in:
committed by
David Goldblatt
parent
3ed0b4e8a3
commit
d9f7e6c668
@@ -112,10 +112,15 @@ hpdata_assert_empty(hpdata_t *hpdata) {
|
||||
assert(hpdata_nfree_get(hpdata) == HUGEPAGE_PAGES);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
hpdata_consistent(hpdata_t *hpdata) {
|
||||
return fb_urange_longest(hpdata->active_pages, HUGEPAGE_PAGES)
|
||||
== hpdata_longest_free_range_get(hpdata);
|
||||
}
|
||||
|
||||
static inline void
|
||||
hpdata_assert_consistent(hpdata_t *hpdata) {
|
||||
assert(fb_urange_longest(hpdata->active_pages, HUGEPAGE_PAGES)
|
||||
== hpdata_longest_free_range_get(hpdata));
|
||||
assert(hpdata_consistent(hpdata));
|
||||
}
|
||||
|
||||
TYPED_LIST(hpdata_list, hpdata_t, ql_link)
|
||||
|
Reference in New Issue
Block a user