Skip to content

Commit e36dd2c

Browse files
committed
Assert all new code paths for temporary test
1 parent ff1e46b commit e36dd2c

File tree

2 files changed

+9
-264
lines changed

2 files changed

+9
-264
lines changed

lfs.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,7 @@ static int lfs_dir_getinfo(lfs_t *lfs, lfs_mdir_t *dir,
14271427

14281428
if (lfs_tag_type3(tag) == LFS_TYPE_CTZSTRUCT
14291429
|| lfs_tag_type3(tag) == LFS_TYPE_FLATSTRUCT) {
1430+
LFS_ASSERT(lfs_tag_type3(tag) != LFS_TYPE_FLATSTRUCT);
14301431
info->size = ctz.size;
14311432
} else if (lfs_tag_type3(tag) == LFS_TYPE_INLINESTRUCT) {
14321433
info->size = lfs_tag_size(tag);
@@ -3133,6 +3134,7 @@ static int lfs_file_rawopencfg(lfs_t *lfs, lfs_file_t *file,
31333134
} else if (lfs_tag_type3(tag) == LFS_TYPE_FLATSTRUCT) {
31343135
// mark this as a flat file
31353136
LFS_ASSERT((file->flags & LFS_F_INLINE) == 0);
3137+
LFS_ASSERT(false);
31363138
file->flags |= LFS_F_FLAT;
31373139
}
31383140

@@ -3273,6 +3275,7 @@ static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
32733275
if (file->flags & LFS_F_FLAT) {
32743276
// flat file access not yet implemented
32753277
LFS_ASSERT((file->flags & LFS_F_INLINE) == 0);
3278+
LFS_ASSERT(false);
32763279
return LFS_ERR_INVAL;
32773280
}
32783281

@@ -3368,6 +3371,7 @@ static int lfs_file_rawsync(lfs_t *lfs, lfs_file_t *file) {
33683371
if (file->flags & LFS_F_FLAT) {
33693372
// update the flat file reference
33703373
LFS_ASSERT((file->flags & LFS_F_INLINE) == 0);
3374+
LFS_ASSERT(false);
33713375
type = LFS_TYPE_FLATSTRUCT;
33723376
ctz = file->ctz;
33733377
lfs_ctz_tole32(&ctz);
@@ -3426,6 +3430,7 @@ static lfs_ssize_t lfs_file_flushedread(lfs_t *lfs, lfs_file_t *file,
34263430
if (file->flags & LFS_F_FLAT) {
34273431
// reading flat files is not yet implemented
34283432
LFS_ASSERT((file->flags & LFS_F_INLINE) == 0);
3433+
LFS_ASSERT(false);
34293434
return LFS_ERR_INVAL;
34303435
}
34313436
if (!(file->flags & LFS_F_INLINE)) {
@@ -3657,6 +3662,7 @@ static lfs_soff_t lfs_file_rawseek(lfs_t *lfs, lfs_file_t *file,
36573662
if (file->flags & LFS_F_FLAT) {
36583663
// seeking flat files is not yet implemented
36593664
LFS_ASSERT((file->flags & LFS_F_INLINE) == 0);
3665+
LFS_ASSERT(false);
36603666
return LFS_ERR_INVAL;
36613667
}
36623668

@@ -3705,6 +3711,7 @@ static int lfs_file_rawtruncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size) {
37053711

37063712
if (file->flags & LFS_F_FLAT) {
37073713
LFS_ASSERT((file->flags & LFS_F_INLINE) == 0);
3714+
LFS_ASSERT(false);
37083715
if (size == oldsize) {
37093716
// noop
37103717
return 0;
@@ -4585,6 +4592,7 @@ int lfs_fs_rawtraverse(lfs_t *lfs,
45854592
return err;
45864593
}
45874594
} else if (lfs_tag_type3(tag) == LFS_TYPE_FLATSTRUCT) {
4595+
LFS_ASSERT(false);
45884596
if (ctz.size) {
45894597
lfs_size_t nblocks = ((ctz.size - 1) / lfs->cfg->block_size) + 1;
45904598
lfs_block_t bend = ctz.head + nblocks;
@@ -4616,6 +4624,7 @@ int lfs_fs_rawtraverse(lfs_t *lfs,
46164624
}
46174625

46184626
if (f->flags & LFS_F_FLAT) {
4627+
LFS_ASSERT(false);
46194628
if (f->flags & LFS_F_DIRTY) {
46204629
if (f->ctz.size) {
46214630
lfs_size_t nblocks = ((f->ctz.size - 1) / lfs->cfg->block_size) + 1;

tests/test_flat.toml

Lines changed: 0 additions & 264 deletions
This file was deleted.

0 commit comments

Comments
 (0)