From 3d0bcf40667bc1778ca96c7036d97a4568b2933a Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Thu, 17 Aug 2023 15:13:16 -0700 Subject: [PATCH] Add test_superblocks_mount_unknown_block_count --- tests/test_superblocks.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_superblocks.toml b/tests/test_superblocks.toml index 0622a4a3..a0d6388f 100644 --- a/tests/test_superblocks.toml +++ b/tests/test_superblocks.toml @@ -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