mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-11-16 12:34:34 +00:00
Add test_superblocks_mount_unknown_block_count
This commit is contained in:
@@ -5,7 +5,7 @@ code = '''
|
||||
lfs_format(&lfs, cfg) => 0;
|
||||
'''
|
||||
|
||||
# tests formatting from interpretting a previous superblock
|
||||
# formatting from interpretting a previous superblock block_count
|
||||
[cases.test_superblocks_format_unknown_block_count]
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
@@ -29,6 +29,20 @@ code = '''
|
||||
lfs_unmount(&lfs) => 0;
|
||||
'''
|
||||
|
||||
# mount/unmount from interpretting a previous superblock block_count
|
||||
[cases.test_superblocks_mount_unknown_block_count]
|
||||
code = '''
|
||||
lfs_t lfs;
|
||||
lfs_format(&lfs, cfg) => 0;
|
||||
|
||||
memset(&lfs, 0, sizeof(lfs));
|
||||
struct lfs_config tweaked_cfg = *cfg;
|
||||
tweaked_cfg.block_count = 0;
|
||||
lfs_mount(&lfs, &tweaked_cfg) => 0;
|
||||
assert(lfs.block_count == cfg->block_count);
|
||||
'''
|
||||
|
||||
|
||||
# reentrant format
|
||||
[cases.test_superblocks_reentrant_format]
|
||||
reentrant = true
|
||||
|
||||
Reference in New Issue
Block a user