Add a unit test; currently hanging on final permutation.

Some block-device bound-checks are disabled during superblock search.
This commit is contained in:
Brian Pugh
2023-08-16 23:07:55 -07:00
parent be6812213d
commit df238ebac6
3 changed files with 22 additions and 7 deletions

View File

@@ -5,6 +5,21 @@ code = '''
lfs_format(&lfs, cfg) => 0;
'''
# tests formatting from interpretting a previous superblock
[cases.test_superblocks_format_unknown_block_count]
code = '''
lfs_t lfs;
lfs_format(&lfs, cfg) => 0;
assert(lfs.block_count == cfg->block_count);
memset(&lfs, 0, sizeof(lfs));
struct lfs_config tweaked_cfg = *cfg;
tweaked_cfg.block_count = 0;
lfs_format(&lfs, &tweaked_cfg) => 0;
assert(lfs.block_count == cfg->block_count);
'''
# mount/unmount
[cases.test_superblocks_mount]
code = '''