diff --git a/lfs.c b/lfs.c index ad2e4cff..cdeed281 100644 --- a/lfs.c +++ b/lfs.c @@ -289,6 +289,7 @@ static int lfsr_bd_read(lfs_t *lfs, } // needed in lfsr_bd_prog_ for prog validation +static inline bool lfsr_m_isckprogs(uint32_t flags); static lfs_scmp_t lfsr_bd_cmp(lfs_t *lfs, lfs_block_t block, lfs_size_t off, lfs_size_t hint, const void *buffer, lfs_size_t size); @@ -304,7 +305,7 @@ static int lfsr_bd_prog_(lfs_t *lfs, lfs_block_t block, lfs_size_t off, } // check progs? - if (lfs->cfg->check_progs) { + if (lfsr_m_isckprogs(lfs->flags)) { // pcache should have been dropped at this point LFS_ASSERT(lfs->pcache.size == 0); @@ -5907,6 +5908,14 @@ static int lfsr_data_readmptr(lfs_t *lfs, lfsr_data_t *data, /// various flag things /// +static inline bool lfsr_m_isrdonly(uint32_t flags) { + return flags & LFS_M_RDONLY; +} + +static inline bool lfsr_m_isckprogs(uint32_t flags) { + return flags & LFS_M_CKPROGS; +} + static inline bool lfsr_i_isuncompacted(uint32_t flags) { return flags & LFS_I_UNCOMPACTED; } @@ -11772,11 +11781,18 @@ failed:; static int lfs_deinit(lfs_t *lfs); // initialize littlefs state, assert on bad configuration -static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) { +static int lfs_init(lfs_t *lfs, uint32_t flags, + const struct lfs_config *cfg) { // TODO this all needs to be cleaned up lfs->cfg = cfg; int err = 0; + // unknown flags? + LFS_ASSERT((flags + & ~LFS_M_RDWR + & ~LFS_M_RDONLY + & ~LFS_M_CKPROGS) == 0); + // validate that the lfs-cfg sizes were initiated properly before // performing any arithmetic logics with them LFS_ASSERT(lfs->cfg->read_size != 0); @@ -11823,10 +11839,10 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) { // fragment_size must be <= block_size/4 LFS_ASSERT(lfs->cfg->fragment_size <= lfs->cfg->block_size/4); - // zero flags - lfs->flags = 0; + // setup flags + lfs->flags = flags; - // setup block_count so we can mutate it + // copy block_count so we can mutate it lfs->block_count = lfs->cfg->block_count; // setup read cache @@ -12554,8 +12570,9 @@ static int lfsr_mountinited(lfs_t *lfs) { return 0; } -int lfsr_mount(lfs_t *lfs, const struct lfs_config *cfg) { - int err = lfs_init(lfs, cfg); +int lfsr_mount(lfs_t *lfs, uint32_t flags, + const struct lfs_config *cfg) { + int err = lfs_init(lfs, flags, cfg); if (err) { return err; } @@ -12674,7 +12691,7 @@ static int lfsr_formatinited(lfs_t *lfs) { } int lfsr_format(lfs_t *lfs, const struct lfs_config *cfg) { - int err = lfs_init(lfs, cfg); + int err = lfs_init(lfs, LFS_M_RDWR, cfg); if (err) { return err; } @@ -12702,7 +12719,10 @@ int lfsr_format(lfs_t *lfs, const struct lfs_config *cfg) { int lfsr_fs_stat(lfs_t *lfs, struct lfs_fsinfo *fsinfo) { // return various filesystem flags - fsinfo->flags = lfs->flags & LFS_I_UNCOMPACTED; + fsinfo->flags = lfs->flags & ( + LFS_I_RDONLY + | LFS_I_CKPROGS + | LFS_I_UNCOMPACTED); // some flags we calculate on demand if (lfsr_grm_count(lfs) > 0 || lfsr_f_hasorphans(lfs->flags)) { diff --git a/lfs.h b/lfs.h index 5bf61d05..dd3d0bfd 100644 --- a/lfs.h +++ b/lfs.h @@ -113,6 +113,28 @@ enum lfs_error { LFS_ERR_RANGE = -34, // Result out of range }; +// Filesystem mount flags +enum lfs_mount_flags { + LFS_M_RDWR = 0x0000, // Mount the filesystem as read and write + LFS_M_RDONLY = 0x0001, // Mount the filesystem as read only + LFS_M_CKPROGS = 0x0010, // Check progs by reading back progged data +}; + +// Filesystem info flags +enum lfs_fsinfo_flags { + // mount flags + LFS_I_RDONLY = 0x0001, // Filesystem mounted read only + LFS_I_CKPROGS = 0x0010, // Check progs by reading back progged data + + // state flags + LFS_I_INCONSISTENT = 0x0100, // Filesystem needs mkconsistent to write + LFS_I_CANLOOKAHEAD = 0x0400, // Lookahead buffer is not full + LFS_I_UNCOMPACTED = 0x1000, // Filesystem may have uncompacted metadata + + // internally used flags + LFS_F_ORPHANS = 0x8000, // Filesystem may have untracked orphans +}; + // File types enum lfs_type { // file types @@ -125,16 +147,6 @@ enum lfs_type { LFS_TYPE_TRAVERSAL = 9, }; -// Block types -enum lfs_btype { - LFS_BTYPE_MDIR = 1, - LFS_BTYPE_BTREE = 2, - LFS_BTYPE_DATA = 3, -// TODO -// LFS_BTYPE_PARITY = 4, -// LFS_BTYPE_BAD = 5, -}; - // File open flags enum lfs_open_flags { // open flags @@ -165,15 +177,14 @@ enum lfs_whence_flags { LFS_SEEK_END = 2, // Seek relative to the end of the file }; -// Filesystem info flags -enum lfs_fsinfo_flags { - // state flags - LFS_I_INCONSISTENT = 0x01, // Filesystem needs mkconsistent to write - LFS_I_CANLOOKAHEAD = 0x04, // Lookahead buffer is not full - LFS_I_UNCOMPACTED = 0x10, // Filesystem may have uncompacted metadata - - // internally used flags - LFS_F_ORPHANS = 0x80, // Filesystem may have untracked orphans +// Block types +enum lfs_btype { + LFS_BTYPE_MDIR = 1, + LFS_BTYPE_BTREE = 2, + LFS_BTYPE_DATA = 3, +// TODO +// LFS_BTYPE_PARITY = 4, +// LFS_BTYPE_BAD = 5, }; // Traversal flags @@ -378,11 +389,6 @@ struct lfs_config { // 0 only writes blocks, minimizing disk usage, while -1 or any value >= // block_size only writes fragments, minimizing random-write cost. lfs_size_t crystal_thresh; - - // TODO should lfs_mount accept flags? - - // Check progs by immediately reading back any progged data - bool check_progs; }; // File info structure @@ -403,7 +409,7 @@ struct lfs_info { // Filesystem info structure struct lfs_fsinfo { // Filesystem flags - uint8_t flags; + uint32_t flags; // Size of a logical block in bytes. lfs_size_t block_size; @@ -721,11 +727,11 @@ typedef struct lfsr_grm { // The littlefs filesystem type typedef struct lfs { const struct lfs_config *cfg; + uint16_t flags; lfs_size_t block_count; lfs_size_t name_limit; lfs_off_t file_limit; - uint8_t flags; int8_t recycle_bits; uint8_t attr_estimate; uint8_t mdir_bits; @@ -790,7 +796,8 @@ int lfsr_format(lfs_t *lfs, const struct lfs_config *config); // // Returns a negative error code on failure. //int lfs_mount(lfs_t *lfs, const struct lfs_config *config); -int lfsr_mount(lfs_t *lfs, const struct lfs_config *config); +int lfsr_mount(lfs_t *lfs, uint32_t flags, + const struct lfs_config *config); // Unmounts a littlefs // diff --git a/runners/bench_runner.h b/runners/bench_runner.h index 9d037703..3f157567 100644 --- a/runners/bench_runner.h +++ b/runners/bench_runner.h @@ -126,7 +126,6 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); BENCH_DEFINE(SHRUB_SIZE, INLINE_SIZE ) \ BENCH_DEFINE(FRAGMENT_SIZE, BLOCK_SIZE/8 ) \ BENCH_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \ - BENCH_DEFINE(CHECK_PROGS, false ) \ BENCH_DEFINE(ERASE_VALUE, 0xff ) \ BENCH_DEFINE(ERASE_CYCLES, 0 ) \ BENCH_DEFINE(BADBLOCK_BEHAVIOR, LFS_EMUBD_BADBLOCK_PROGERROR ) \ @@ -156,8 +155,7 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); .inline_size = INLINE_SIZE, \ .shrub_size = SHRUB_SIZE, \ .fragment_size = FRAGMENT_SIZE, \ - .crystal_thresh = CRYSTAL_THRESH, \ - .check_progs = CHECK_PROGS, + .crystal_thresh = CRYSTAL_THRESH, #define BENCH_BDCFG \ .erase_value = ERASE_VALUE, \ diff --git a/runners/test_runner.h b/runners/test_runner.h index 88ce1cfa..c1ff6495 100644 --- a/runners/test_runner.h +++ b/runners/test_runner.h @@ -111,7 +111,6 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); TEST_DEFINE(SHRUB_SIZE, INLINE_SIZE ) \ TEST_DEFINE(FRAGMENT_SIZE, BLOCK_SIZE/8 ) \ TEST_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \ - TEST_DEFINE(CHECK_PROGS, false ) \ TEST_DEFINE(ERASE_VALUE, 0xff ) \ TEST_DEFINE(ERASE_CYCLES, 0 ) \ TEST_DEFINE(BADBLOCK_BEHAVIOR, LFS_EMUBD_BADBLOCK_PROGERROR ) \ @@ -141,8 +140,7 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); .inline_size = INLINE_SIZE, \ .shrub_size = SHRUB_SIZE, \ .fragment_size = FRAGMENT_SIZE, \ - .crystal_thresh = CRYSTAL_THRESH, \ - .check_progs = CHECK_PROGS, + .crystal_thresh = CRYSTAL_THRESH, #define TEST_BDCFG \ .erase_value = ERASE_VALUE, \ diff --git a/tests/test_alloc.toml b/tests/test_alloc.toml index e694a68f..c641aca8 100644 --- a/tests/test_alloc.toml +++ b/tests/test_alloc.toml @@ -21,7 +21,7 @@ defines.ERASE = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // start allocating lfs_alloc_ckpoint(&lfs); @@ -54,7 +54,7 @@ defines.ERASE = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // start allocating lfs_alloc_ckpoint(&lfs); @@ -111,7 +111,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -156,7 +156,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // first traverse the tree to find all blocks in use @@ -221,7 +221,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } for (lfs_size_t i = 0; i < N; i++) { @@ -276,7 +276,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -325,7 +325,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // first traverse the tree to find all blocks in use @@ -399,7 +399,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } prng = 42; @@ -449,7 +449,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files lfsr_file_t files[N]; @@ -576,7 +576,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } prng = 42; @@ -617,7 +617,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create directories until we run out of space lfs_size_t n = 0; @@ -635,7 +635,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked until we ran out of space @@ -688,7 +688,7 @@ defines.SIZE = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create files until we run out of space uint32_t prng = 42; @@ -728,7 +728,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our file writes worked until we ran out of space diff --git a/tests/test_badblocks.toml b/tests/test_badblocks.toml index f4e316e8..978bb1b6 100644 --- a/tests/test_badblocks.toml +++ b/tests/test_badblocks.toml @@ -6,6 +6,7 @@ after = [ 'test_forphans', 'test_traversal', 'test_gc', + 'test_mount', ] @@ -26,7 +27,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] # maximize lookahead buffer to avoid alloc scans defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)' @@ -45,7 +46,10 @@ code = ''' // test creating a btree lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -134,7 +138,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] code = ''' // test all possible bad blocks @@ -149,7 +153,10 @@ code = ''' // test creating directories lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // make this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -163,7 +170,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // grm should be zero here @@ -238,7 +248,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.SEED = 42 @@ -256,7 +266,10 @@ code = ''' // test fuzz with dirs lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -350,7 +363,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // grm should be zero here @@ -413,7 +429,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ '0', @@ -438,7 +454,10 @@ code = ''' // test creating files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create this many files uint32_t prng = 42; @@ -462,7 +481,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check that our writes worked @@ -511,7 +533,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -539,7 +561,10 @@ code = ''' // test fuzz with files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -670,7 +695,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check that our files match our simulation @@ -748,7 +776,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.OPS = 20 defines.SIZE = [ 'FILE_BUFFER_SIZE/2', @@ -785,7 +813,10 @@ code = ''' // test with complex file writes lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create a file lfsr_file_t file; @@ -847,7 +878,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check our file with stat @@ -907,7 +941,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -935,7 +969,10 @@ code = ''' // test with orphans, zombies, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1270,7 +1307,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -1298,7 +1335,10 @@ code = ''' // test with orphans, zombies, dirs, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1720,7 +1760,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] # maximize lookahead buffer to avoid alloc scans @@ -1741,7 +1781,10 @@ code = ''' // test creating a btree lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1825,7 +1868,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] code = ''' @@ -1846,7 +1889,10 @@ code = ''' // test creating directories lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // make this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -1860,7 +1906,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // grm should be zero here @@ -1930,7 +1979,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' @@ -1954,7 +2003,10 @@ code = ''' // test fuzz with dirs lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -2048,7 +2100,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // grm should be zero here @@ -2106,7 +2161,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ @@ -2137,7 +2192,10 @@ code = ''' // test creating files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create this many files uint32_t prng = 42; @@ -2161,7 +2219,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check that our writes worked @@ -2205,7 +2266,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' @@ -2239,7 +2300,10 @@ code = ''' // test fuzz with files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -2370,7 +2434,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check that our files match our simulation @@ -2443,7 +2510,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.OPS = 20 defines.SIZE = [ @@ -2486,7 +2553,10 @@ code = ''' // test with complex file writes lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create a file lfsr_file_t file; @@ -2548,7 +2618,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check our file with stat @@ -2603,7 +2676,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' @@ -2637,7 +2710,10 @@ code = ''' // test with orphans, zombies, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -2967,7 +3043,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' @@ -3001,7 +3077,10 @@ code = ''' // test with orphans, zombies, dirs, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -3416,7 +3495,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] # maximize lookahead buffer to avoid alloc scans @@ -3437,7 +3516,10 @@ code = ''' // test creating a btree lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3521,7 +3603,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] code = ''' @@ -3542,7 +3624,10 @@ code = ''' // test creating directories lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // make this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -3556,7 +3641,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // grm should be zero here @@ -3626,7 +3714,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' @@ -3650,7 +3738,10 @@ code = ''' // test fuzz with dirs lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -3744,7 +3835,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // grm should be zero here @@ -3802,7 +3896,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ @@ -3833,7 +3927,10 @@ code = ''' // test creating files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create this many files uint32_t prng = 42; @@ -3857,7 +3954,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check that our writes worked @@ -3901,7 +4001,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' @@ -3935,7 +4035,10 @@ code = ''' // test fuzz with files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -4066,7 +4169,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check that our files match our simulation @@ -4139,7 +4245,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.OPS = 20 defines.SIZE = [ @@ -4182,7 +4288,10 @@ code = ''' // test with complex file writes lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // create a file lfsr_file_t file; @@ -4242,7 +4351,10 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; } // check our file with stat @@ -4297,7 +4409,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' @@ -4331,7 +4443,10 @@ code = ''' // test with orphans, zombies, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -4661,7 +4776,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.MIRROR = [false, true] defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' @@ -4695,7 +4810,10 @@ code = ''' // test with orphans, zombies, dirs, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -5107,8 +5225,6 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_PROGNOOP', 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] -# we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' code = ''' if (BADBLOCKS & 0x1) { lfs_emubd_setwear(CFG, 0, 0xffffffff) => 0; @@ -5133,7 +5249,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; @@ -5145,7 +5261,10 @@ code = ''' lfs_emubd_setwear(CFG, 1, 0xffffffff) => 0; } - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; for (lfs_size_t i = 0;; i++) { // this should eventually fail diff --git a/tests/test_btree.toml b/tests/test_btree.toml index b50e1f1c..85ee0d30 100644 --- a/tests/test_btree.toml +++ b/tests/test_btree.toml @@ -10,7 +10,7 @@ defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -41,7 +41,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -82,7 +82,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -131,7 +131,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -181,7 +181,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -239,7 +239,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -300,7 +300,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -350,7 +350,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -402,7 +402,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -484,7 +484,7 @@ defines.W = 5 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -552,7 +552,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -687,7 +687,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -732,7 +732,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -790,7 +790,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -862,7 +862,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -919,7 +919,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1005,7 +1005,7 @@ defines.W = 5 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1078,7 +1078,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1221,7 +1221,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1277,7 +1277,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1349,7 +1349,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1421,7 +1421,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1512,7 +1512,7 @@ if = 'N > REMAINING' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1591,7 +1591,7 @@ if = 'N > REMAINING' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1673,7 +1673,7 @@ if = 'N > REMAINING' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1761,7 +1761,7 @@ if = 'N > REMAINING' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -1867,7 +1867,7 @@ if = 'N > REMAINING' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2017,7 +2017,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2076,7 +2076,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2165,7 +2165,7 @@ defines.W = 5 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2225,7 +2225,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2401,7 +2401,7 @@ defines.SIBLING = [0, 1] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2468,7 +2468,7 @@ defines.SIBLING = [0, 1] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2538,7 +2538,7 @@ defines.SIBLING = [0, 1] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2601,7 +2601,7 @@ defines.SIBLING = [0, 1] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2681,7 +2681,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2787,7 +2787,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2953,7 +2953,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -2986,7 +2986,7 @@ defines.DID = [false, true] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3038,7 +3038,7 @@ defines.DID = [false, true] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3104,7 +3104,7 @@ in = 'lfs.c' defines.DID = [false, true] code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3184,7 +3184,7 @@ defines.DID = [false, true] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3265,7 +3265,7 @@ defines.DID = [false, true] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3338,7 +3338,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3452,7 +3452,7 @@ defines.DID = [false, true] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3526,7 +3526,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3682,7 +3682,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -3839,7 +3839,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -4044,7 +4044,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; @@ -4167,7 +4167,7 @@ fuzz = 'SEED' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; // create free lookahead memset(lfs.lookahead.buffer, 0, CFG->lookahead_size); lfs.lookahead.start = 2; diff --git a/tests/test_compat.toml b/tests/test_compat.toml index 178efc77..c60d74dd 100644 --- a/tests/test_compat.toml +++ b/tests/test_compat.toml @@ -40,6 +40,7 @@ code = ''' #define lfsp_config lfs_config #define LFSP_ERR_NOENT LFS_ERR_NOENT #define lfsp_format lfsr_format +#define LFSP_M_RDWR LFS_M_RDWR #define lfsp_mount lfsr_mount #define lfsp_unmount lfsr_unmount #define lfsp_fsinfo lfs_fsinfo @@ -84,14 +85,14 @@ code = ''' lfsp_format(&lfsp, &cfgp) => 0; // confirm the previous mount works - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; lfsp_unmount(&lfsp) => 0; ////// // now mount with new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_unmount(&lfs) => 0; ''' @@ -111,7 +112,7 @@ code = ''' lfsp_format(&lfsp, &cfgp) => 0; // write COUNT dirs - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; for (lfs_size_t i = 0; i < COUNT; i++) { char name[8]; sprintf(name, "dir%03d", i); @@ -123,7 +124,7 @@ code = ''' // now mount with new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // can we list the directories? lfsr_dir_t dir; @@ -171,7 +172,7 @@ code = ''' lfsp_format(&lfsp, &cfgp) => 0; // write COUNT files - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { lfsp_file_t file; @@ -195,7 +196,7 @@ code = ''' // now mount with new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // can we list the files? lfsr_dir_t dir; @@ -261,7 +262,7 @@ code = ''' lfsp_format(&lfsp, &cfgp) => 0; // write COUNT files+dirs - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { char name[16]; @@ -288,7 +289,7 @@ code = ''' // now mount with new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // can we list the directories? lfsr_dir_t dir; @@ -378,7 +379,7 @@ code = ''' lfsp_format(&lfsp, &cfgp) => 0; // write COUNT/2 dirs - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; for (lfs_size_t i = 0; i < COUNT/2; i++) { char name[8]; sprintf(name, "dir%03d", i); @@ -390,7 +391,7 @@ code = ''' // now mount with new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // write another COUNT/2 dirs for (lfs_size_t i = COUNT/2; i < COUNT; i++) { @@ -445,7 +446,7 @@ code = ''' lfsp_format(&lfsp, &cfgp) => 0; // write half COUNT files - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { // write half @@ -475,7 +476,7 @@ code = ''' // now mount with new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // write half COUNT files prng = 42; @@ -569,7 +570,7 @@ code = ''' ////// // now mount with new version - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { char name[16]; @@ -601,7 +602,7 @@ code = ''' // mount the new version lfs_t lfs; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // write half COUNT files prng = 42; @@ -717,7 +718,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // confirm the new mount works - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_unmount(&lfs) => 0; ////// @@ -727,7 +728,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; lfsp_unmount(&lfsp) => 0; ''' @@ -745,7 +746,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // write COUNT dirs - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; for (lfs_size_t i = 0; i < COUNT; i++) { char name[8]; sprintf(name, "dir%03d", i); @@ -760,7 +761,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; // can we list the directories? lfsp_dir_t dir; @@ -805,7 +806,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // write COUNT files - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { lfsr_file_t file; @@ -832,7 +833,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; // can we list the files? lfsp_dir_t dir; @@ -895,7 +896,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // write COUNT files+dirs - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { char name[16]; @@ -925,7 +926,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; // can we list the directories? lfsp_dir_t dir; @@ -1012,7 +1013,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // write COUNT/2 dirs - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; for (lfs_size_t i = 0; i < COUNT/2; i++) { char name[8]; sprintf(name, "dir%03d", i); @@ -1027,7 +1028,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; // write another COUNT/2 dirs for (lfs_size_t i = COUNT/2; i < COUNT; i++) { @@ -1079,7 +1080,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // write half COUNT files - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { // write half @@ -1112,7 +1113,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; // write half COUNT files prng = 42; @@ -1201,7 +1202,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // write half COUNT files - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; for (lfs_size_t i = 0; i < COUNT; i++) { char name[16]; @@ -1237,7 +1238,7 @@ code = ''' assert(sizeof(struct lfsp_config) == sizeof(struct lfs_config)); memcpy(&cfgp, CFG, sizeof(cfgp)); lfsp_t lfsp; - lfsp_mount(&lfsp, &cfgp) => 0; + lfsp_mount(&lfsp, LFSP_M_RDWR, &cfgp) => 0; // write half COUNT files prng = 42; diff --git a/tests/test_dirs.toml b/tests/test_dirs.toml index 84409c02..5d9fd5d8 100644 --- a/tests/test_dirs.toml +++ b/tests/test_dirs.toml @@ -8,10 +8,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -22,7 +22,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -74,7 +74,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // make a directory lfsr_mkdir(&lfs, "ardvark") => 0; @@ -94,7 +94,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // make a directory lfsr_mkdir(&lfs, "ardvark") => 0; @@ -115,10 +115,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -132,7 +132,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -184,10 +184,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dir exists before mkconsistent @@ -225,7 +225,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -276,10 +276,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // try to make root, which doesn't make sense @@ -296,7 +296,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -348,10 +348,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -368,7 +368,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -419,10 +419,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -483,7 +483,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -572,10 +572,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -668,7 +668,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -761,10 +761,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -777,7 +777,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -785,7 +785,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -853,10 +853,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -869,7 +869,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -877,7 +877,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -945,10 +945,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -967,7 +967,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } } @@ -976,7 +976,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1081,10 +1081,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -1109,7 +1109,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } } @@ -1119,7 +1119,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1261,10 +1261,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create this many directory in a sort of linked-list by nesting @@ -1278,7 +1278,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -1286,7 +1286,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1348,10 +1348,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (PARENT) { @@ -1396,7 +1396,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1473,7 +1473,7 @@ defines.ORDER = [0, 1, 2] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (ORDER == 0) { lfsr_mkdir(&lfs, "a") => 0; @@ -1503,7 +1503,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1586,7 +1586,7 @@ defines.ORDER = [0, 1, 2] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (ORDER == 0) { lfsr_mkdir(&lfs, "a") => 0; @@ -1616,7 +1616,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1698,10 +1698,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } assert(lfs_crc32c(0, "a_SNmwMTHH", 10) == 0x12345678); @@ -1805,7 +1805,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1883,10 +1883,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } assert(lfs_crc32c(0, "a_IplRNrPH", 10) == 0x00000000); @@ -1990,7 +1990,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2070,10 +2070,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } assert(lfs_crc32c(0, "a_iomlVKPH", 10) == 0xffffffff); @@ -2177,7 +2177,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2258,10 +2258,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -2271,7 +2271,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked with stat @@ -2306,7 +2306,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2338,10 +2338,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -2361,7 +2361,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2401,10 +2401,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -2422,7 +2422,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2483,10 +2483,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dir exists before mkconsistent @@ -2523,7 +2523,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked with stat @@ -2556,7 +2556,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2588,10 +2588,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // try to remove root, which doesn't really make sense @@ -2611,7 +2611,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2651,10 +2651,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -2714,7 +2714,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -2761,7 +2761,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our remove worked @@ -2801,7 +2801,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our remove worked @@ -2835,7 +2835,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -2868,10 +2868,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -2963,7 +2963,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdirs worked @@ -3034,7 +3034,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our remove worked @@ -3098,7 +3098,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our remove worked @@ -3144,7 +3144,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -3184,10 +3184,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -3201,7 +3201,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -3246,7 +3246,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3254,7 +3254,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -3314,10 +3314,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -3331,7 +3331,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -3376,7 +3376,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3384,7 +3384,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -3448,10 +3448,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -3472,7 +3472,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdirs worked @@ -3555,7 +3555,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3568,7 +3568,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3576,7 +3576,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -3673,10 +3673,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make this many directories @@ -3704,7 +3704,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdirs worked @@ -3823,7 +3823,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3836,7 +3836,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3849,7 +3849,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -3857,7 +3857,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -3998,10 +3998,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create this many directory in a sort of linked-list by nesting @@ -4016,7 +4016,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -4066,7 +4066,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -4074,7 +4074,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4136,10 +4136,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (PARENT) { @@ -4202,7 +4202,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4260,10 +4260,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make a directory @@ -4279,7 +4279,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked with stat @@ -4314,7 +4314,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4355,10 +4355,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make directories @@ -4370,7 +4370,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked with stat @@ -4409,7 +4409,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4450,10 +4450,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make directories @@ -4463,7 +4463,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked with stat @@ -4498,7 +4498,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4537,10 +4537,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make directories @@ -4563,7 +4563,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4603,10 +4603,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // make directories @@ -4625,7 +4625,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4694,10 +4694,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -4750,7 +4750,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked with stat @@ -4783,7 +4783,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4823,10 +4823,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // try to rename root, which doesn't really make sense @@ -4843,7 +4843,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -4883,10 +4883,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -4986,7 +4986,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -5033,7 +5033,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our rename worked @@ -5080,7 +5080,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our rename worked @@ -5128,7 +5128,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -5182,10 +5182,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if dirs exist before mkconsistent @@ -5379,7 +5379,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdirs worked @@ -5450,7 +5450,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our rename worked @@ -5521,7 +5521,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our rename worked @@ -5593,7 +5593,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -5675,10 +5675,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if we have already started renaming, in case of powerloss @@ -5696,7 +5696,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -5745,7 +5745,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -5753,7 +5753,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -5805,10 +5805,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if we have already started renaming, in case of powerloss @@ -5826,7 +5826,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -5875,7 +5875,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -5883,7 +5883,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -5935,10 +5935,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if we have already started renaming, in case of powerloss @@ -5963,7 +5963,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdirs worked @@ -6047,7 +6047,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } for (lfs_size_t j = 0; j < N; j++) { @@ -6064,7 +6064,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } } @@ -6073,7 +6073,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -6161,10 +6161,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if we have already started renaming, in case of powerloss @@ -6196,7 +6196,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdirs worked @@ -6315,7 +6315,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } for (lfs_size_t j = 0; j < N; j++) { @@ -6332,7 +6332,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } for (lfs_size_t k = 0; k < N; k++) { @@ -6351,7 +6351,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } } @@ -6361,7 +6361,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -6490,10 +6490,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check if we have already started renaming, in case of powerloss @@ -6512,7 +6512,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our mkdir worked @@ -6570,7 +6570,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // update old_name's path @@ -6581,7 +6581,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -6648,10 +6648,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (PARENT) { @@ -6737,7 +6737,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -6800,10 +6800,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (PARENT) { @@ -6903,7 +6903,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here diff --git a/tests/test_dread.toml b/tests/test_dread.toml index 83a9fbb9..aef48f77 100644 --- a/tests/test_dread.toml +++ b/tests/test_dread.toml @@ -13,7 +13,7 @@ defines.PARENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -67,7 +67,7 @@ defines.PARENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -144,7 +144,7 @@ defines.PARENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -227,7 +227,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -332,7 +332,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -457,7 +457,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -592,7 +592,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -729,7 +729,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -830,7 +830,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -938,7 +938,7 @@ if = 'PARENT || NEIGHBORS == 0' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -1059,7 +1059,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -1170,7 +1170,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -1286,7 +1286,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (PARENT) { lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -1406,7 +1406,7 @@ defines.SEEK = [0, 1, 2] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -1494,7 +1494,7 @@ defines.SEEK = [0, 1, 2] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "pricklypear") => 0; @@ -1606,10 +1606,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (PARENT) { @@ -1741,10 +1741,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (PARENT) { diff --git a/tests/test_exhaustion.toml b/tests/test_exhaustion.toml index a1eea43f..1a7e2cb8 100644 --- a/tests/test_exhaustion.toml +++ b/tests/test_exhaustion.toml @@ -32,7 +32,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.SEED = 42 fuzz = 'SEED' @@ -56,7 +56,10 @@ code = ''' // run the test lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + &cfg) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -231,7 +234,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ '0', @@ -265,7 +268,10 @@ code = ''' // run the test lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + &cfg) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -503,7 +509,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.SIZE = [ 'FILE_BUFFER_SIZE/2', '2*FILE_BUFFER_SIZE', @@ -546,7 +552,10 @@ code = ''' // run the test lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + &cfg) => 0; // create a file lfsr_file_t file; @@ -683,7 +692,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ '0', @@ -717,7 +726,10 @@ code = ''' // run the test lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + &cfg) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1096,7 +1108,7 @@ defines.BADBLOCK_BEHAVIOR = [ 'LFS_EMUBD_BADBLOCK_ERASENOOP', ] # we need prog checking to detect read errors -defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' +defines.CKPROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ '0', @@ -1130,7 +1142,10 @@ code = ''' // run the test lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, + LFS_M_RDWR + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + &cfg) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); diff --git a/tests/test_files.toml b/tests/test_files.toml index b426e5c0..3321e975 100644 --- a/tests/test_files.toml +++ b/tests/test_files.toml @@ -7,7 +7,7 @@ after = ['test_dirs', 'test_btree'] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -18,7 +18,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -64,7 +64,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -79,7 +79,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -128,7 +128,7 @@ defines.REMOUNT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -143,7 +143,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rewrite the file @@ -158,7 +158,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -207,7 +207,7 @@ defines.REMOUNT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -222,7 +222,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // try to recreate file, this should error @@ -233,7 +233,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -282,7 +282,7 @@ defines.REMOUNT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -297,7 +297,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // try to open our file as a directory @@ -315,7 +315,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -366,7 +366,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a directory lfsr_mkdir(&lfs, "hello") => 0; @@ -399,7 +399,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our dir with stat @@ -452,7 +452,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try reading our root as a file lfsr_file_t file; @@ -482,7 +482,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our root with stat @@ -531,7 +531,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try reading our invalid path as a file lfsr_file_t file; @@ -561,7 +561,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our root with stat @@ -626,7 +626,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -643,7 +643,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -708,10 +708,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create this many files @@ -744,7 +744,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -797,7 +797,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -851,7 +851,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -934,7 +934,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -950,7 +950,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // remove our file @@ -960,7 +960,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1010,10 +1010,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create this many files @@ -1045,7 +1045,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -1083,7 +1083,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -1091,7 +1091,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our removes worked @@ -1160,7 +1160,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1237,7 +1237,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -1316,7 +1316,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a number of directories to distance our files for (lfs_size_t i = 0; i < N; i++) { @@ -1339,7 +1339,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the file @@ -1349,7 +1349,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1417,7 +1417,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a number of directories to distance our files for (lfs_size_t i = 0; i < N; i++) { @@ -1449,7 +1449,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the file @@ -1459,7 +1459,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1527,7 +1527,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1543,7 +1543,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the file @@ -1553,7 +1553,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1612,7 +1612,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1631,7 +1631,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the file @@ -1641,7 +1641,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that nothing changed in our file/dir with stat @@ -1708,7 +1708,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1727,7 +1727,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the dir @@ -1737,7 +1737,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that nothing changed in our file/dir with stat @@ -1804,7 +1804,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1820,7 +1820,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the file @@ -1830,7 +1830,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that nothing changed in our file/dir with stat @@ -1889,7 +1889,7 @@ defines.FILE_BUFFER_SIZE = 64 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1905,7 +1905,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // rename the file @@ -1915,7 +1915,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that nothing changed in our file/dir with stat @@ -1981,10 +1981,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create this many files @@ -2016,7 +2016,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -2057,7 +2057,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } @@ -2065,7 +2065,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our renames worked @@ -2121,7 +2121,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files while renaming uint32_t prng = 42; @@ -2147,7 +2147,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that renames worked @@ -2196,7 +2196,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files while renaming uint32_t prng = 42; @@ -2222,7 +2222,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that renames worked @@ -2277,7 +2277,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -2391,7 +2391,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -2474,7 +2474,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -2605,7 +2605,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -2696,10 +2696,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // keep some test state on disk to survive powerloss @@ -2835,7 +2835,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok diff --git a/tests/test_forphans.toml b/tests/test_forphans.toml index 0d1b7ec8..47d0ffc8 100644 --- a/tests/test_forphans.toml +++ b/tests/test_forphans.toml @@ -18,7 +18,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -32,7 +32,7 @@ code = ''' // check that the file doesn't _really_ exist lfs_t lfs_; - lfsr_mount(&lfs_, CFG) => 0; + lfsr_mount(&lfs_, LFS_M_RDWR, CFG) => 0; // via stat struct lfs_info info; lfsr_stat(&lfs_, "batman", &info) => LFS_ERR_NOENT; @@ -69,7 +69,7 @@ code = ''' } // check that the file still doesn't _really_ exist - lfsr_mount(&lfs_, CFG) => 0; + lfsr_mount(&lfs_, LFS_M_RDWR, CFG) => 0; // via stat lfsr_stat(&lfs_, "batman", &info) => LFS_ERR_NOENT; // via readdir @@ -94,7 +94,7 @@ code = ''' lfsr_file_sync(&lfs, &file) => 0; // now it should show up - lfsr_mount(&lfs_, CFG) => 0; + lfsr_mount(&lfs_, LFS_M_RDWR, CFG) => 0; // via stat lfsr_stat(&lfs_, "batman", &info) => 0; assert(strcmp(info.name, "batman") == 0); @@ -136,7 +136,7 @@ code = ''' lfsr_file_close(&lfs, &file) => 0; // now it should show up - lfsr_mount(&lfs_, CFG) => 0; + lfsr_mount(&lfs_, LFS_M_RDWR, CFG) => 0; // via stat lfsr_stat(&lfs_, "batman", &info) => 0; assert(strcmp(info.name, "batman") == 0); @@ -176,7 +176,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // should still be there - lfsr_mount(&lfs_, CFG) => 0; + lfsr_mount(&lfs_, LFS_M_RDWR, CFG) => 0; // via stat lfsr_stat(&lfs_, "batman", &info) => 0; assert(strcmp(info.name, "batman") == 0); @@ -228,10 +228,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create a file @@ -273,7 +273,7 @@ code = ''' // and after remounting lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "batman", LFS_O_RDONLY) => 0; prng = 42; @@ -302,10 +302,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // create N files @@ -355,7 +355,7 @@ code = ''' // and after remounting lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; for (lfs_size_t j = 0; j < N; j++) { char name[256]; @@ -393,7 +393,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -600,7 +600,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -801,7 +801,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a desync file lfsr_file_t file; @@ -1134,7 +1134,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a desync file lfsr_file_t file; @@ -1219,7 +1219,7 @@ code = ''' // even after a remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // because the file was desynced, it should still not exist // via stat @@ -1262,7 +1262,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a desync file lfsr_file_t file; @@ -1554,7 +1554,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create N orphans lfsr_file_t orphans[N]; @@ -1767,7 +1767,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create neighboring orphaned files // @@ -1800,7 +1800,7 @@ code = ''' if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -1815,7 +1815,7 @@ code = ''' if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -1866,7 +1866,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create neighboring orphaned files // @@ -1899,7 +1899,7 @@ code = ''' if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -1910,7 +1910,7 @@ code = ''' if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -1954,7 +1954,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create neighboring orphaned files // @@ -1987,7 +1987,7 @@ code = ''' if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -1998,7 +1998,7 @@ code = ''' if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -2038,7 +2038,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -2099,7 +2099,7 @@ code = ''' if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -2112,7 +2112,7 @@ code = ''' if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -2191,7 +2191,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create neighboring orphaned files // @@ -2224,7 +2224,7 @@ code = ''' if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -2235,7 +2235,7 @@ code = ''' if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -2277,7 +2277,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2371,7 +2371,7 @@ code = ''' // even after a remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // via stat lfsr_stat(&lfs, "batman", &info) => LFS_ERR_NOENT; @@ -2410,7 +2410,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2504,7 +2504,7 @@ code = ''' // even after a remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // via stat lfsr_stat(&lfs, "batman", &info) => LFS_ERR_NOENT; @@ -2543,7 +2543,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2719,7 +2719,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // check disk again again // via stat @@ -2774,7 +2774,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2950,7 +2950,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // check disk again again // via stat @@ -3005,7 +3005,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -3216,7 +3216,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // check disk again again // via stat @@ -3271,7 +3271,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -3482,7 +3482,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // check disk again again // via stat @@ -3538,7 +3538,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a zombie lfsr_file_t zombie; @@ -3557,7 +3557,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -3590,7 +3590,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -3650,7 +3650,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a zombie lfsr_file_t zombie; @@ -3669,7 +3669,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -3697,7 +3697,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -3750,7 +3750,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a zombie lfsr_file_t zombie; @@ -3769,7 +3769,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -3797,7 +3797,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -3846,7 +3846,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -3892,7 +3892,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -3922,7 +3922,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -4010,7 +4010,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a zombie lfsr_file_t zombie; @@ -4029,7 +4029,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -4057,7 +4057,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -4098,7 +4098,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, not a zombie yet lfsr_file_t zombie; @@ -4133,7 +4133,7 @@ code = ''' } if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -4186,7 +4186,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -4253,7 +4253,7 @@ code = ''' } if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -4341,7 +4341,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a zombie lfsr_file_t zombie; @@ -4372,7 +4372,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -4400,7 +4400,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -4449,7 +4449,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -4507,7 +4507,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -4537,7 +4537,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -4631,7 +4631,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4692,7 +4692,7 @@ code = ''' // remount? this has no effect on orphans if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // calling lfsr_fs_mkconsistent should clean things up @@ -4719,7 +4719,7 @@ code = ''' for (int remount = 0; remount < 2; remount++) { if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (BOOKENDS & 0x1) { @@ -4772,7 +4772,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4859,7 +4859,7 @@ code = ''' lfsr_file_close(&lfs, &bookend_files[1]) => 0; } lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (BOOKENDS & 0x1) { lfsr_file_open(&lfs, &bookend_files[0], "aatman", LFS_O_RDONLY) => 0; @@ -4922,7 +4922,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5007,7 +5007,7 @@ code = ''' lfsr_file_close(&lfs, &bookend_files[1]) => 0; } lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; if (BOOKENDS & 0x1) { lfsr_file_open(&lfs, &bookend_files[0], "aatman", LFS_O_RDONLY) => 0; @@ -5073,7 +5073,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -5245,7 +5245,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // remount should have no effect // via stat @@ -5316,7 +5316,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -5547,7 +5547,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // remount should have no effect // via stat @@ -5618,7 +5618,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -5898,7 +5898,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // remount should have no effect // via stat @@ -5969,7 +5969,7 @@ defines.MKCONSISTENT = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -6241,7 +6241,7 @@ code = ''' // remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // remount should have no effect // via stat @@ -6313,7 +6313,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -6359,7 +6359,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -6392,7 +6392,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -6480,7 +6480,7 @@ if = 'REMOUNT <= CLOSE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create an interesting directory structure if (INTERDIR) { @@ -6540,7 +6540,7 @@ code = ''' } if (REMOUNT == 2) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -6570,7 +6570,7 @@ code = ''' } if (REMOUNT == 1) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } } if (MKCONSISTENT) { @@ -6672,7 +6672,7 @@ if = '(SIZE*N*(1+DESYNC+ZOMBIE))/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // we need a file handle for each file + desync + zombie lfsr_file_t files[N]; @@ -7019,7 +7019,7 @@ if = '(SIZE*N*(1+DESYNC+ZOMBIE))/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // we need a file handle for each file + desync + zombie lfsr_file_t files[N]; @@ -7367,7 +7367,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -7706,7 +7706,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); diff --git a/tests/test_fsync.toml b/tests/test_fsync.toml index aee3f691..66d96e74 100644 --- a/tests/test_fsync.toml +++ b/tests/test_fsync.toml @@ -7,7 +7,7 @@ after = 'test_fwrite' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - reader kept open, recvs updates from a @@ -108,7 +108,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - writer @@ -228,7 +228,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - writer @@ -362,7 +362,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - writer @@ -498,7 +498,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -549,7 +549,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = SEED; @@ -612,7 +612,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -703,7 +703,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -804,7 +804,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -890,7 +890,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -981,7 +981,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -1084,7 +1084,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -1196,7 +1196,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -1298,7 +1298,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -1411,7 +1411,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; uint8_t between[RW][SIZE]; @@ -1546,7 +1546,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; uint8_t between[RW][SIZE]; @@ -1714,7 +1714,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - reader kept open, recvs updates from a @@ -1801,7 +1801,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - reader kept open, recvs updates from a @@ -1881,7 +1881,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - writer @@ -2002,7 +2002,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - writer @@ -2104,7 +2104,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - reader kept open, recvs updates from a @@ -2206,7 +2206,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // a - writer // b - writer @@ -2352,7 +2352,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -2448,7 +2448,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -2554,7 +2554,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -2642,7 +2642,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -2740,7 +2740,7 @@ defines.CHUNK = '(SIZE+16-1) / 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -2851,7 +2851,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file uint32_t prng = 42; @@ -2969,7 +2969,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; uint8_t between[RW][SIZE]; @@ -3119,7 +3119,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; uint8_t between[RW][SIZE]; diff --git a/tests/test_fwrite.toml b/tests/test_fwrite.toml index 5acaa1a8..fbd75ddb 100644 --- a/tests/test_fwrite.toml +++ b/tests/test_fwrite.toml @@ -35,7 +35,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -58,7 +58,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // note the switch to append here lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY | LFS_O_APPEND) => 0; @@ -70,7 +70,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -143,7 +143,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -166,7 +166,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -197,7 +197,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -221,7 +221,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -251,7 +251,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -323,7 +323,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -349,7 +349,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -380,7 +380,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -404,7 +404,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -434,7 +434,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -508,7 +508,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -532,7 +532,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -549,7 +549,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -633,7 +633,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -657,7 +657,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -676,7 +676,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -693,7 +693,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -766,7 +766,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -790,7 +790,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -811,7 +811,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -895,7 +895,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -919,7 +919,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -942,7 +942,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -963,7 +963,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1033,7 +1033,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -1063,7 +1063,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -1084,7 +1084,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1094,7 +1094,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1171,7 +1171,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -1194,7 +1194,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -1226,7 +1226,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1252,7 +1252,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1285,7 +1285,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1360,7 +1360,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file, truncating in case of powerloss lfsr_file_t file; @@ -1386,7 +1386,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -1418,7 +1418,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1444,7 +1444,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1477,7 +1477,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1549,7 +1549,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1583,7 +1583,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -1610,7 +1610,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1620,7 +1620,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1693,7 +1693,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1727,7 +1727,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } @@ -1758,7 +1758,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_WRONLY) => 0; } } @@ -1768,7 +1768,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -1837,7 +1837,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1921,7 +1921,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1995,7 +1995,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -2068,7 +2068,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2166,7 +2166,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -2233,7 +2233,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2274,7 +2274,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -2347,7 +2347,7 @@ if = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -2381,7 +2381,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_RDWR) => 0; } @@ -2419,7 +2419,7 @@ code = ''' if (REMOUNT) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "hello", LFS_O_RDWR) => 0; } @@ -2485,7 +2485,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat diff --git a/tests/test_gc.toml b/tests/test_gc.toml index 1a8c5059..d79442c6 100644 --- a/tests/test_gc.toml +++ b/tests/test_gc.toml @@ -20,7 +20,7 @@ defines.SIZE = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -84,7 +84,7 @@ defines.SIZE = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -161,7 +161,7 @@ if = 'CKMETA || CKDATA' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -228,7 +228,7 @@ if = 'CKMETA || CKDATA' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -297,7 +297,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -352,7 +352,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -385,7 +385,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -458,7 +458,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -493,7 +493,7 @@ if = 'CKMETA || CKDATA' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -556,7 +556,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -591,7 +591,7 @@ if = 'CKMETA || CKDATA' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -655,7 +655,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -684,7 +684,7 @@ defines.ORPHANS = [1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -759,7 +759,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -793,7 +793,7 @@ defines.ORPHANS = [3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -877,7 +877,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -914,7 +914,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -992,7 +992,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -1028,7 +1028,7 @@ if = 'CKMETA || CKDATA' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -1106,7 +1106,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -1149,7 +1149,7 @@ defines.SIZE = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -1215,7 +1215,7 @@ defines.SIZE = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -1282,7 +1282,7 @@ code = ''' // test creating directories lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // make this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -1304,7 +1304,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1380,7 +1380,7 @@ code = ''' // test fuzz with dirs lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1482,7 +1482,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -1553,7 +1553,7 @@ code = ''' // test creating files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -1585,7 +1585,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -1645,7 +1645,7 @@ code = ''' // test fuzz with files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1784,7 +1784,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -1882,7 +1882,7 @@ code = ''' // test with complex file writes lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -1950,7 +1950,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -2021,7 +2021,7 @@ code = ''' // test with orphans, zombies, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -2377,7 +2377,7 @@ code = ''' // test with orphans, zombies, dirs, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); diff --git a/tests/test_grow.toml b/tests/test_grow.toml index 10a294fb..6b272200 100644 --- a/tests/test_grow.toml +++ b/tests/test_grow.toml @@ -29,7 +29,7 @@ code = ''' cfg.block_count = SMALLER_BLOCK_COUNT; lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -66,7 +66,7 @@ code = ''' // try to mount with a bigger block count cfg = *CFG; cfg.block_count = BIGGER_BLOCK_COUNT; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? lfsr_fs_stat(&lfs, &fsinfo) => 0; @@ -105,7 +105,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // stays after a mount? - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? lfsr_fs_stat(&lfs, &fsinfo) => 0; @@ -148,7 +148,7 @@ code = ''' cfg.block_count = BIGGER_BLOCK_COUNT; lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -185,7 +185,7 @@ code = ''' // try to mount with a smaller block count cfg = *CFG; cfg.block_count = SMALLER_BLOCK_COUNT; - lfsr_mount(&lfs, &cfg) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => LFS_ERR_NOTSUP; ''' # test we can grow a filesystem @@ -209,7 +209,7 @@ code = ''' cfg.block_count = SMALLER_BLOCK_COUNT; lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -246,7 +246,7 @@ code = ''' // try to grow our filesystem cfg = *CFG; cfg.block_count = BIGGER_BLOCK_COUNT; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; lfsr_fs_grow(&lfs, BIGGER_BLOCK_COUNT) => 0; @@ -287,7 +287,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // stays after a mount? - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? lfsr_fs_stat(&lfs, &fsinfo) => 0; @@ -324,7 +324,7 @@ code = ''' cfg.block_count = SMALLER_BLOCK_COUNT; lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -361,7 +361,7 @@ code = ''' // try to grow to same size cfg = *CFG; cfg.block_count = SMALLER_BLOCK_COUNT; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; lfsr_fs_grow(&lfs, SMALLER_BLOCK_COUNT) => 0; @@ -402,7 +402,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // stays after a mount? - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // fsstat up to date? lfsr_fs_stat(&lfs, &fsinfo) => 0; @@ -442,7 +442,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -495,7 +495,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // fsstat up to date? @@ -512,7 +512,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -585,7 +585,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -731,7 +731,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // fsstat up to date? @@ -748,7 +748,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -816,7 +816,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -891,7 +891,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // fsstat up to date? @@ -908,7 +908,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -965,7 +965,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -1157,7 +1157,7 @@ code = ''' // remount? if (REMOUNT) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // fsstat up to date? @@ -1174,7 +1174,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -1259,7 +1259,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -1683,7 +1683,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -2208,14 +2208,14 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { // start with a small number of blocks struct lfs_config cfg = *CFG; cfg.block_count = INIT_BLOCK_COUNT; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -2439,7 +2439,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok @@ -2521,14 +2521,14 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { // start with a small number of blocks struct lfs_config cfg = *CFG; cfg.block_count = INIT_BLOCK_COUNT; lfsr_format(&lfs, &cfg) => 0; // mount with maximum block count - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // fsstat up to date? struct lfs_fsinfo fsinfo; @@ -2879,7 +2879,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok diff --git a/tests/test_incompat.toml b/tests/test_incompat.toml index 6311cfb4..5abf1013 100644 --- a/tests/test_incompat.toml +++ b/tests/test_incompat.toml @@ -19,7 +19,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_RM | LFSR_TAG_MAGIC, 0, @@ -27,7 +27,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_CORRUPT; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_CORRUPT; ''' # test that we fail if we find bad magic @@ -42,7 +42,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_MAGIC, 0, @@ -50,7 +50,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_CORRUPT; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_CORRUPT; ''' # test that we fail to mount after a major version bump @@ -65,7 +65,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_VERSION, 0, @@ -75,7 +75,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that we fail to mount after a minor version bump @@ -90,7 +90,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_VERSION, 0, @@ -100,7 +100,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that we fail to mount incompatible rcompat flags @@ -116,7 +116,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_RCOMPAT, 0, @@ -126,7 +126,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that we fail to mount incompatible wcompat flags @@ -142,7 +142,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_WCOMPAT, 0, @@ -152,7 +152,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that an incompatible ocompat flag is a noop @@ -168,7 +168,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_OCOMPAT, 0, @@ -178,7 +178,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should _not_ fail, ocompat should always be ignored - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_unmount(&lfs) => 0; ''' @@ -194,7 +194,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR_CAT( LFSR_TAG_RCOMPAT, 0, @@ -203,7 +203,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' [cases.test_incompat_wcompat_overflow] @@ -217,7 +217,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR_CAT( LFSR_TAG_WCOMPAT, 0, @@ -226,7 +226,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' [cases.test_incompat_ocompat_overflow] @@ -240,7 +240,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR_CAT( LFSR_TAG_OCOMPAT, 0, @@ -249,7 +249,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should _not_ fail, ocompat should always be ignored - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_unmount(&lfs) => 0; ''' @@ -266,7 +266,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_GEOMETRY, 0, @@ -276,7 +276,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that we fail to mount after incompatible block counts @@ -292,7 +292,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_GEOMETRY, 0, @@ -302,7 +302,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that we fail to mount after incompatible name limit @@ -318,7 +318,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_NAMELIMIT, 0, @@ -326,7 +326,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test that we fail to mount after incompatible file limit @@ -341,7 +341,7 @@ code = ''' // // note we're messing around with internals to do this! this // is not a user API - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR_CAT( LFSR_TAG_FILELIMIT, 0, @@ -354,7 +354,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test what happens if we find an unknown config @@ -366,7 +366,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // create an unknown config - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( LFSR_ATTR( LFSR_TAG_CONFIG + 0x13, 0, @@ -374,7 +374,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' # test what happens if we find an unknown file type @@ -386,7 +386,7 @@ code = ''' lfsr_format(&lfs, CFG) => 0; // create some files - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_t file; lfsr_file_open(&lfs, &file, "a", LFS_O_WRONLY | LFS_O_CREAT | LFS_O_EXCL) => 0; @@ -406,7 +406,7 @@ code = ''' lfsr_unmount(&lfs) => 0; // change a file's type to something unknown - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_t mdir; lfsr_did_t did; const char *name; @@ -421,5 +421,5 @@ code = ''' lfsr_unmount(&lfs) => 0; // mount should now fail - lfsr_mount(&lfs, CFG) => LFS_ERR_NOTSUP; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => LFS_ERR_NOTSUP; ''' diff --git a/tests/test_mount.toml b/tests/test_mount.toml new file mode 100644 index 00000000..7294e7ee --- /dev/null +++ b/tests/test_mount.toml @@ -0,0 +1,37 @@ +# Advanced mount tests +after = ['test_mtree', 'test_traversal'] + +# test we can mount +[cases.test_mount_simple] +code = ''' + lfs_t lfs; + lfsr_format(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; + lfsr_unmount(&lfs) => 0; +''' + +# test that various mount flags are returned by lfsr_fs_stat +[cases.test_mount_flags] +defines.RDONLY = [false, true] +defines.CKPROGS = [false, true] +code = ''' + lfs_t lfs; + lfsr_format(&lfs, CFG) => 0; + lfsr_mount(&lfs, + ((RDONLY) ? LFS_M_RDONLY : LFS_M_RDWR) + | ((CKPROGS) ? LFS_M_CKPROGS : 0), + CFG) => 0; + + struct lfs_fsinfo fsinfo; + lfsr_fs_stat(&lfs, &fsinfo) => 0; + assert(fsinfo.flags == ( + ((RDONLY) ? LFS_I_RDONLY : 0) + | ((CKPROGS) ? LFS_I_CKPROGS : 0) + | LFS_I_CANLOOKAHEAD + | LFS_I_UNCOMPACTED)); + + lfsr_unmount(&lfs) => 0; +''' + + +# TODO should we move test_incompat here? diff --git a/tests/test_mtree.toml b/tests/test_mtree.toml index 0951a5ca..216ee474 100644 --- a/tests/test_mtree.toml +++ b/tests/test_mtree.toml @@ -10,7 +10,7 @@ defines.LOOKAHEAD_SIZE = 'BLOCK_COUNT / 8' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_unmount(&lfs) => 0; ''' @@ -21,7 +21,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); for (lfs_size_t i = 0; i < N; i++) { @@ -43,7 +43,7 @@ code = ''' // check things stay sane after remount - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; for (lfs_size_t i = 0; i < N; i++) { lfsr_data_t data; @@ -63,7 +63,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); for (lfs_size_t i = 0; i < N; i++) { @@ -88,7 +88,7 @@ code = ''' // check things stay sane after remount - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; for (lfs_size_t i = 0; i < N; i++) { lfsr_data_t data; @@ -108,7 +108,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); for (lfs_size_t i = 0; i < N; i++) { @@ -134,7 +134,7 @@ code = ''' // check things stay sane after remount - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mdir_lookup(&lfs, &lfs.mroot, LFSR_TAG_UATTR(1), &data) => 0; lfsr_data_read(&lfs, &data, buffer, 4) => 1; @@ -154,7 +154,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -197,7 +197,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -229,7 +229,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -280,7 +280,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined and split assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -314,7 +314,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -393,7 +393,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was split correctly assert(lfsr_mtree_weight_(&lfs.mtree) == (3 << lfs.mdir_bits)); @@ -439,7 +439,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // create entries @@ -488,7 +488,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try looking up each entry lfsr_mtree_lookup(&lfs, 0, &mdir) => 0; @@ -521,7 +521,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); bool sim[N]; @@ -589,7 +589,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try looking up each entry lfsr_mtree_lookup(&lfs, 0, &mdir) => 0; @@ -625,7 +625,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -683,7 +683,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was dropped assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -711,7 +711,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -771,7 +771,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was dropped assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -799,7 +799,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -846,7 +846,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was dropped assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -870,7 +870,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -944,7 +944,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert split/drop worked out assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -978,7 +978,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1052,7 +1052,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert split/drop worked out assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -1088,7 +1088,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); bool sim[N]; @@ -1182,7 +1182,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try looking up each entry lfsr_mtree_lookup(&lfs, 0, &mdir) => 0; @@ -1220,7 +1220,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1290,7 +1290,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -1334,7 +1334,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1414,7 +1414,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined and split assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -1460,7 +1460,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1540,7 +1540,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined and split assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -1586,7 +1586,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1629,7 +1629,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert that our attr is still in the mroot lfsr_mtree_lookup(&lfs, (0 << lfs.mdir_bits)+1, &mdir) => 0; @@ -1661,7 +1661,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1738,7 +1738,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert that our attr is still in the mroot lfsr_mtree_lookup(&lfs, (0 << lfs.mdir_bits)+1, &mdir) => 0; @@ -1783,7 +1783,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1845,7 +1845,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert that our attr is still in the mroot lfsr_mtree_lookup(&lfs, (0 << lfs.mdir_bits)+1, &mdir) => 0; @@ -1882,7 +1882,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -1967,7 +1967,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined and split assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -2013,7 +2013,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -2107,7 +2107,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was split correctly assert(lfsr_mtree_weight_(&lfs.mtree) == (3 << lfs.mdir_bits)); @@ -2157,7 +2157,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -2226,7 +2226,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was dropped assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -2256,7 +2256,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // force mroot to compact once, so the second compact below will @@ -2307,7 +2307,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -2341,7 +2341,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // force mroot to compact once, so the second compact below will @@ -2400,7 +2400,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined and split assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -2438,7 +2438,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); bool sim[N]; @@ -2561,7 +2561,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try looking up each entry lfsr_mtree_lookup(&lfs, 0, &mdir) => 0; @@ -2594,7 +2594,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -2653,7 +2653,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -2703,7 +2703,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -2755,7 +2755,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -2828,7 +2828,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -2913,7 +2913,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -2971,7 +2971,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -3060,7 +3060,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -3147,7 +3147,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -3249,7 +3249,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // setup our neighbors @@ -3347,7 +3347,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // insert at least one entry @@ -3429,7 +3429,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert that our entry is still in the mtree lfsr_mtree_namelookup(&lfs, 0, "a", 1, @@ -3449,7 +3449,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -3552,7 +3552,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined assert(lfsr_mtree_weight_(&lfs.mtree) == (1 << lfs.mdir_bits)); @@ -3581,7 +3581,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -3692,7 +3692,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdirs were unininlined and split assert(lfsr_mtree_weight_(&lfs.mtree) == (2 << lfs.mdir_bits)); @@ -3723,7 +3723,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -3857,7 +3857,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert mdir was split correctly assert(lfsr_mtree_weight_(&lfs.mtree) == (3 << lfs.mdir_bits)); @@ -3894,7 +3894,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // insert at least one entry @@ -3988,7 +3988,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // assert that our entry is still in the mtree lfsr_mtree_namelookup(&lfs, 0, "a", 1, @@ -4009,7 +4009,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); // create entries @@ -4121,7 +4121,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try looking up each entry lfsr_mtree_lookup(&lfs, 0, &mdir) => 0; @@ -4154,7 +4154,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); bool sim[N]; @@ -4286,7 +4286,7 @@ code = ''' // check things stay sane after remount lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try looking up each entry lfsr_mtree_lookup(&lfs, 0, &mdir) => 0; @@ -4320,7 +4320,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS( @@ -4397,7 +4397,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; @@ -4454,7 +4454,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfs_alloc_ckpoint(&lfs); lfsr_data_t data; diff --git a/tests/test_paths.toml b/tests/test_paths.toml index 4d4046d3..873821e3 100644 --- a/tests/test_paths.toml +++ b/tests/test_paths.toml @@ -6,7 +6,7 @@ after = 'test_dirs' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "tea") => 0; lfsr_mkdir(&lfs, "tea/green") => 0; lfsr_mkdir(&lfs, "tea/oolong") => 0; @@ -31,7 +31,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "tea") => 0; lfsr_mkdir(&lfs, "tea/green") => 0; lfsr_mkdir(&lfs, "tea/oolong") => 0; @@ -58,7 +58,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "tea") => 0; lfsr_mkdir(&lfs, "tea/green") => 0; lfsr_mkdir(&lfs, "tea/oolong") => 0; @@ -87,7 +87,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "tea") => 0; lfsr_mkdir(&lfs, "tea/green") => 0; lfsr_mkdir(&lfs, "tea/oolong") => 0; @@ -120,7 +120,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "tea") => 0; lfsr_mkdir(&lfs, "tea/green") => 0; lfsr_mkdir(&lfs, "tea/oolong") => 0; @@ -145,7 +145,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, ".milk") => 0; struct lfs_info info; lfsr_stat(&lfs, ".milk", &info) => 0; @@ -160,7 +160,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "tea") => 0; lfsr_mkdir(&lfs, "tea/green") => 0; lfsr_mkdir(&lfs, "tea/oolong") => 0; @@ -187,7 +187,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG); - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; struct lfs_info info; lfsr_stat(&lfs, "milk", &info) => LFS_ERR_NOENT; lfsr_stat(&lfs, "milk/cream", &info) => LFS_ERR_NOENT; @@ -212,7 +212,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; struct lfs_info info; lfsr_stat(&lfs, "/", &info) => 0; assert(strcmp(info.name, "/") == 0); @@ -233,7 +233,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; struct lfs_info info; lfsr_stat(&lfs, "/", &info) => 0; assert(strcmp(info.name, "/") == 0); @@ -267,7 +267,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "coffee") => 0; lfsr_mkdir(&lfs, "coffee/drip") => 0; lfsr_mkdir(&lfs, "coffee/espresso") => 0; @@ -295,7 +295,7 @@ code = ''' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_mkdir(&lfs, "coffee") => 0; lfsr_mkdir(&lfs, "coffee/drip") => 0; lfsr_mkdir(&lfs, "coffee/espresso") => 0; diff --git a/tests/test_powerloss.toml b/tests/test_powerloss.toml index e576bb18..4bb55155 100644 --- a/tests/test_powerloss.toml +++ b/tests/test_powerloss.toml @@ -10,6 +10,7 @@ after = [ 'test_forphans', 'test_traversal', 'test_gc', + 'test_mount', ] @@ -31,10 +32,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -52,7 +53,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -141,10 +142,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -175,7 +176,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -244,10 +245,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -386,7 +387,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok @@ -476,10 +477,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } if (MKCONSISTENT) { lfsr_fs_mkconsistent(&lfs) => 0; @@ -732,7 +733,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok diff --git a/tests/test_rbyd.toml b/tests/test_rbyd.toml index 51c3cd11..cc0c0cc1 100644 --- a/tests/test_rbyd.toml +++ b/tests/test_rbyd.toml @@ -17,7 +17,7 @@ defines.BLOCK_SIZE = 32768 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -54,7 +54,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -92,7 +92,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -131,7 +131,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -251,7 +251,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -373,7 +373,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -463,7 +463,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -555,7 +555,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -626,7 +626,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -703,7 +703,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -794,7 +794,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -969,7 +969,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -1172,7 +1172,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -1375,7 +1375,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -1594,7 +1594,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -1841,7 +1841,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2043,7 +2043,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2266,7 +2266,7 @@ defines.PERMUTATION = -1 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2357,7 +2357,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2439,7 +2439,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2536,7 +2536,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2639,7 +2639,7 @@ defines.PERMUTATION = -1 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2711,7 +2711,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2783,7 +2783,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2898,7 +2898,7 @@ in = 'lfs.c' defines.ORDER = [0, 1, 2] code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -2962,7 +2962,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -3090,7 +3090,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -3244,7 +3244,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -3343,7 +3343,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -3502,7 +3502,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -3765,7 +3765,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -3873,7 +3873,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4004,7 +4004,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4119,7 +4119,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4221,7 +4221,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4439,7 +4439,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4536,7 +4536,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4609,7 +4609,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4740,7 +4740,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4831,7 +4831,7 @@ in = 'lfs.c' defines.ORDER = [0, 1, 2] code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -4899,7 +4899,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -5078,7 +5078,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -5460,7 +5460,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -5570,7 +5570,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -5681,7 +5681,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -5893,7 +5893,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6008,7 +6008,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6146,7 +6146,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6355,7 +6355,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6488,7 +6488,7 @@ defines.ORDER = [0, 1, 2] defines.M = 'range(1, 4)' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6579,7 +6579,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6725,7 +6725,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -6891,7 +6891,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -7070,7 +7070,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -7363,7 +7363,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -7662,7 +7662,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -7930,7 +7930,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -8298,7 +8298,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -8645,7 +8645,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -8992,7 +8992,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -9316,7 +9316,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -9640,7 +9640,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -10091,7 +10091,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -10548,7 +10548,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -10710,7 +10710,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -10911,7 +10911,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11041,7 +11041,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11187,7 +11187,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11327,7 +11327,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11507,7 +11507,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11656,7 +11656,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11825,7 +11825,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -11935,7 +11935,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -12182,7 +12182,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -12301,7 +12301,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -12391,7 +12391,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -12480,7 +12480,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -13192,7 +13192,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -13488,7 +13488,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -13610,7 +13610,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -13742,7 +13742,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -13874,7 +13874,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14018,7 +14018,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14175,7 +14175,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14307,7 +14307,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14451,7 +14451,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14607,7 +14607,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14771,7 +14771,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -14962,7 +14962,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15123,7 +15123,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15317,7 +15317,7 @@ defines.PERMUTATION = -1 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15407,7 +15407,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15551,7 +15551,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15697,7 +15697,7 @@ defines.PERMUTATION = -1 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15790,7 +15790,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -15944,7 +15944,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16100,7 +16100,7 @@ defines.PERMUTATION = -1 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16187,7 +16187,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16331,7 +16331,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16468,7 +16468,7 @@ defines.PERMUTATION = -1 in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16558,7 +16558,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16702,7 +16702,7 @@ if = 'PROG_SIZE < 512' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16852,7 +16852,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16901,7 +16901,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -16960,7 +16960,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -17018,7 +17018,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, @@ -17086,7 +17086,7 @@ code = ''' in = 'lfs.c' code = ''' lfs_t lfs; - lfs_init(&lfs, CFG) => 0; + lfs_init(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_rbyd_t init_rbyd = { .blocks[0] = 0, diff --git a/tests/test_relocations.toml b/tests/test_relocations.toml index 7319c5ed..ce8e2402 100644 --- a/tests/test_relocations.toml +++ b/tests/test_relocations.toml @@ -18,7 +18,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // make this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -32,7 +32,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -100,7 +100,7 @@ fuzz = 'SEED' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -194,7 +194,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -258,7 +258,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -282,7 +282,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -334,7 +334,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -465,7 +465,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -547,7 +547,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -887,7 +887,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 16' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -1316,10 +1316,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // keep some test state on disk to survive powerloss @@ -1455,7 +1455,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok @@ -1537,10 +1537,10 @@ reentrant = true code = ''' // format once per test lfs_t lfs; - int err = lfsr_mount(&lfs, CFG); + int err = lfsr_mount(&lfs, LFS_M_RDWR, CFG); if (err) { lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // keep some test state on disk to survive powerloss @@ -1790,7 +1790,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that things look more-or-less ok diff --git a/tests/test_traversal.toml b/tests/test_traversal.toml index 17540a91..aa9dc9fa 100644 --- a/tests/test_traversal.toml +++ b/tests/test_traversal.toml @@ -17,7 +17,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try traversing lfsr_traversal_t t; @@ -50,7 +50,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try traversing lfsr_traversal_t t; @@ -92,7 +92,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try traversing lfsr_traversal_t t; @@ -133,7 +133,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -187,7 +187,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } for (lfs_size_t i = 0; i < N; i++) { @@ -243,7 +243,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -309,7 +309,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } prng = 42; @@ -358,7 +358,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files lfsr_file_t files[N]; @@ -442,7 +442,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } prng = 42; @@ -484,7 +484,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -547,7 +547,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } for (lfs_size_t i = 0; i < N; i++) { @@ -603,7 +603,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -678,7 +678,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } prng = 42; @@ -727,7 +727,7 @@ if = '(SIZE*N)/BLOCK_SIZE <= 32' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files lfsr_file_t files[N]; @@ -820,7 +820,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } prng = 42; @@ -864,7 +864,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -949,7 +949,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -1045,7 +1045,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files lfsr_file_t files[N]; @@ -1138,7 +1138,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -1221,7 +1221,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -1315,7 +1315,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files lfsr_file_t files[N]; @@ -1406,7 +1406,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many directories for (lfs_size_t i = 0; i < N; i++) { @@ -1490,7 +1490,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files uint32_t prng = 42; @@ -1585,7 +1585,7 @@ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create this many files lfsr_file_t files[N]; @@ -1677,7 +1677,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // check flags before struct lfs_fsinfo fsinfo; @@ -1722,7 +1722,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try traversing lfsr_traversal_t t; @@ -1782,7 +1782,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try traversing lfsr_traversal_t t; @@ -1851,7 +1851,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // try traversing lfsr_traversal_t t; @@ -1902,7 +1902,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // make a file lfsr_file_t file; @@ -1959,7 +1959,7 @@ defines.CKDATA = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // make a file lfsr_file_t file; @@ -2024,7 +2024,7 @@ defines.SIZE = [ code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2100,7 +2100,7 @@ defines.SYNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2183,7 +2183,7 @@ defines.TRUNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2269,7 +2269,7 @@ defines.TRUNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2368,7 +2368,7 @@ defines.TRUNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2460,7 +2460,7 @@ defines.SIZE = 'FILE_BUFFER_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2545,7 +2545,7 @@ defines.INLINE_SIZE = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2643,7 +2643,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2736,7 +2736,7 @@ defines.DESYNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2826,7 +2826,7 @@ defines.DESYNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -2929,7 +2929,7 @@ defines.DESYNC = [false, true] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3025,7 +3025,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3108,7 +3108,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3209,7 +3209,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3305,7 +3305,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3407,7 +3407,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3527,7 +3527,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3644,7 +3644,7 @@ defines.BLOCK_RECYCLES = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3741,7 +3741,7 @@ defines.BLOCK_RECYCLES = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3837,7 +3837,7 @@ defines.BLOCK_RECYCLES = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -3948,7 +3948,7 @@ defines.BLOCK_RECYCLES = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4056,7 +4056,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4229,7 +4229,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4409,7 +4409,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4583,7 +4583,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4651,7 +4651,7 @@ code = ''' lfsr_unmount(&lfs) => 0; struct lfs_config cfg = *CFG; cfg.block_recycles = 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // try traversing lfsr_traversal_t t; @@ -4754,7 +4754,7 @@ defines.SIZE = '2*BLOCK_SIZE' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -4822,7 +4822,7 @@ code = ''' lfsr_unmount(&lfs) => 0; struct lfs_config cfg = *CFG; cfg.block_recycles = 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; // try traversing lfsr_traversal_t t; @@ -4934,7 +4934,7 @@ defines.BLOCK_RECYCLES = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5111,7 +5111,7 @@ defines.BLOCK_RECYCLES = 0 code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5302,7 +5302,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5380,7 +5380,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -5407,7 +5407,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5513,7 +5513,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -5540,7 +5540,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5620,7 +5620,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -5645,7 +5645,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5766,7 +5766,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "jellyfish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -5797,7 +5797,7 @@ defines.COMPACTSET = 'range(0x7)' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -5977,7 +5977,7 @@ code = ''' lfsr_file_close(&lfs, &file2) => 0; lfsr_file_close(&lfs, &file3) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "jellyfish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file3, "octopus", LFS_O_RDONLY) => 0; @@ -6014,7 +6014,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -6195,7 +6195,7 @@ code = ''' lfsr_file_close(&lfs, &file3) => 0; lfsr_file_close(&lfs, &file4) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "jellyfish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file3, "octopus", LFS_O_RDONLY) => 0; @@ -6242,7 +6242,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -6285,7 +6285,7 @@ code = ''' lfsr_unmount(&lfs) => 0; struct lfs_config cfg = *CFG; cfg.block_recycles = 0; - lfsr_mount(&lfs, &cfg) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, &cfg) => 0; lfsr_file_open(&lfs, &file1, "jellyfish", LFS_O_RDWR) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDWR) => 0; @@ -6317,7 +6317,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "jellyfish", LFS_O_RDWR) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDWR) => 0; @@ -6407,7 +6407,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "jellyfish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -6441,7 +6441,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -6524,7 +6524,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -6552,7 +6552,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -6634,7 +6634,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -6662,7 +6662,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -6746,7 +6746,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -6774,7 +6774,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -6917,7 +6917,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7047,7 +7047,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; @@ -7077,7 +7077,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7208,7 +7208,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -7238,7 +7238,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7367,7 +7367,7 @@ code = ''' if (remount) { lfsr_file_close(&lfs, &file) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file, "jellyfish", LFS_O_RDONLY) => 0; } @@ -7397,7 +7397,7 @@ in = 'lfs.c' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7581,7 +7581,7 @@ defines.ORPHANS = [0, 1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7687,7 +7687,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -7718,7 +7718,7 @@ defines.ORPHANS = [0, 1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7823,7 +7823,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -7858,7 +7858,7 @@ defines.ORPHANS = [0, 1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -7978,7 +7978,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -8013,7 +8013,7 @@ defines.ORPHANS = [0, 1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -8131,7 +8131,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -8167,7 +8167,7 @@ defines.ORPHANS = [0, 1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -8295,7 +8295,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -8331,7 +8331,7 @@ defines.ORPHANS = [0, 1, 2, 3, 100] code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -8457,7 +8457,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -8490,7 +8490,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -8642,7 +8642,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -8675,7 +8675,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -8806,7 +8806,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -8843,7 +8843,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -9009,7 +9009,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -9047,7 +9047,7 @@ defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' code = ''' lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; uint32_t prng = 42; @@ -9264,7 +9264,7 @@ code = ''' lfsr_file_close(&lfs, &file1) => 0; lfsr_file_close(&lfs, &file2) => 0; lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; lfsr_file_open(&lfs, &file1, "cuttlefish", LFS_O_RDONLY) => 0; lfsr_file_open(&lfs, &file2, "octopus", LFS_O_RDONLY) => 0; } @@ -9309,7 +9309,7 @@ code = ''' // test creating directories lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // open a traversal lfsr_traversal_t t; @@ -9345,7 +9345,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -9422,7 +9422,7 @@ code = ''' // test fuzz with dirs lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -9538,7 +9538,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // grm should be zero here @@ -9610,7 +9610,7 @@ code = ''' // test creating files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // open a traversal lfsr_traversal_t t; @@ -9656,7 +9656,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our writes worked @@ -9717,7 +9717,7 @@ code = ''' // test fuzz with files lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -9870,7 +9870,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check that our files match our simulation @@ -9969,7 +9969,7 @@ code = ''' // test with complex file writes lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // create a file lfsr_file_t file; @@ -10051,7 +10051,7 @@ code = ''' // remount? if (remount) { lfsr_unmount(&lfs) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; } // check our file with stat @@ -10123,7 +10123,7 @@ code = ''' // test with orphans, zombies, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t)); @@ -10494,7 +10494,7 @@ code = ''' // test with orphans, zombies, dirs, etc lfs_t lfs; lfsr_format(&lfs, CFG) => 0; - lfsr_mount(&lfs, CFG) => 0; + lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0; // set up a simulation to compare against lfs_size_t *sim = malloc(N*sizeof(lfs_size_t));