diff options
author | Brian Pugh <bnp117@gmail.com> | 2023-08-18 01:20:46 +0300 |
---|---|---|
committer | Brian Pugh <bnp117@gmail.com> | 2023-08-18 01:20:46 +0300 |
commit | 2ebfec78c3c3383925f2014a95e46c99b2e4fac2 (patch) | |
tree | d6beacb3dee41a49e33dcde95bb09c5aa22b955e | |
parent | 3d0bcf40667bc1778ca96c7036d97a4568b2933a (diff) |
test for failure when interpretting block count when formatting without superblock
-rw-r--r-- | tests/test_superblocks.toml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_superblocks.toml b/tests/test_superblocks.toml index a0d6388..2dcf880 100644 --- a/tests/test_superblocks.toml +++ b/tests/test_superblocks.toml @@ -19,6 +19,14 @@ code = ''' assert(lfs.block_count == cfg->block_count); ''' +# formatting from interpretting a non-existent previous superblock block_count +[cases.test_superblocks_format_unknown_block_count_failure] +code = ''' + lfs_t lfs; + struct lfs_config tweaked_cfg = *cfg; + tweaked_cfg.block_count = 0; + lfs_format(&lfs, &tweaked_cfg) => LFS_ERR_CORRUPT; +''' # mount/unmount [cases.test_superblocks_mount] |