Moved *_get functions into tests

With the introduction of lfsr_data_t, these stopped being useful
functions for littlefs internally.

Maybe these tests should be rewritten to use the *_lookup functions
directly? Unfortunately with the quantity of tests we have now this adds
non-trivial amount of work with questionable benefit.
This commit is contained in:
Christopher Haster
2023-08-15 02:28:17 -05:00
parent d09a3646aa
commit b710769dda
4 changed files with 44 additions and 43 deletions
+14
View File
@@ -8,6 +8,20 @@ defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)'
# helper functions
in = 'lfs.c'
code = '''
static int lfsr_btree_get(lfs_t *lfs,
const lfsr_btree_t *btree, lfs_size_t bid,
lfsr_tag_t *tag_, lfs_size_t *weight_,
void *buffer, lfs_size_t size) {
lfsr_data_t data;
int err = lfsr_btree_lookup(lfs, btree, bid,
tag_, weight_, &data);
if (err) {
return err;
}
return lfsr_data_read(lfs, &data, buffer, size);
}
static int lfsr_btree_push(lfs_t *lfs, lfsr_btree_t *btree,
lfs_size_t bid, lfsr_tag_t tag, lfs_size_t weight,
lfsr_data_t data) {