Added a bit of fuzz testing over mtree splits

This isn't the greatest coverage as we don't have a verifiable simulation.
Simulating the splitting-bucket-tree that is the mtree is tricky.

So right now this mostly just checks there's no internal assert failures and
if we have the expected number of entries afterwards.
This commit is contained in:
Christopher Haster
2023-05-10 11:31:20 -05:00
parent 3625882343
commit ea28413eb2
2 changed files with 86 additions and 8 deletions
+1 -6
View File
@@ -4523,12 +4523,7 @@ static inline int lfsr_mtree_isinlined(lfs_t *lfs) {
}
static inline lfs_ssize_t lfsr_mtree_weight(lfs_t *lfs) {
// inlined mdir?
if (lfsr_mtree_isinlined(lfs)) {
return lfs->mroot.rbyd.weight;
} else {
return lfsr_btree_weight(&lfs->mtree);
}
return lfsr_btree_weight(&lfs->mtree);
}
static int lfsr_mtree_lookup(lfs_t *lfs, lfs_ssize_t mid, lfsr_mdir_t *mdir_) {