Cache bin: Write the unit test in terms of the API

I.e. stop allowing the unit test to have secret access to implementation
internals.
This commit is contained in:
David Goldblatt
2020-03-02 14:14:08 -08:00
committed by David Goldblatt
parent 7f5ebd211c
commit 370c1ea007
2 changed files with 191 additions and 50 deletions

View File

@@ -169,6 +169,10 @@ cache_bin_low_water_set(cache_bin_t *bin) {
bin->low_water_position = bin->cur_ptr.lowbits;
}
/*
* This is an internal implementation detail -- users should only affect ncached
* via single-item pushes or batch fills.
*/
static inline void
cache_bin_ncached_set(cache_bin_t *bin, cache_bin_info_t *info,
cache_bin_sz_t n) {